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
e242a828
Commit
e242a828
authored
Dec 04, 2019
by
王栋源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wdy
parent
61220171
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
22 additions
and
1735 deletions
+22
-1735
igirl-channel-gateway/app/base/api/api.base.js
+0
-1
igirl-channel-gateway/app/base/api/doc.base.js
+0
-115
igirl-channel-gateway/app/base/api/impl/action/pushBusiness.js
+0
-99
igirl-channel-gateway/app/base/api/impl/action/tmOrder.js
+0
-85
igirl-channel-gateway/app/base/api/impl/action/tradetransfer.js
+1
-1
igirl-channel-gateway/app/base/api/impl/auth/accessAuth.js
+0
-44
igirl-channel-gateway/app/base/api/impl/test/testApi.js
+0
-31
igirl-channel-gateway/app/base/controller/ctl.base.js
+12
-0
igirl-channel-gateway/app/base/controller/impl/auth/userCtl.js
+0
-85
igirl-channel-gateway/app/base/controller/impl/common/oplogCtl.js
+5
-5
igirl-channel-gateway/app/base/db/cache/apiAccessKeyCache.js
+0
-32
igirl-channel-gateway/app/base/db/cache/apiAccessKeyCheckCache.js
+0
-39
igirl-channel-gateway/app/base/db/cache/apiAppIdCheckCache.js
+0
-26
igirl-channel-gateway/app/base/db/cache/apiUserCache.js
+0
-63
igirl-channel-gateway/app/base/db/impl/common/apiDocManager.js
+0
-36
igirl-channel-gateway/app/base/db/impl/dbdelivery/customercontactsDao.js
+0
-43
igirl-channel-gateway/app/base/db/impl/dbdelivery/customerinfoDao.js
+0
-67
igirl-channel-gateway/app/base/db/impl/dbdelivery/deliveryproductDao.js
+0
-8
igirl-channel-gateway/app/base/db/impl/dbdelivery/flowlogDao.js
+0
-17
igirl-channel-gateway/app/base/db/impl/dbdelivery/officialinfoDao.js
+0
-16
igirl-channel-gateway/app/base/db/impl/dbtrademark/tmdeliveryDao.js
+0
-16
igirl-channel-gateway/app/base/db/impl/dbtrademark/trademarkDao.js
+0
-16
igirl-channel-gateway/app/base/db/metadata/apps/platform.js
+1
-1
igirl-channel-gateway/app/base/db/models/dbdelivery/customercontacts.js
+0
-31
igirl-channel-gateway/app/base/db/models/dbdelivery/customerinfo.js
+0
-51
igirl-channel-gateway/app/base/db/models/dbdelivery/deliveryproduct.js
+0
-35
igirl-channel-gateway/app/base/db/models/dbdelivery/flowlog.js
+0
-32
igirl-channel-gateway/app/base/db/models/dbdelivery/officialinfo.js
+0
-38
igirl-channel-gateway/app/base/db/models/dbtrademark/tmdelivery.js
+0
-82
igirl-channel-gateway/app/base/db/models/dbtrademark/trademark.js
+0
-0
igirl-channel-gateway/app/base/service/impl/dbdelivery/customercontactsSve.js
+0
-63
igirl-channel-gateway/app/base/service/impl/dbdelivery/customerinfoSve.js
+0
-173
igirl-channel-gateway/app/base/service/impl/dbdelivery/deliveryproductSve.js
+0
-21
igirl-channel-gateway/app/base/service/impl/dbdelivery/flowlogSve.js
+0
-10
igirl-channel-gateway/app/base/service/impl/dbdelivery/officialinfoSve.js
+0
-10
igirl-channel-gateway/app/base/service/impl/dbtrademark/tmdeliverySve.js
+0
-21
igirl-channel-gateway/app/base/service/impl/dbtrademark/trademarkSve.js
+0
-10
igirl-channel-gateway/app/base/service/sve.base.js
+0
-32
igirl-channel-gateway/app/base/utils/businessManager/opPlatformUtils.js
+0
-156
igirl-channel-gateway/app/base/utils/businessManager/pushUtils.js
+0
-114
igirl-channel-gateway/app/config/settings.js
+3
-10
No files found.
igirl-channel-gateway/app/base/api/api.base.js
View file @
e242a828
const
system
=
require
(
"../system"
);
const
system
=
require
(
"../system"
);
const
settings
=
require
(
"../../config/settings"
);
const
settings
=
require
(
"../../config/settings"
);
const
DocBase
=
require
(
"./doc.base"
);
const
uuidv4
=
require
(
'uuid/v4'
);
const
uuidv4
=
require
(
'uuid/v4'
);
const
md5
=
require
(
"MD5"
);
const
md5
=
require
(
"MD5"
);
class
APIBase
{
class
APIBase
{
...
...
igirl-channel-gateway/app/base/api/doc.base.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../system"
);
const
uuidv4
=
require
(
'uuid/v4'
);
class
DocBase
{
constructor
(){
this
.
apiDoc
=
{
group
:
"逻辑分组"
,
groupDesc
:
""
,
name
:
""
,
desc
:
"请对当前类进行描述"
,
exam
:
"概要示例"
,
methods
:[]
};
this
.
initClassDoc
();
}
initClassDoc
(){
// this.descClass();
// this.descMethods();
}
descClass
(){
var
classDesc
=
this
.
classDesc
();
this
.
apiDoc
.
group
=
classDesc
.
groupName
;
this
.
apiDoc
.
groupDesc
=
classDesc
.
groupDesc
;
this
.
apiDoc
.
name
=
classDesc
.
name
;
this
.
apiDoc
.
desc
=
classDesc
.
desc
;
this
.
apiDoc
.
exam
=
this
.
examHtml
();
}
examHtml
(){
var
exam
=
this
.
exam
();
exam
=
exam
.
replace
(
/
\\
/g
,
"<br/>"
);
return
exam
;
}
exam
(){
throw
new
Error
(
"请在子类中定义类操作示例"
);
}
classDesc
(){
throw
new
Error
(
`
请重写classDesc对当前的类进行描述,返回如下数据结构
{
groupName:"auth",
groupDesc:"认证相关的包"
desc:"关于认证的类",
exam:"",
}
`
);
}
descMethods
(){
var
methoddescs
=
this
.
methodDescs
();
for
(
var
methoddesc
of
methoddescs
){
for
(
var
paramdesc
of
methoddesc
.
paramdescs
){
this
.
descMethod
(
methoddesc
.
methodDesc
,
methoddesc
.
methodName
,
paramdesc
.
paramDesc
,
paramdesc
.
paramName
,
paramdesc
.
paramType
,
paramdesc
.
defaultValue
,
methoddesc
.
rtnTypeDesc
,
methoddesc
.
rtnType
);
}
}
}
methodDescs
(){
throw
new
Error
(
`
请重写methodDescs对当前的类的所有方法进行描述,返回如下数据结构
[
{
methodDesc:"生成访问token",
methodName:"getAccessKey",
paramdescs:[
{
paramDesc:"访问appkey",
paramName:"appkey",
paramType:"string",
defaultValue:"x",
},
{
paramDesc:"访问secret",
paramName:"secret",
paramType:"string",
defaultValue:null,
}
],
rtnTypeDesc:"xxxx",
rtnType:"xxx"
}
]
`
);
}
descMethod
(
methodDesc
,
methodName
,
paramDesc
,
paramName
,
paramType
,
defaultValue
,
rtnTypeDesc
,
rtnType
){
var
mobj
=
this
.
apiDoc
.
methods
.
filter
((
m
)
=>
{
if
(
m
.
name
==
methodName
){
return
true
;
}
else
{
return
false
;
}
})[
0
];
var
param
=
{
pname
:
paramName
,
ptype
:
paramType
,
pdesc
:
paramDesc
,
pdefaultValue
:
defaultValue
,
};
if
(
mobj
!=
null
){
mobj
.
params
.
push
(
param
);
}
else
{
this
.
apiDoc
.
methods
.
push
(
{
methodDesc
:
methodDesc
?
methodDesc
:
""
,
name
:
methodName
,
params
:[
param
],
rtnTypeDesc
:
rtnTypeDesc
,
rtnType
:
rtnType
}
);
}
}
}
module
.
exports
=
DocBase
;
\ No newline at end of file
igirl-channel-gateway/app/base/api/impl/action/pushBusiness.js
deleted
100644 → 0
View file @
61220171
var
APIBase
=
require
(
"../../api.base"
);
var
system
=
require
(
"../../../system"
);
class
PushBusinessAPI
extends
APIBase
{
constructor
()
{
super
();
this
.
toolSve
=
system
.
getObject
(
"service.trademark.toolSve"
);
this
.
toolApi
=
system
.
getObject
(
"api.tool.toolApi"
);
this
.
appSourceList
=
{
"tm_ali"
:
"阿里云应用"
,
"ic_ali"
:
"阿里云应用"
,
"icp_ali"
:
"阿里云应用"
,
"tm_jdyun"
:
"京东云应用"
,
"ic_jdyun"
:
"京东云应用"
,
"icp_jdyun"
:
"京东云应用"
,
"tm_1688"
:
"1688应用"
,
"ic_1688"
:
"1688应用"
,
"icp_1688"
:
"1688应用"
,
};
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async
springBoard
(
pobj
,
qobj
,
req
)
{
var
self
=
this
;
if
(
!
req
.
app
)
{
return
system
.
getResult
(
null
,
"app is not empty"
);
}
if
(
!
pobj
.
actionProcess
)
{
return
system
.
getResult
(
null
,
"actionProcess参数不能为空"
);
}
if
(
!
pobj
.
actionType
)
{
return
system
.
getResult
(
null
,
"actionType参数不能为空"
);
}
var
result
=
null
;
switch
(
pobj
.
actionProcess
)
{
case
"tm_1688"
:
opResult
=
await
self
.
opActionProcess
(
pobj
.
actionProcess
);
break
;
case
"ic_1688"
:
opResult
=
await
this
.
toolSve
.
getNclByLikeNameAndNcl
(
action_body
);
break
;
case
"icp_1688"
:
opResult
=
await
this
.
toolSve
.
word2pic
(
action_body
);
break
;
case
"tm_ali"
:
opResult
=
await
this
.
toolSve
.
getNcl
(
action_body
);
break
;
case
"ic_ali"
:
opResult
=
await
this
.
toolSve
.
getNclByLikeNameAndNcl
(
action_body
);
break
;
case
"icp_ali"
:
opResult
=
await
this
.
toolSve
.
word2pic
(
action_body
);
break
;
default
:
result
=
system
.
getResult
(
null
,
"actionProcess参数错误"
);
break
;
}
return
result
;
}
async
opActionProcess
(
pushBusinessSource
,
action_type
,
action_body
)
{
if
(
!
pobj
.
actionBody
.
idempotentId
)
{
return
system
.
getResult
(
null
,
"idempotentId is not empty"
);
}
//接入方业务产品 ID
if
(
!
pobj
.
actionBody
.
idempotentSource
)
{
return
system
.
getResult
(
null
,
"idempotentSource is not empty"
);
}
//业务来源(ali、jdyun、1688)
if
(
!
pobj
.
actionBody
.
idempotentSourceName
)
{
return
system
.
getResult
(
null
,
"idempotentSourceName is not empty"
);
}
//业务来源名称 京东云应用、阿里云应用、1688应用
if
(
!
pobj
.
actionBody
.
phone
)
{
return
system
.
getResult
(
null
,
"phone is not empty"
);
}
//手机号
if
(
!
pobj
.
actionBody
.
orderPrice
)
{
return
system
.
getResult
(
null
,
"orderPrice is not empty"
);
}
//订单金额 double
if
(
!
pobj
.
actionBody
.
productId
)
{
return
system
.
getResult
(
null
,
"productId is not empty"
);
}
//订单金额 string
if
(
!
pobj
.
actionBody
.
productQuantity
)
{
return
system
.
getResult
(
null
,
"productQuantity is not empty"
);
}
//产品数量 int
// city、companyName
var
opResult
=
null
;
switch
(
action_type
)
{
case
"fqdev"
:
//dev
result
=
await
this
.
opActionProcess
(
pushBusinessSource
,
reqEnv
,
action_body
);
break
;
case
"fqProd"
:
//prod
result
=
await
this
.
opActionProcess
(
pobj
.
actionProcess
,
pobj
.
actionType
,
pobj
.
actionBody
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
}
return
opResult
;
}
}
module
.
exports
=
PushBusinessAPI
;
\ No newline at end of file
igirl-channel-gateway/app/base/api/impl/action/tmOrder.js
deleted
100644 → 0
View file @
61220171
var
APIBase
=
require
(
"../../api.base"
);
var
system
=
require
(
"../../../system"
);
class
TmOrderAPI
extends
APIBase
{
constructor
()
{
super
();
this
.
opPlatformUtils
=
system
.
getObject
(
"util.businessManager.opPlatformUtils"
);
// this.ordertmproductSve = system.getObject("service.dborder.ordertmproductSve");
// this.customerinfoSve = system.getObject("service.dborder.customerinfoSve");
// this.customercontactsSve = system.getObject("service.dborder.customercontactsSve");
// this.trademarkSve = system.getObject("service.dbtrademark.trademarkSve");
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async
springBoard
(
pobj
,
qobj
,
req
)
{
if
(
!
pobj
.
actionProcess
)
{
return
system
.
getResult
(
null
,
"actionProcess参数不能为空"
);
}
if
(
!
pobj
.
actionType
)
{
return
system
.
getResult
(
null
,
"actionType参数不能为空"
);
}
var
result
=
null
;
switch
(
pobj
.
actionProcess
)
{
case
"jd"
:
//京东
result
=
await
this
.
jdOpActionProcess
(
pobj
.
actionProcess
,
pobj
.
actionType
,
pobj
.
actionBody
);
break
;
default
:
result
=
system
.
getResult
(
null
,
"actionProcess参数错误"
);
break
;
}
return
result
;
}
async
jdOpActionProcess
(
action_process
,
action_type
,
action_body
)
{
action_body
.
app
=
{
id
:
1
,
appPayType
:
"00"
,
appDataOpType
:
"00"
};
action_body
.
user
=
{
id
:
1
,
app_id
:
1
,
nickname
:
"测试用户"
};
var
opResult
=
null
;
switch
(
action_type
)
{
// sy
case
"test"
:
//测试
opResult
=
system
.
getResultSuccess
(
null
,
"测试成功"
);
break
;
// case "addOrder"://商标提报
// opResult = await this.ordertmproductSve.addTmOrder(action_body);
// break;
// case "getTmOrderList"://商标交付列表
// opResult = await this.ordertmproductSve.getTmOrderList(action_body);
// break;
// case "getTmOrderInfo"://商标交付信息
// opResult = await this.ordertmproductSve.getTmOrder(action_body);
// break;
// case "getTmApplyInfo"://商标订单-申请信息
// opResult = await this.ordertmproductSve.getTmApply(action_body);
// break;
// case "getTmNclList"://商标订单-商标尼斯信息
// opResult = await this.ordertmproductSve.getTmNclList(action_body);
// break;
// case "updateTmInfo"://修改商标订单-商标信息修改
// opResult = await this.trademarkSve.updateTmInfo(action_body);
// break;
// case "updateNclInfo"://修改商标订单-商标尼斯信息修改
// opResult = await this.trademarkSve.updateNclInfo(action_body);
// break;
// case "updateContacts"://修改商标订单-修改商标交付单联系人
// opResult = await this.customercontactsSve.updateContacts(action_body);
// break;
// case "updateCustomerInfo"://修改商标订单-修改申请人信息
// opResult = await this.customerinfoSve.updateCustomerInfo(action_body);
// break;
// case "updateOfficial"://修改商标订单-修改交官文件
// opResult = await this.customerinfoSve.updateOfficial(action_body);
// break;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
}
return
opResult
;
}
}
module
.
exports
=
TmOrderAPI
;
\ No newline at end of file
igirl-channel-gateway/app/base/api/impl/action/tradetransfer.js
View file @
e242a828
...
@@ -8,7 +8,7 @@ class TradetransferAPI extends APIBase {
...
@@ -8,7 +8,7 @@ class TradetransferAPI extends APIBase {
this
.
execlient
=
system
.
getObject
(
"util.execClient"
);
this
.
execlient
=
system
.
getObject
(
"util.execClient"
);
this
.
channelApiUrl
=
settings
.
channelApiUrl
();
this
.
channelApiUrl
=
settings
.
channelApiUrl
();
this
.
appInfo
=
{
this
.
appInfo
=
{
aliyuntmtransfer
:
{
appkey
:
"201912031344"
,
secret
:
"7cbb846246874167b5c7e01cd0016c88"
}
aliyuntmtransfer
:
{
appkey
:
settings
.
appKey
,
secret
:
settings
.
secret
}
};
};
}
}
...
...
igirl-channel-gateway/app/base/api/impl/auth/accessAuth.js
deleted
100644 → 0
View file @
61220171
var
APIBase
=
require
(
"../../api.base"
);
var
system
=
require
(
"../../../system"
);
class
AccessAuthAPI
extends
APIBase
{
constructor
()
{
super
();
this
.
opPlatformUtils
=
system
.
getObject
(
"util.businessManager.opPlatformUtils"
);
}
async
getToken
(
pobj
,
qobj
,
req
)
{
var
appkey
=
pobj
.
appkey
;
var
secret
=
pobj
.
secret
;
if
(
!
appkey
)
{
return
system
.
getResult
(
null
,
"appkey参数不能为空"
);
}
if
(
!
secret
)
{
return
system
.
getResult
(
null
,
"secret参数不能为空"
);
}
var
result
=
await
this
.
opPlatformUtils
.
getReqApiAccessKey
(
appkey
,
secret
);
if
(
result
&&
result
.
status
&&
result
.
status
!=
0
)
{
return
result
;
}
var
resultData
=
{
token
:
result
&&
result
.
data
?
result
.
data
.
accessKey
:
""
};
return
system
.
getResultSuccess
(
resultData
);
}
async
getPlatformAppItem
(
pobj
,
qobj
,
req
)
{
return
req
.
uApp
;
}
async
getLongAppItem
(
pobj
,
qobj
,
req
)
{
return
req
.
app
;
}
async
getUserItem
(
pobj
,
qobj
,
req
)
{
return
req
.
user
;
}
/**
* 开放平台回调处理
* @param {*} req
*/
async
authByCode
(
pobj
,
qobj
,
req
)
{
return
await
this
.
opPlatformUtils
.
authByCode
(
qobj
.
code
);
}
}
module
.
exports
=
AccessAuthAPI
;
\ No newline at end of file
igirl-channel-gateway/app/base/api/impl/test/testApi.js
View file @
e242a828
...
@@ -9,35 +9,5 @@ class TestAPI extends APIBase {
...
@@ -9,35 +9,5 @@ class TestAPI extends APIBase {
// var tmp = await this.orderSve.createLicense(pobj.action_body);
// var tmp = await this.orderSve.createLicense(pobj.action_body);
return
system
.
getResultSuccess
({
req
:
"ok"
});
return
system
.
getResultSuccess
({
req
:
"ok"
});
}
}
exam
()
{
return
""
;
}
classDesc
()
{
return
{
groupName
:
""
,
groupDesc
:
""
,
name
:
""
,
desc
:
""
,
exam
:
""
,
};
}
methodDescs
()
{
return
[
{
methodDesc
:
""
,
methodName
:
""
,
paramdescs
:
[
{
paramDesc
:
""
,
paramName
:
""
,
paramType
:
""
,
defaultValue
:
""
,
}
],
rtnTypeDesc
:
""
,
rtnType
:
""
}
];
}
}
}
module
.
exports
=
TestAPI
;
module
.
exports
=
TestAPI
;
\ No newline at end of file
igirl-channel-gateway/app/base/controller/ctl.base.js
View file @
e242a828
...
@@ -59,6 +59,18 @@ class CtlBase {
...
@@ -59,6 +59,18 @@ class CtlBase {
var
rd
=
await
this
.
service
.
create
(
qobj
);
var
rd
=
await
this
.
service
.
create
(
qobj
);
return
system
.
getResult
(
rd
,
null
);
return
system
.
getResult
(
rd
,
null
);
}
}
async
createLog
(
queryobj
,
qobj
,
req
)
{
if
(
req
&&
req
.
session
&&
req
.
session
.
app
)
{
qobj
.
app_id
=
req
.
session
.
app
.
id
;
qobj
.
onlyCode
=
req
.
session
.
user
.
unionId
;
if
(
req
.
codepath
)
{
qobj
.
codepath
=
req
.
codepath
;
}
}
var
tmpParam
=
qobj
||
queryobj
;
var
rd
=
await
this
.
service
.
create
(
tmpParam
);
return
system
.
getResult
(
rd
,
null
);
}
async
update
(
queryobj
,
qobj
,
req
)
{
async
update
(
queryobj
,
qobj
,
req
)
{
if
(
req
&&
req
.
session
&&
req
.
session
.
user
)
{
if
(
req
&&
req
.
session
&&
req
.
session
.
user
)
{
qobj
.
onlyCode
=
req
.
session
.
user
.
unionId
;
qobj
.
onlyCode
=
req
.
session
.
user
.
unionId
;
...
...
igirl-channel-gateway/app/base/controller/impl/auth/userCtl.js
deleted
100644 → 0
View file @
61220171
var
system
=
require
(
"../../../system"
)
const
http
=
require
(
"http"
)
const
querystring
=
require
(
'querystring'
);
var
settings
=
require
(
"../../../../config/settings"
);
const
CtlBase
=
require
(
"../../ctl.base"
);
const
logCtl
=
system
.
getObject
(
"web.common.oplogCtl"
);
var
cacheBaseComp
=
null
;
class
UserCtl
extends
CtlBase
{
constructor
()
{
super
(
"auth"
,
CtlBase
.
getServiceName
(
UserCtl
));
}
/**
* 开放平台回调处理
* @param {*} req
*/
async
authByCode
(
req
)
{
var
opencode
=
req
.
query
.
code
;
var
user
=
await
this
.
service
.
authByCode
(
opencode
);
if
(
user
)
{
req
.
session
.
user
=
user
;
}
else
{
req
.
session
.
user
=
null
;
}
//缓存opencode,方便本应用跳转到其它应用
// /auth?code=xxxxx,缓存没有意义,如果需要跳转到其它应用,需要调用
//平台开放的登录方法,返回 <待跳转的目标地址>/auth?code=xxxxx
//this.cacheManager["OpenCodeCache"].cacheOpenCode(user.id,opencode);
return
user
;
}
async
navSysSetting
(
pobj
,
qobj
,
req
)
{
//开始远程登录,返回code
var
jumpobj
=
await
this
.
service
.
navSysSetting
(
req
.
session
.
user
);
if
(
jumpobj
)
{
return
system
.
getResultSuccess
(
jumpobj
);
}
return
system
.
getResultFail
();
}
async
loginUser
(
qobj
,
pobj
,
req
)
{
return
super
.
findById
(
req
.
session
.
user
.
id
);
}
async
initNewInstance
(
queryobj
,
req
)
{
var
rtn
=
{};
rtn
.
roles
=
[];
if
(
rtn
)
{
return
system
.
getResultSuccess
(
rtn
);
}
return
system
.
getResultFail
();
}
async
checkLogin
(
gobj
,
qobj
,
req
)
{
//当前如果缓存中存在user,还是要检查当前user所在的域名,如果不和来访一致,则退出重新登录
if
(
req
.
session
.
user
)
{
var
x
=
null
;
if
(
req
.
session
.
user
.
Roles
)
{
x
=
req
.
session
.
user
.
Roles
.
map
(
r
=>
{
return
r
.
code
});
}
var
tmp
=
{
id
:
req
.
session
.
user
.
id
,
userName
:
req
.
session
.
user
.
userName
,
nickName
:
req
.
session
.
user
.
nickName
,
mobile
:
req
.
session
.
user
.
mobile
,
isAdmin
:
req
.
session
.
user
.
isAdmin
,
created_at
:
req
.
session
.
user
.
created_at
,
email
:
req
.
session
.
user
.
email
,
headUrl
:
req
.
session
.
user
.
headUrl
,
roles
:
x
?
x
.
join
(
","
)
:
""
}
return
system
.
getResult
(
tmp
,
"用户登录"
,
req
);
}
else
{
req
.
session
.
user
=
null
;
//req.session.destroy();
return
system
.
getResult
(
null
,
"用户未登录"
,
req
);
}
}
async
exit
(
pobj
,
qobj
,
req
)
{
req
.
session
.
user
=
null
;
req
.
session
.
destroy
();
return
system
.
getResultSuccess
({
"env"
:
settings
.
env
});
}
}
module
.
exports
=
UserCtl
;
igirl-channel-gateway/app/base/controller/impl/common/oplogCtl.js
View file @
e242a828
...
@@ -17,23 +17,23 @@ class OplogCtl extends CtlBase {
...
@@ -17,23 +17,23 @@ class OplogCtl extends CtlBase {
}
}
async
debug
(
obj
)
{
async
debug
(
obj
)
{
obj
.
logLevel
=
"debug"
;
obj
.
logLevel
=
"debug"
;
return
this
.
create
(
obj
);
return
this
.
create
Log
(
obj
);
}
}
async
info
(
obj
)
{
async
info
(
obj
)
{
obj
.
logLevel
=
"info"
;
obj
.
logLevel
=
"info"
;
return
this
.
create
(
obj
);
return
this
.
create
Log
(
obj
);
}
}
async
warn
(
obj
)
{
async
warn
(
obj
)
{
obj
.
logLevel
=
"warn"
;
obj
.
logLevel
=
"warn"
;
return
this
.
create
(
obj
);
return
this
.
create
Log
(
obj
);
}
}
async
error
(
obj
)
{
async
error
(
obj
)
{
obj
.
logLevel
=
"error"
;
obj
.
logLevel
=
"error"
;
return
this
.
create
(
obj
);
return
this
.
create
Log
(
obj
);
}
}
async
fatal
(
obj
)
{
async
fatal
(
obj
)
{
obj
.
logLevel
=
"fatal"
;
obj
.
logLevel
=
"fatal"
;
return
this
.
create
(
obj
);
return
this
.
create
Log
(
obj
);
}
}
/*
/*
...
...
igirl-channel-gateway/app/base/db/cache/apiAccessKeyCache.js
deleted
100644 → 0
View file @
61220171
const
CacheBase
=
require
(
"../cache.base"
);
const
system
=
require
(
"../../system"
);
const
settings
=
require
(
"../../../config/settings"
);
class
ApiAccessKeyCache
extends
CacheBase
{
constructor
()
{
super
();
this
.
restS
=
system
.
getObject
(
"util.restClient"
);
}
desc
()
{
return
"应用中缓存访问token"
;
}
prefix
()
{
return
settings
.
cacheprefix
+
"_accesskey:"
;
}
async
buildCacheVal
(
cachekey
,
inputkey
,
val
,
ex
,
...
items
)
{
var
appkey
=
inputkey
||
settings
.
appKey
;
var
secret
=
items
&&
items
.
length
>
0
?
items
[
0
]
:
settings
.
secret
;
var
acckapp
=
await
this
.
restS
.
execPost
({
appkey
:
appkey
,
secret
:
secret
},
settings
.
paasUrl
()
+
"api/auth/accessAuth/getAccessKey"
);
var
s
=
acckapp
.
stdout
;
console
.
log
(
acckapp
.
stdout
,
"ApiAccessKeyCache............. acckapp.stdout.........."
)
console
.
log
(
"------------------------------------------cuowu--------------------------------------"
)
if
(
s
)
{
var
tmp
=
JSON
.
parse
(
s
);
return
tmp
;
// if (tmp.status == 0) {
// return JSON.stringify(tmp.data);
// }
}
return
system
.
getResult
(
null
,
"返回数据为空!"
);
}
}
module
.
exports
=
ApiAccessKeyCache
;
igirl-channel-gateway/app/base/db/cache/apiAccessKeyCheckCache.js
deleted
100644 → 0
View file @
61220171
const
CacheBase
=
require
(
"../cache.base"
);
const
system
=
require
(
"../../system"
);
const
settings
=
require
(
"../../../config/settings"
);
//缓存首次登录的赠送的宝币数量
class
ApiAccessKeyCheckCache
extends
CacheBase
{
constructor
()
{
super
();
this
.
restS
=
system
.
getObject
(
"util.restClient"
);
}
desc
()
{
return
"应用中来访访问token缓存"
;
}
prefix
()
{
return
settings
.
cacheprefix
+
"_verify_reqaccesskey:"
;
}
async
buildCacheVal
(
cachekey
,
inputkey
,
val
,
ex
,
...
items
)
{
var
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
//当来访key缓存不存在时,需要去开放平台检查是否存在来访key缓存
var
acckapp
=
await
cacheManager
[
"ApiAccessKeyCache"
].
cache
(
settings
.
appKey
,
null
,
ex
);
//先获取本应用accessKey
if
(
acckapp
.
status
!=
0
)
{
return
system
.
getResult
(
null
,
"获取本应用accessKey错误"
);
}
var
checkresult
=
await
this
.
restS
.
execPostWithAK
({
checkAccessKey
:
inputkey
},
settings
.
paasUrl
()
+
"api/auth/accessAuth/authAccessKey"
,
acckapp
.
data
.
accessKey
);
if
(
checkresult
.
status
==
0
)
{
return
checkresult
;
// var s = checkresult.data;
// return JSON.stringify(s);
}
else
{
await
cacheManager
[
"ApiAccessKeyCache"
].
invalidate
(
settings
.
appKey
);
var
acckapp
=
await
cacheManager
[
"ApiAccessKeyCache"
].
cache
(
settings
.
appKey
,
null
,
ex
);
//先获取本应用accessKey
var
checkresult
=
await
this
.
restS
.
execPostWithAK
({
checkAccessKey
:
inputkey
},
settings
.
paasUrl
()
+
"api/auth/accessAuth/authAccessKey"
,
acckapp
.
data
.
accessKey
);
return
checkresult
;
// var s = checkresult.data;
// return JSON.stringify(s);
}
}
}
module
.
exports
=
ApiAccessKeyCheckCache
;
igirl-channel-gateway/app/base/db/cache/apiAppIdCheckCache.js
deleted
100644 → 0
View file @
61220171
const
CacheBase
=
require
(
"../cache.base"
);
const
system
=
require
(
"../../system"
);
const
settings
=
require
(
"../../../config/settings"
);
class
ApiAppKeyCheckCache
extends
CacheBase
{
constructor
()
{
super
();
// this.appDao = system.getObject("db.dbapp.appDao");
}
desc
()
{
return
"应用中来访访问appid缓存"
;
}
prefix
()
{
return
settings
.
cacheprefix
+
"_verify_appKey:"
;
}
async
buildCacheVal
(
cachekey
,
inputkey
,
val
,
ex
,
...
items
)
{
// var item = await this.appDao.getItemByAppKey(inputkey);
// if (!item) {
// return system.getResult(null, "返回数据为空!");
// }
// if (item.status != 1) {
// return system.getResultFail(system.waitAuditSelfApp, "渠道应用处于待审核等待启用状态");
// }
// return system.getResultSuccess(item);
}
}
module
.
exports
=
ApiAppKeyCheckCache
;
igirl-channel-gateway/app/base/db/cache/apiUserCache.js
deleted
100644 → 0
View file @
61220171
const
CacheBase
=
require
(
"../cache.base"
);
const
system
=
require
(
"../../system"
);
const
settings
=
require
(
"../../../config/settings"
);
//缓存首次登录的赠送的宝币数量
class
ApiUserCache
extends
CacheBase
{
constructor
()
{
super
();
this
.
opPlatformUtils
=
system
.
getObject
(
"util.businessManager.opPlatformUtils"
);
// this.appDao = system.getObject("db.dbapp.appDao");
// this.appuserDao = system.getObject("db.dbapp.appuserDao");
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
}
desc
()
{
return
"应用中来访访问token缓存"
;
}
prefix
()
{
return
settings
.
cacheprefix
+
"_userdata:"
;
}
async
buildCacheVal
(
cachekey
,
inputkey
,
val
,
ex
,
...
items
)
{
// var actionBody = items[0];
// var selfAppInfo = items[1];
// var channelUserId = val || "";
// var uUserName = channelUserId + "$" + selfAppInfo.data.uappKey;//uUserName
// var createUserPwd = inputkey;//(格式:selfAppInfo.data.uappKey+”_“+channelUserId)
// var userInfo = await this.appuserDao.getItemByUUserId(uUserName, selfAppInfo.data.id);
// if (userInfo) {
// var loginNum = Number(userInfo.loginNum || 0) + 1;
// this.appuserDao.updateByWhere({ lastLoginTime: new Date(), loginNum: loginNum }, { where: { id: userInfo.id } });
// return system.getResultSuccess(userInfo);
// }
// var uUserInfo = await this.opPlatformUtils.createUserInfo(uUserName, actionBody.channelUserMoblie || "15088888888",
// createUserPwd, selfAppInfo.data.uappKey, selfAppInfo.data.appSecret);
// if (uUserInfo.status != 2000 && uUserInfo.status != 0) {
// return uUserInfo;
// }//已经存在此用户 或 注册失败
// if (uUserInfo.status == 0) {
// var params = {
// app_id: selfAppInfo.data.id,
// channelUserId: channelUserId,
// channelUserName: actionBody.channelUserName || channelUserId,
// userMoblie: actionBody.channelUserMoblie || "15088888888",
// nickname: actionBody.nickname || "",
// orgName: actionBody.orgName || "",
// orgPath: actionBody.orgPath || "",
// uUserName: uUserName,
// uAppId: selfAppInfo.uAppId,
// isEnabled: 1,
// lastLoginTime: new Date()
// };
// userInfo = await this.appuserDao.create(params);
// }
// else {
// return uUserInfo;
// }
// return system.getResultSuccess(userInfo);
return
system
.
getResultSuccess
(
null
);
}
}
module
.
exports
=
ApiUserCache
;
igirl-channel-gateway/app/base/db/impl/common/apiDocManager.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../../system"
);
const
fs
=
require
(
"fs"
);
const
settings
=
require
(
"../../../../config/settings"
);
var
glob
=
require
(
"glob"
);
class
APIDocManager
{
constructor
(){
this
.
doc
=
{};
this
.
buildAPIDocMap
();
}
async
buildAPIDocMap
(){
var
self
=
this
;
//订阅任务频道
var
apiPath
=
settings
.
basepath
+
"/app/base/api/impl"
;
var
rs
=
glob
.
sync
(
apiPath
+
"/**/*.js"
);
if
(
rs
){
for
(
let
r
of
rs
){
// var ps=r.split("/");
// var nl=ps.length;
// var pkname=ps[nl-2];
// var fname=ps[nl-1].split(".")[0];
// var obj=system.getObject("api."+pkname+"."+fname);
var
ClassObj
=
require
(
r
);
var
obj
=
new
ClassObj
();
var
gk
=
obj
.
apiDoc
.
group
+
"|"
+
obj
.
apiDoc
.
groupDesc
if
(
!
this
.
doc
[
gk
]){
this
.
doc
[
gk
]
=
[];
this
.
doc
[
gk
].
push
(
obj
.
apiDoc
);
}
else
{
this
.
doc
[
gk
].
push
(
obj
.
apiDoc
);
}
}
}
}
}
module
.
exports
=
APIDocManager
;
igirl-channel-gateway/app/base/db/impl/dbdelivery/customercontactsDao.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
CustomerContactsDao
extends
Dao
{
constructor
()
{
super
(
Dao
.
getModelName
(
CustomerContactsDao
));
}
async
findOneByMobile
(
mobile
,
customerinfoId
)
{
return
this
.
model
.
findOne
({
where
:
{
mobile
:
mobile
,
customerinfo_id
:
customerinfoId
},
attributes
:
[
"id"
,
"deliveryOrderNo"
,
"mobile"
,
"email"
,
"tel"
,
"fax"
,
"name"
,
"code"
,
"app_id"
],
raw
:
true
});
}
async
findOneByCustomerinfoId
(
customerinfoId
)
{
return
this
.
model
.
findOne
({
where
:
{
customerinfo_id
:
customerinfoId
},
attributes
:
[
"id"
,
"deliveryOrderNo"
,
"mobile"
,
"email"
,
"tel"
,
"fax"
,
"name"
,
"code"
,
"app_id"
],
raw
:
true
});
}
}
module
.
exports
=
CustomerContactsDao
;
igirl-channel-gateway/app/base/db/impl/dbdelivery/customerinfoDao.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
CustomerInfoDao
extends
Dao
{
constructor
()
{
super
(
Dao
.
getModelName
(
CustomerInfoDao
));
}
async
findOneByCodeAndUserId
(
code
,
userId
)
{
return
this
.
model
.
findOne
({
where
:
{
code
:
code
,
createuser_id
:
userId
},
attributes
:
[
"id"
,
"customerType"
,
// ent:企业,person:个人
"customerTypeName"
,
"identityCardPic"
,
//身份证图片
"businessLicensePic"
,
//营业执照图片
"name"
,
//公司名称或个人名称
"code"
,
//公司统一社会代码
"app_id"
,
"deliveryOrderNo"
,
"applyAddr"
,
//申请地址
"applyArea"
,
//存储省市编码
"province"
,
//省
"city"
,
//市
"identityCardNo"
,
//身份证号
"notes"
,
//备注
"zipCode"
,
"identityCardPdf"
,
"businessLicensePdf"
,
"createuser_id"
,
"updateuser_id"
,
"owner_id"
],
raw
:
true
});
}
async
findOneByDeliveryOrderNo
(
deliveryOrderNo
)
{
return
this
.
model
.
findOne
({
where
:
{
deliveryOrderNo
:
deliveryOrderNo
},
attributes
:
[
"id"
,
"customerType"
,
// ent:企业,person:个人
"customerTypeName"
,
"identityCardPic"
,
//身份证图片
"businessLicensePic"
,
//营业执照图片
"name"
,
//公司名称或个人名称
"code"
,
//公司统一社会代码
"app_id"
,
"deliveryOrderNo"
,
"applyAddr"
,
//申请地址
"applyArea"
,
//存储省市编码
"province"
,
//省
"city"
,
//市
"identityCardNo"
,
//身份证号
"notes"
,
//备注
"zipCode"
,
"identityCardPdf"
,
"businessLicensePdf"
,
"createuser_id"
,
"updateuser_id"
,
"owner_id"
],
raw
:
true
});
}
}
module
.
exports
=
CustomerInfoDao
;
igirl-channel-gateway/app/base/db/impl/dbdelivery/deliveryproductDao.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
DeliveryProductDao
extends
Dao
{
constructor
()
{
super
(
Dao
.
getModelName
(
DeliveryProductDao
));
}
}
module
.
exports
=
DeliveryProductDao
;
igirl-channel-gateway/app/base/db/impl/dbdelivery/flowlogDao.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
FlowLogDao
extends
Dao
{
constructor
()
{
super
(
Dao
.
getModelName
(
FlowLogDao
));
}
async
getListBySourceOrderNo
(
sourceOrderNo
)
{
return
this
.
model
.
findAll
({
where
:
{
sourceOrderNo
:
sourceOrderNo
,
isShow
:
1
},
raw
:
true
});
}
}
module
.
exports
=
FlowLogDao
;
igirl-channel-gateway/app/base/db/impl/dbdelivery/officialinfoDao.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
OfficialInfoDao
extends
Dao
{
constructor
()
{
super
(
Dao
.
getModelName
(
OfficialInfoDao
));
}
async
getListByTmRegistNum
(
tmRegistNum
)
{
return
this
.
model
.
findAll
({
where
:
{
tmRegistNum
:
tmRegistNum
},
raw
:
true
});
}
}
module
.
exports
=
OfficialInfoDao
;
igirl-channel-gateway/app/base/db/impl/dbtrademark/tmdeliveryDao.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
TmDeliveryDao
extends
Dao
{
constructor
()
{
super
(
Dao
.
getModelName
(
TmDeliveryDao
));
}
async
getListByTmRegistNum
(
tmRegistNum
)
{
return
this
.
model
.
findAll
({
where
:
{
tmRegistNum
:
tmRegistNum
},
raw
:
true
});
}
}
module
.
exports
=
TmDeliveryDao
;
igirl-channel-gateway/app/base/db/impl/dbtrademark/trademarkDao.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
TradeMarkDao
extends
Dao
{
constructor
()
{
super
(
Dao
.
getModelName
(
TradeMarkDao
));
}
async
getListByDeliveryOrderNo
(
deliveryOrderNo
)
{
return
this
.
model
.
findAll
({
where
:
{
deliveryOrderNo
:
deliveryOrderNo
},
raw
:
true
});
}
}
module
.
exports
=
TradeMarkDao
;
igirl-channel-gateway/app/base/db/metadata/apps/platform.js
View file @
e242a828
module
.
exports
=
{
module
.
exports
=
{
"appid"
:
"20191
1051030
"
,
"appid"
:
"20191
2031344
"
,
"label"
:
"知产api应用"
,
"label"
:
"知产api应用"
,
"config"
:
{
"config"
:
{
"rstree"
:
{
"rstree"
:
{
...
...
igirl-channel-gateway/app/base/db/models/dbdelivery/customercontacts.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"customercontacts"
,
{
uapp_id
:
DataTypes
.
INTEGER
,
//
deliveryOrderNo
:
DataTypes
.
STRING
(
64
),
// 交付订单号
contactName
:
DataTypes
.
STRING
(
1000
),
// 联系人
mobile
:
DataTypes
.
STRING
(
20
),
//
email
:
DataTypes
.
STRING
(
50
),
//
tel
:
DataTypes
.
STRING
(
20
),
//
fax
:
DataTypes
.
STRING
(
50
),
//
},
{
paranoid
:
false
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
timestamps
:
true
,
updatedAt
:
false
,
//freezeTableName: true,
// define the table's name
tableName
:
'd_customercontacts'
,
validate
:
{
},
indexes
:
[
]
});
}
igirl-channel-gateway/app/base/db/models/dbdelivery/customerinfo.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"customerinfo"
,
{
uapp_id
:
DataTypes
.
INTEGER
,
//
deliveryOrderNo
:
DataTypes
.
STRING
(
64
),
// 交付订单号
customerTypeName
:
DataTypes
.
STRING
(
50
),
//
customerType
:
{
type
:
DataTypes
.
ENUM
,
values
:
Object
.
keys
(
uiconfig
.
config
.
pdict
.
customer_type
),
set
:
function
(
val
)
{
this
.
setDataValue
(
"customerType"
,
val
);
this
.
setDataValue
(
"customerTypeName"
,
uiconfig
.
config
.
pdict
.
customer_type
[
val
]);
},
defaultValue
:
"0"
,
},
//申请企业类型: ent:企业,person:个人
identityCardPic
:
DataTypes
.
STRING
(
500
),
// 身份证图片
identityCardPdf
:
DataTypes
.
STRING
(
500
),
// 身份证pdf
businessLicensePic
:
DataTypes
.
STRING
(
500
),
// 营业执照图片
businessLicensePdf
:
DataTypes
.
STRING
(
500
),
// 营业执照pdf
applyname
:
DataTypes
.
STRING
(
1000
),
// 公司名称或个人名称
applycode
:
DataTypes
.
STRING
(
100
),
// 公司统一社会代码
identityCardNo
:
DataTypes
.
STRING
(
50
),
// 身份证号
applyAddr
:
DataTypes
.
STRING
,
// 申请地址
applyArea
:
DataTypes
.
STRING
(
50
),
// 存储省市编码
province
:
DataTypes
.
STRING
(
50
),
// 省
city
:
DataTypes
.
STRING
(
50
),
// 市
notes
:
DataTypes
.
STRING
,
// 备注
createuser_id
:
DataTypes
.
INTEGER
,
//
updateuser_id
:
DataTypes
.
INTEGER
,
//
zipCode
:
DataTypes
.
STRING
(
20
),
//
},
{
paranoid
:
false
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
timestamps
:
true
,
updatedAt
:
false
,
//freezeTableName: true,
// define the table's name
tableName
:
'd_customerinfo'
,
validate
:
{
},
indexes
:
[
]
});
}
igirl-channel-gateway/app/base/db/models/dbdelivery/deliveryproduct.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"deliveryproduct"
,
{
uapp_id
:
DataTypes
.
INTEGER
,
//
deliveryOrderNo
:
DataTypes
.
STRING
(
64
),
//交付订单号
needNo
:
DataTypes
.
STRING
(
64
),
//需求单号(渠道过来的订单号,如阿里、1688过来的单号)
itemCode
:
DataTypes
.
STRING
(
64
),
//
itemName
:
DataTypes
.
STRING
(
100
),
//
channelItemCode
:
DataTypes
.
STRING
(
64
),
// 渠道产品编码
channelItemName
:
DataTypes
.
STRING
,
// 渠道产品名称
proPrice
:
DataTypes
.
DOUBLE
,
// 产品价格
picUrl
:
DataTypes
.
STRING
(
500
),
// 产品图片地址
productType_id
:
DataTypes
.
INTEGER
,
//产品类型Id
productOneType_id
:
DataTypes
.
INTEGER
,
//产品大类Id
serviceItemSnapshot
:
DataTypes
.
TEXT
,
//产品快照
createuser_id
:
DataTypes
.
INTEGER
,
//
},
{
paranoid
:
false
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
timestamps
:
true
,
updatedAt
:
false
,
//freezeTableName: true,
// define the table's name
tableName
:
'd_delivery_product'
,
validate
:
{
},
indexes
:
[
]
});
}
igirl-channel-gateway/app/base/db/models/dbdelivery/flowlog.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"flowlog"
,
{
uapp_id
:
DataTypes
.
INTEGER
,
//
deliveryOrderNo
:
DataTypes
.
STRING
(
64
),
//交付订单号
opContent
:
DataTypes
.
STRING
(
208
),
// 操作描述
notes
:
DataTypes
.
STRING
,
// 备注
createuser_id
:
DataTypes
.
INTEGER
,
//
isShow
:
{
//是否显示
type
:
DataTypes
.
BOOLEAN
,
defaultValue
:
false
,
},
},
{
paranoid
:
false
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
timestamps
:
true
,
updatedAt
:
false
,
//freezeTableName: true,
// define the table's name
tableName
:
'd_flow_log'
,
validate
:
{
},
indexes
:
[
]
});
}
igirl-channel-gateway/app/base/db/models/dbdelivery/officialinfo.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"tmofficialinfo"
,
{
uapp_id
:
DataTypes
.
INTEGER
,
//
officialCode
:
DataTypes
.
STRING
(
50
),
//官文号(如:商标注册号)
officialTypeName
:
DataTypes
.
STRING
(
100
),
//
officialType
:
DataTypes
.
STRING
(
50
),
//商标官文类型:1: 商标注册申请书, 2: 商标注册申请补正通知书, 3: 商标注册申请受理通知书, 4: 商标注册申请不予受理通知书,
//5: 商标注册同日申请补送使用证据通知书,6: 商标注册同日申请协商通知书商标注册同日申请抽签通知书,
//7: 商标驳回通知书, 8: 商标部分驳回通知书, 9: 商标注册申请初步审定公告通知书,
//10: 商标异议答辩通知书, 11: 异议裁定书, 12: 纸质版商标注册证, 13: 电子版商标注册证
officialFileName
:
DataTypes
.
STRING
(
200
),
// 官文文件名称
officialFileUrl
:
DataTypes
.
STRING
(
500
),
// 官文文件地址
notes
:
DataTypes
.
STRING
,
//
officialMailType
:
DataTypes
.
STRING
(
10
),
//官文邮寄类型:1: 待申请, 2: 待邮寄, 3: 已邮寄
officialMailTypeName
:
DataTypes
.
STRING
(
50
),
//官文邮寄类型名称
createuser_id
:
DataTypes
.
INTEGER
,
//
updateuser_id
:
DataTypes
.
INTEGER
,
//
},
{
paranoid
:
false
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
timestamps
:
true
,
updatedAt
:
false
,
//freezeTableName: true,
// define the table's name
tableName
:
'd_tmofficial'
,
validate
:
{
},
indexes
:
[
]
});
}
igirl-channel-gateway/app/base/db/models/dbtrademark/tmdelivery.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"tmdelivery"
,
{
uapp_id
:
DataTypes
.
INTEGER
,
//
deliveryOrderNo
:
DataTypes
.
STRING
(
64
),
//交付订单号
channelUserId
:
DataTypes
.
STRING
(
64
),
//渠道用户ID
channelServiceNo
:
DataTypes
.
STRING
(
64
),
//渠道服务单号
channelOrderNo
:
DataTypes
.
STRING
(
1024
),
//渠道订单号列表,多个以,隔开
needNo
:
DataTypes
.
STRING
(
64
),
//需求单号(渠道过来的订单号,如阿里、1688过来的单号)
tmName
:
DataTypes
.
STRING
(
1000
),
//商标名称
tmType
:
{
type
:
DataTypes
.
ENUM
,
values
:
Object
.
keys
(
uiconfig
.
config
.
pdict
.
tm_type
),
},
//p:普通商标,j:集体商标,z:证明商标,t:特殊商标
tmFormTypeName
:
DataTypes
.
STRING
(
50
),
//
tmFormType
:
{
type
:
DataTypes
.
ENUM
,
values
:
Object
.
keys
(
uiconfig
.
config
.
pdict
.
tm_form_type
),
set
:
function
(
val
)
{
this
.
setDataValue
(
"tmFormType"
,
val
);
this
.
setDataValue
(
"tmFormTypeName"
,
uiconfig
.
config
.
pdict
.
tm_form_type
[
val
]);
}
},
//商标类型形式:1:立体,3:字,4:图,5:字图,6:颜色,7:彩色
nclOneCodes
:
DataTypes
.
STRING
,
//尼斯大类列表:格式以,隔开
payStatusName
:
DataTypes
.
STRING
(
50
),
//
payStatus
:
{
type
:
DataTypes
.
ENUM
,
values
:
Object
.
keys
(
uiconfig
.
config
.
pdict
.
order_service_pay_status
),
set
:
function
(
val
)
{
this
.
setDataValue
(
"payStatus"
,
val
);
this
.
setDataValue
(
"payStatusName"
,
uiconfig
.
config
.
pdict
.
order_service_pay_status
[
val
]);
}
},
//支付状态:dfk:待付款,yzf:已支付
payTime
:
DataTypes
.
DATE
,
// 渠道有支付时间则用渠道的支付时间
deliveryStatusName
:
DataTypes
.
STRING
(
50
),
//
deliveryStatus
:
{
type
:
DataTypes
.
ENUM
,
values
:
Object
.
keys
(
uiconfig
.
config
.
pdict
.
delivery_status
),
set
:
function
(
val
)
{
this
.
setDataValue
(
"deliveryStatus"
,
val
);
this
.
setDataValue
(
"deliveryStatusName"
,
uiconfig
.
config
.
pdict
.
delivery_status
[
val
]);
}
},
//商标交付状态:dsccl: 待上传材料,dqrfa:待确认方案,fabtg:方案不通过, dsh: 待审核, ddj: 待递交, ydj: 已递交, ywc: 已完成
submitTime
:
DataTypes
.
DATE
,
// 递交时间
appDataOpType
:
{
type
:
DataTypes
.
ENUM
,
values
:
Object
.
keys
(
uiconfig
.
config
.
pdict
.
app_data_op_type
),
},
//应用数据操作类型:00独立,10全委托,20部分委托
picUrl
:
DataTypes
.
STRING
(
500
),
//商标图样
colorizedPicUrl
:
DataTypes
.
STRING
(
500
),
//商标彩色图样
gzwtsUrl
:
DataTypes
.
STRING
(
500
),
//盖章委托书
sywjUrl
:
DataTypes
.
STRING
(
500
),
//声音文件
smwjUrl
:
DataTypes
.
STRING
(
500
),
//说明文件
notes
:
DataTypes
.
STRING
(
255
),
//备注
createuser_id
:
DataTypes
.
INTEGER
,
//
updateuser_id
:
DataTypes
.
INTEGER
,
//
auditor_id
:
DataTypes
.
INTEGER
,
//
createuser
:
DataTypes
.
STRING
(
100
),
//
updateuser
:
DataTypes
.
STRING
(
100
),
//
auditoruser
:
DataTypes
.
STRING
(
100
),
//
nclOneCount
:
DataTypes
.
INTEGER
,
// 尼斯大类数量
nclCount
:
DataTypes
.
INTEGER
,
// 尼斯数量
nclPublicExpense
:
DataTypes
.
DECIMAL
(
12
,
2
),
// 尼斯官费总额
},
{
paranoid
:
false
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
timestamps
:
true
,
updatedAt
:
false
,
//freezeTableName: true,
// define the table's name
tableName
:
'tm_delivery'
,
validate
:
{
},
indexes
:
[
]
});
}
igirl-channel-gateway/app/base/db/models/dbtrademark/trademark.js
deleted
100644 → 0
View file @
61220171
This diff is collapsed.
Click to expand it.
igirl-channel-gateway/app/base/service/impl/dbdelivery/customercontactsSve.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
class
CustomerContactsService
extends
ServiceBase
{
constructor
()
{
super
(
"dbdelivery"
,
ServiceBase
.
getDaoName
(
CustomerContactsService
));
this
.
ordertmproductSve
=
system
.
getObject
(
"service.dborder.ordertmproductSve"
);
}
/**
* 修改商标交付单联系人(订单详情页面)
* @param {*} obj
* obj.deliveryOrderNo 交付订单号,
* obj.name 联系人,obj.mobile 联系电话,obj.email 电子邮箱,obj.tel 座机电话
* obj.user 用户数据
*/
async
updateContacts
(
obj
){
var
user
=
obj
.
user
;
if
(
!
user
||
!
user
.
id
){
return
system
.
getResultFail
(
-
100
,
"未知用户"
);
}
var
deliveryOrderNo
=
obj
.
deliveryOrderNo
;
if
(
!
deliveryOrderNo
){
return
system
.
getResultFail
(
-
101
,
"deliveryOrderNo参数错误"
);
}
// 1.获取交付单信息
var
ordertmproduct
=
await
this
.
ordertmproductSve
.
dao
.
model
.
findOne
({
where
:{
deliveryOrderNo
:
deliveryOrderNo
},
raw
:
true
});
if
(
!
ordertmproduct
||
!
ordertmproduct
.
id
){
return
system
.
getResultFail
(
-
102
,
"商标交付单不存在"
);
}
// 2.获取交付单状态,判断是否可修改
if
(
ordertmproduct
.
deliveryStatus
==
'ddj'
||
ordertmproduct
.
deliveryStatus
==
'ywc'
){
var
deliveryStatusName
=
"待递交"
;
if
(
ordertmproduct
.
deliveryStatus
==
'ywc'
){
deliveryStatusName
=
"已完成"
;
}
return
system
.
getResultFail
(
-
103
,
"该商标交付单状态为"
+
deliveryStatusName
+
",不能进行修改"
);
}
var
self
=
this
;
return
await
self
.
db
.
transaction
(
async
function
(
t
)
{
var
contactsObj
=
{
deliveryOrderNo
:
deliveryOrderNo
};
if
(
obj
.
name
){
contactsObj
[
"name"
]
=
obj
.
name
;
}
if
(
obj
.
mobile
){
contactsObj
[
"mobile"
]
=
obj
.
mobile
;
}
if
(
obj
.
email
){
contactsObj
[
"email"
]
=
obj
.
email
;
}
if
(
obj
.
tel
){
contactsObj
[
"tel"
]
=
obj
.
tel
;
}
//修改联系人信息
await
self
.
dao
.
model
.
update
(
contactsObj
,
{
where
:
{
deliveryOrderNo
:
deliveryOrderNo
},
transaction
:
t
});
return
system
.
getResultSuccess
();
})
}
}
module
.
exports
=
CustomerContactsService
;
igirl-channel-gateway/app/base/service/impl/dbdelivery/customerinfoSve.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
class
CustomerInfoService
extends
ServiceBase
{
constructor
()
{
super
(
"dbdelivery"
,
ServiceBase
.
getDaoName
(
CustomerInfoService
));
this
.
ordertmproductSve
=
system
.
getObject
(
"service.dborder.ordertmproductSve"
);
}
/**
* 修改申请人信息(订单详情页面使用)
* @param {*} obj
* obj.deliveryOrderNo 交付订单号,
* obj.customerType 申请人类型,
* obj.name 公司名称或个人名称,
* obj.code 社会统一信用代码,
* obj.applyAddr 公司地址,
* obj.zipCode 邮编
* obj.identityCardPic 身份证图片,
* obj.businessLicensePic 营业执照图片,
* obj.identityCardPdf 身份证pdf,
* obj.businessLicensePdf 营业执照pdf,
* obj.user 用户数据
*/
async
updateCustomerInfo
(
obj
){
var
user
=
obj
.
user
;
if
(
!
user
||
!
user
.
id
){
return
system
.
getResultFail
(
-
100
,
"未知用户"
);
}
var
deliveryOrderNo
=
obj
.
deliveryOrderNo
;
if
(
!
deliveryOrderNo
){
return
system
.
getResultFail
(
-
101
,
"deliveryOrderNo参数错误"
);
}
// 1.获取交付单信息
var
ordertmproduct
=
await
this
.
ordertmproductSve
.
dao
.
model
.
findOne
({
where
:{
deliveryOrderNo
:
deliveryOrderNo
},
raw
:
true
});
if
(
!
ordertmproduct
||
!
ordertmproduct
.
id
){
return
system
.
getResultFail
(
-
102
,
"商标交付单不存在"
);
}
// 2.获取交付单状态,判断是否可修改
if
(
ordertmproduct
.
deliveryStatus
==
'ddj'
||
ordertmproduct
.
deliveryStatus
==
'ywc'
){
var
deliveryStatusName
=
"待递交"
;
if
(
ordertmproduct
.
deliveryStatus
==
'ywc'
){
deliveryStatusName
=
"已完成"
;
}
return
system
.
getResultFail
(
-
103
,
"该商标交付单状态为"
+
deliveryStatusName
+
",不能进行修改"
);
}
var
customerinfo
=
await
this
.
dao
.
model
.
findOne
({
where
:{
deliveryOrderNo
:
deliveryOrderNo
},
raw
:
true
});
if
(
!
customerinfo
||
!
customerinfo
.
id
){
return
system
.
getResultFail
(
-
104
,
"未知申请人"
);
}
var
self
=
this
;
return
await
self
.
db
.
transaction
(
async
function
(
t
)
{
var
ciObj
=
{
id
:
customerinfo
.
id
,
updateuser_id
:
user
.
id
};
if
(
obj
.
customerType
){
ciObj
[
"customerType"
]
=
obj
.
customerType
;
}
if
(
obj
.
name
){
ciObj
[
"name"
]
=
obj
.
name
;
}
if
(
obj
.
code
){
ciObj
[
"code"
]
=
obj
.
code
;
}
if
(
obj
.
applyAddr
){
ciObj
[
"applyAddr"
]
=
obj
.
applyAddr
;
}
if
(
obj
.
zipCode
){
ciObj
[
"zipCode"
]
=
obj
.
zipCode
;
}
if
(
obj
.
businessLicensePic
){
ciObj
[
"businessLicensePic"
]
=
obj
.
businessLicensePic
;
}
if
(
obj
.
identityCardPic
){
ciObj
[
"identityCardPic"
]
=
obj
.
identityCardPic
;
}
if
(
obj
.
businessLicensePdf
){
ciObj
[
"businessLicensePdf"
]
=
obj
.
businessLicensePdf
;
}
if
(
obj
.
identityCardPdf
){
ciObj
[
"identityCardPdf"
]
=
obj
.
identityCardPdf
;
}
await
self
.
dao
.
update
(
ciObj
,
t
);
//修改申请人信息
return
system
.
getResultSuccess
();
})
}
/**
* 修改交官文件
* @param {*} obj
* obj.deliveryOrderNo 交付单号,
* obj.gzwtsUrl 盖章委托书,
* obj.smwjUrl 说明文件,
* obj.identityCardPic 身份证图片,
* obj.businessLicensePic 营业执照图片,
* obj.identityCardPdf 身份证pdf,
* obj.businessLicensePdf 营业执照pdf,
* obj.user 用户数据
*/
async
updateOfficial
(
obj
){
var
user
=
obj
.
user
;
if
(
!
user
||
!
user
.
id
){
return
system
.
getResultFail
(
-
100
,
"未知用户"
);
}
var
deliveryOrderNo
=
obj
.
deliveryOrderNo
;
if
(
!
deliveryOrderNo
){
return
system
.
getResultFail
(
-
101
,
"deliveryOrderNo参数错误"
);
}
// 1.获取交付单信息
var
ordertmproduct
=
await
this
.
ordertmproductSve
.
dao
.
model
.
findOne
({
where
:{
deliveryOrderNo
:
deliveryOrderNo
},
raw
:
true
});
if
(
!
ordertmproduct
||
!
ordertmproduct
.
id
){
return
system
.
getResultFail
(
-
102
,
"商标交付单不存在"
);
}
// 2.获取交付单状态,判断是否可修改
if
(
ordertmproduct
.
deliveryStatus
==
'ddj'
||
ordertmproduct
.
deliveryStatus
==
'ywc'
){
var
deliveryStatusName
=
"待递交"
;
if
(
ordertmproduct
.
deliveryStatus
==
'ywc'
){
deliveryStatusName
=
"已完成"
;
}
return
system
.
getResultFail
(
-
103
,
"该商标交付单状态为"
+
deliveryStatusName
+
",不能进行修改"
);
}
var
customerinfo
=
await
this
.
dao
.
model
.
findOne
({
where
:{
deliveryOrderNo
:
deliveryOrderNo
},
raw
:
true
});
if
(
!
customerinfo
||
!
customerinfo
.
id
){
return
system
.
getResultFail
(
-
104
,
"未知申请人"
);
}
var
self
=
this
;
return
await
self
.
db
.
transaction
(
async
function
(
t
)
{
var
ciObj
=
{
id
:
customerinfo
.
id
,
updateuser_id
:
user
.
id
};
if
(
obj
.
businessLicensePic
){
ciObj
[
"businessLicensePic"
]
=
obj
.
businessLicensePic
;
}
if
(
obj
.
identityCardPic
){
ciObj
[
"identityCardPic"
]
=
obj
.
identityCardPic
;
}
if
(
obj
.
businessLicensePdf
){
ciObj
[
"businessLicensePdf"
]
=
obj
.
businessLicensePdf
;
}
if
(
obj
.
identityCardPdf
){
ciObj
[
"identityCardPdf"
]
=
obj
.
identityCardPdf
;
}
await
self
.
dao
.
update
(
ciObj
,
t
);
//申请人信息 修改营业执照、身份证文件
var
otpObj
=
{
id
:
ordertmproduct
.
id
,
updateuser_id
:
user
.
id
,
updateuser
:
user
.
nickname
};
if
(
obj
.
gzwtsUrl
){
otpObj
[
"gzwtsUrl"
]
=
obj
.
gzwtsUrl
;
}
if
(
obj
.
smwjUrl
){
otpObj
[
"smwjUrl"
]
=
obj
.
smwjUrl
;
}
await
self
.
ordertmproductSve
.
update
(
otpObj
,
t
);
//商标交付单 修改盖章委托书、说明文件
return
system
.
getResultSuccess
();
})
}
}
module
.
exports
=
CustomerInfoService
;
igirl-channel-gateway/app/base/service/impl/dbdelivery/deliveryproductSve.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
class
DeliveryProductSve
extends
ServiceBase
{
constructor
()
{
super
(
"dbdelivery"
,
ServiceBase
.
getDaoName
(
DeliveryProductSve
));
// this.appproductDao = system.getObject("db.dbapp.appproductDao");
// this.ordertmproductDao = system.getObject("db.dborder.ordertmproductDao");
// // this.orderDao = system.getObject("db.dborder.orderDao");
// this.customerinfoDao = system.getObject("db.dborder.customerinfoDao");
// this.customercontactsDao = system.getObject("db.dborder.customercontactsDao");
// this.orderflowDao = system.getObject("db.dborder.orderflowDao");
// this.trademarkDao = system.getObject("db.dbtrademark.trademarkDao");
// this.receiptvoucherDao = null;
// this.tmofficialDao = system.getObject("db.dbtrademark.tmofficialDao");
}
}
module
.
exports
=
DeliveryProductSve
;
igirl-channel-gateway/app/base/service/impl/dbdelivery/flowlogSve.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
class
FlowLogService
extends
ServiceBase
{
constructor
()
{
super
(
"dbdelivery"
,
ServiceBase
.
getDaoName
(
FlowLogService
));
}
}
module
.
exports
=
FlowLogService
;
igirl-channel-gateway/app/base/service/impl/dbdelivery/officialinfoSve.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
class
OfficialInfoService
extends
ServiceBase
{
constructor
()
{
super
(
"dbdelivery"
,
ServiceBase
.
getDaoName
(
OfficialInfoService
));
}
}
module
.
exports
=
OfficialInfoService
;
igirl-channel-gateway/app/base/service/impl/dbtrademark/tmdeliverySve.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
class
TmDeliverySve
extends
ServiceBase
{
constructor
()
{
super
(
"dbtrademark"
,
ServiceBase
.
getDaoName
(
TmDeliverySve
));
// this.appproductDao = system.getObject("db.dbapp.appproductDao");
// this.ordertmproductDao = system.getObject("db.dborder.ordertmproductDao");
// // this.orderDao = system.getObject("db.dborder.orderDao");
// this.customerinfoDao = system.getObject("db.dborder.customerinfoDao");
// this.customercontactsDao = system.getObject("db.dborder.customercontactsDao");
// this.orderflowDao = system.getObject("db.dborder.orderflowDao");
// this.trademarkDao = system.getObject("db.dbtrademark.trademarkDao");
// this.receiptvoucherDao = null;
// this.tmofficialDao = system.getObject("db.dbtrademark.tmofficialDao");
}
}
module
.
exports
=
TmDeliverySve
;
igirl-channel-gateway/app/base/service/impl/dbtrademark/trademarkSve.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
class
TradeMarkService
extends
ServiceBase
{
constructor
()
{
super
(
"dbtrademark"
,
ServiceBase
.
getDaoName
(
TradeMarkService
));
}
}
module
.
exports
=
TradeMarkService
;
igirl-channel-gateway/app/base/service/sve.base.js
View file @
e242a828
...
@@ -102,38 +102,6 @@ class ServiceBase {
...
@@ -102,38 +102,6 @@ class ServiceBase {
}
}
return
tResult
;
return
tResult
;
}
}
async
apiCallWithAk
(
url
,
params
)
{
var
acckapp
=
await
this
.
cacheManager
[
"ApiAccessKeyCache"
].
cache
(
settings
.
appKey
);
var
acck
=
acckapp
.
accessKey
;
//按照访问token
var
restResult
=
await
this
.
restS
.
execPostWithAK
(
params
,
url
,
acck
);
if
(
restResult
)
{
if
(
restResult
.
status
==
0
)
{
var
resultRtn
=
restResult
.
data
;
return
resultRtn
;
}
else
{
await
this
.
cacheManager
[
"ApiAccessKeyCache"
].
invalidate
(
settings
.
appKey
);
return
null
;
}
}
return
null
;
}
// async apiCallWithAkNoWait(url,params){
// var acckapp=await this.cacheManager["ApiAccessKeyCache"].cache(settings.appKey);
// var acck=acckapp.accessKey;
// //按照访问token
// var restResult=await this.restS.execPostWithAK(params,url,acck);
// if(restResult){
// if(restResult.status==0){
// var resultRtn=restResult.data;
// return resultRtn;
// }else{
// await this.cacheManager["ApiAccessKeyCache"].invalidate(settings.appKey);
// return null;
// }
// }
// return null;
// }
static
getDaoName
(
ClassObj
)
{
static
getDaoName
(
ClassObj
)
{
return
ClassObj
[
"name"
].
substring
(
0
,
ClassObj
[
"name"
].
lastIndexOf
(
"Service"
)).
toLowerCase
()
+
"Dao"
;
return
ClassObj
[
"name"
].
substring
(
0
,
ClassObj
[
"name"
].
lastIndexOf
(
"Service"
)).
toLowerCase
()
+
"Dao"
;
}
}
...
...
igirl-channel-gateway/app/base/utils/businessManager/opPlatformUtils.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../system"
);
const
uuidv4
=
require
(
'uuid/v4'
);
const
md5
=
require
(
"MD5"
);
var
settings
=
require
(
"../../../config/settings"
);
class
OpPlatformUtils
{
constructor
()
{
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
this
.
createUserUrl
=
settings
.
paasUrl
()
+
"api/auth/accessAuth/register"
;
this
.
fetchDefaultVCodeUrl
=
settings
.
paasUrl
()
+
"api/auth/accessAuth/fetchDefaultVCode"
;
this
.
loginUrl
=
settings
.
paasUrl
()
+
"api/auth/accessAuth/loginByMd5Password"
;
this
.
authByCodeUrl
=
settings
.
paasUrl
()
+
"api/auth/accessAuth/authByCode"
;
this
.
exTime
=
2
*
3600
;
//缓存过期时间,2小时
}
getUUID
()
{
var
uuid
=
uuidv4
();
var
u
=
uuid
.
replace
(
/
\-
/g
,
""
);
return
u
;
}
async
getReqApiAccessKey
(
appKey
,
secret
)
{
var
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
var
reqApiAccessKey
=
null
;
if
(
appKey
&&
secret
)
{
reqApiAccessKey
=
await
cacheManager
[
"ApiAccessKeyCache"
].
cache
(
appKey
,
null
,
this
.
exTime
,
secret
);
}
else
{
reqApiAccessKey
=
await
cacheManager
[
"ApiAccessKeyCache"
].
cache
(
settings
.
appKey
,
null
,
this
.
exTime
);
}
if
(
!
reqApiAccessKey
||
reqApiAccessKey
.
status
!=
0
)
{
return
reqApiAccessKey
;
}
return
reqApiAccessKey
;
}
/**
* 创建用户信息
* @param {*} userName 用户名
* @param {*} mobile 手机号
* @param {*} password 密码,不传为使用默认密码
*
* 返回值:
* {
"status": 0,---值为2000为已经存在此用户,注册失败
"msg": "success",
"data": {
"auth_url": "http://sj.app.com:3002/auth?opencode=1e4949d1c39444a8b32f023143625b1d",---回调url,通过回调地址获取平台用户信息
"opencode": "1e4949d1c39444a8b32f023143625b1d",---平台用户code随机生成会变,平台是30s有效期,通过其可以向获取用户信息
"open_user_id": 12---平台用户id
},
"requestid": "5362bf6f941e4f92961a61068f05cd7f"
}
*/
async
createUserInfo
(
userName
,
mobile
,
password
,
appKey
,
secret
)
{
var
reqApiAccessKey
=
await
this
.
getReqApiAccessKey
(
appKey
,
secret
);
if
(
reqApiAccessKey
.
status
!=
0
)
{
return
reqApiAccessKey
;
}
var
param
=
{
userName
:
userName
,
mobile
:
mobile
,
password
:
password
||
settings
.
defaultPassWord
,
}
//按照访问token
var
restResult
=
await
this
.
restClient
.
execPostWithAK
(
param
,
this
.
createUserUrl
,
reqApiAccessKey
.
data
.
accessKey
);
if
(
restResult
.
status
!=
0
||
!
restResult
.
data
)
{
return
system
.
getResult
(
restResult
.
status
,
restResult
.
msg
);
}
return
system
.
getResultSuccess
(
restResult
.
data
);
}
async
fetchVCode
(
mobile
)
{
var
reqApiAccessKey
=
await
this
.
getReqApiAccessKey
(
null
,
null
);
if
(
reqApiAccessKey
.
status
!=
0
)
{
return
reqApiAccessKey
;
}
var
param
=
{
mobile
:
mobile
}
//按照访问token
var
restResult
=
await
this
.
restClient
.
execPostWithAK
(
param
,
this
.
fetchDefaultVCodeUrl
,
reqApiAccessKey
.
data
.
accessKey
);
if
(
restResult
.
status
!=
0
||
!
restResult
.
data
)
{
return
system
.
getResult
(
null
,
restResult
.
msg
);
}
return
system
.
getResultSuccess
();
}
/**
* 用户登录
* @param {*} userName 用户名
* @param {*} password 密码,不传为使用默认密码
*
* 返回值:
* {
"status": 0,---值为2010为用户名或密码错误
"msg": "success",
"data": {
"auth_url": "http://sj.app.com:3002/auth?opencode=1e4949d1c39444a8b32f023143625b1d",---回调url,通过回调地址获取平台用户信息
"opencode": "1e4949d1c39444a8b32f023143625b1d"---平台用户code随机生成会变,平台是30s有效期,通过其可以向获取用户信息
},
"requestid": "5362bf6f941e4f92961a61068f05cd7f"
}
*/
async
login
(
userName
,
password
,
appKey
,
secret
)
{
var
reqApiAccessKey
=
await
this
.
getReqApiAccessKey
(
appKey
,
secret
);
if
(
reqApiAccessKey
.
status
!=
0
)
{
return
reqApiAccessKey
;
}
var
param
=
{
userName
:
userName
,
password
:
password
||
settings
.
defaultPassWord
,
}
//按照访问token
var
restResult
=
await
this
.
restClient
.
execPostWithAK
(
param
,
this
.
loginUrl
,
reqApiAccessKey
.
data
.
accessKey
);
if
(
restResult
.
status
!=
0
||
!
restResult
.
data
)
{
return
system
.
getResult
(
restResult
.
status
,
restResult
.
msg
);
}
return
system
.
getResultSuccess
(
restResult
.
data
);
}
/**
* 通过opencode获取用户登录信息
* @param {*} opencode 用户登录或注册opencode
*
* 返回值:
* {
"status": 0,---值为2010为用户名或密码错误
"msg": "success",
"data": {},---平台用户信息
"requestid": "5362bf6f941e4f92961a61068f05cd7f"
}
*/
async
authByCode
(
opencode
,
appKey
,
secret
)
{
var
reqApiAccessKey
=
await
this
.
getReqApiAccessKey
(
appKey
,
secret
);
if
(
reqApiAccessKey
.
status
!=
0
)
{
return
reqApiAccessKey
;
}
var
param
=
{
opencode
:
opencode
}
//按照访问token
var
restResult
=
await
this
.
restClient
.
execPostWithAK
(
param
,
this
.
authByCodeUrl
,
reqApiAccessKey
.
data
.
accessKey
);
if
(
restResult
.
status
!=
0
||
!
restResult
.
data
)
{
return
system
.
getResult
(
restResult
.
status
,
restResult
.
msg
);
}
return
system
.
getResultSuccess
(
restResult
.
data
);
}
}
module
.
exports
=
OpPlatformUtils
;
igirl-channel-gateway/app/base/utils/businessManager/pushUtils.js
deleted
100644 → 0
View file @
61220171
const
system
=
require
(
"../../system"
);
const
uuidv4
=
require
(
'uuid/v4'
);
const
md5
=
require
(
"MD5"
);
class
PushUtils
{
constructor
()
{
this
.
logCtl
=
system
.
getObject
(
"web.common.oplogCtl"
);
this
.
cacheManager
=
system
.
getObject
(
"db.common.cacheManager"
);
this
.
merchantpushlogSve
=
system
.
getObject
(
"service.merchant.merchantpushlogSve"
);
this
.
execClient
=
system
.
getObject
(
"util.execClient"
);
this
.
merchantpushSve
=
system
.
getObject
(
"service.merchant.merchantpushSve"
);
}
getUUID
()
{
var
uuid
=
uuidv4
();
var
u
=
uuid
.
replace
(
/
\-
/g
,
""
);
return
u
;
}
async
getCachePushItemUrl
(
merchant_id
)
{
return
await
this
.
cacheManager
[
"MerchantPushUrlCache"
].
cache
(
merchant_id
,
null
,
3600
);
}
/**
* 推送到第三方数据
* @param {*} reqUrl 请求推送的url
* @param {*} params 推送的参数
*/
async
push
(
merchantId
,
field
,
params
)
{
try
{
var
pushConfig
=
await
this
.
getCachePushItemUrl
(
merchantId
)
||
{};
var
reqUrl
=
pushConfig
[
field
];
if
(
!
reqUrl
)
{
this
.
logCtl
.
error
({
optitle
:
"推送到第三方数据异常error"
,
op
:
"merchantId = "
+
merchantId
+
"; reqUrl is empty, field = "
+
field
,
content
:
"reqUrl is empty"
,
clientIp
:
"pushUtils中没有ip"
});
return
;
}
// 签名
params
.
sign
=
await
this
.
createSign
(
params
,
merchantId
);
params
.
requestid
=
this
.
getUUID
();
var
rtn
=
await
this
.
execClient
.
execPost
(
params
,
reqUrl
);
var
returnValue
=
0
;
if
(
rtn
.
stdout
)
{
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
result
.
code
==
"success"
)
{
returnValue
=
1
;
}
}
//记录推送结果
this
.
merchantpushlogSve
.
create
({
merchant_id
:
merchantId
,
//商户id
api
:
reqUrl
,
//接口地址
params
:
JSON
.
stringify
(
params
),
//推送数据信息
rs
:
rtn
.
stdout
,
//推送返回结果
success
:
returnValue
//是否推送成功
});
}
catch
(
e
)
{
console
.
log
(
e
.
stack
);
this
.
logCtl
.
error
({
optitle
:
"推送到第三方数据异常error"
,
op
:
reqUrl
+
";params="
+
JSON
.
stringify
(
params
)
+
";reqid="
+
params
.
requestid
,
content
:
e
.
stack
,
clientIp
:
"pushUtils中没有ip"
});
}
}
/**
* 多次推送到第三方数据
* @param {*} reqUrl 请求推送的url
* @param {*} params 推送的参数
*/
async
pushMany
(
reqUrl
,
params
)
{
try
{
params
.
requestid
=
this
.
getUUID
();
var
rtn
=
this
.
execClient
.
execPost
(
params
,
reqUrl
);
//TODO:可以做多次推送,规则待定
// var result = JSON.parse(rtn.stdout);
// if (result && result.code == 200) {
// var resultdata = result.data;
// return { code: 1, msg: "success" };
// } else {
// return { code: -1, msg: "err" };
// }
}
catch
(
e
)
{
this
.
logCtl
.
error
({
optitle
:
"多次推送到第三方数据异常error"
,
op
:
url
+
";params="
+
JSON
.
stringify
(
params
)
+
";reqid="
+
params
.
requestid
,
content
:
e
.
stack
,
clientIp
:
pobj
.
clientIp
});
}
}
async
createSign
(
params
,
appId
)
{
var
appInfo
=
await
this
.
cacheManager
[
"ApiAppIdCheckCache"
].
cache
(
appId
,
null
,
3000
);
var
signArr
=
[];
var
keys
=
Object
.
keys
(
params
).
sort
();
for
(
let
k
=
0
;
k
<
keys
.
length
;
k
++
)
{
const
tKey
=
keys
[
k
];
if
(
tKey
!=
"sign"
&&
params
[
tKey
])
{
signArr
.
push
(
tKey
+
"="
+
params
[
tKey
]);
}
}
var
resultSignStr
=
signArr
.
join
(
"&"
)
+
"&key="
+
appInfo
.
appSecret
;
return
md5
(
resultSignStr
).
toUpperCase
();
}
}
module
.
exports
=
PushUtils
;
igirl-channel-gateway/app/config/settings.js
View file @
e242a828
...
@@ -15,21 +15,14 @@ var ENVINPUT = {
...
@@ -15,21 +15,14 @@ var ENVINPUT = {
};
};
var
settings
=
{
var
settings
=
{
env
:
ENVINPUT
.
APP_ENV
,
env
:
ENVINPUT
.
APP_ENV
,
appKey
:
"20191
1051030
"
,
appKey
:
"20191
2031344
"
,
paasKey
:
"wx76a324c5d201d1a4"
,
paasKey
:
"wx76a324c5d201d1a4"
,
secret
:
"
aeea89de9e8049b09233ec146173de4a
"
,
secret
:
"
7cbb846246874167b5c7e01cd0016c88
"
,
salt
:
"%iatpD1gcxz7iF#B"
,
salt
:
"%iatpD1gcxz7iF#B"
,
cacheprefix
:
"
sjb
"
,
cacheprefix
:
"
channelgateway
"
,
usertimeout
:
3600
,
//单位秒
usertimeout
:
3600
,
//单位秒
basepath
:
path
.
normalize
(
path
.
join
(
__dirname
,
'../..'
)),
basepath
:
path
.
normalize
(
path
.
join
(
__dirname
,
'../..'
)),
port
:
process
.
env
.
NODE_PORT
||
4005
,
port
:
process
.
env
.
NODE_PORT
||
4005
,
paasUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://p.apps.com:4001/"
;
}
else
{
return
"https://open.gongsibao.com/"
;
}
},
reqEsAddr
:
function
()
{
reqEsAddr
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
if
(
this
.
env
==
"dev"
)
{
var
localsettings
=
require
(
"./localsettings"
);
var
localsettings
=
require
(
"./localsettings"
);
...
...
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