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
7003165e
Commit
7003165e
authored
Jan 20, 2020
by
王栋源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wdy
parent
ebb2859e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
207 additions
and
0 deletions
+207
-0
center-channel/app/base/api/impl/action/zcbusinesschanceApi.js
+56
-0
center-channel/app/base/db/impl/dbcorder/businesschanceDao.js
+16
-0
center-channel/app/base/db/models/dbcorder/businesschance.js
+122
-0
center-channel/app/base/service/impl/dbcorder/businesschanceSve.js
+13
-0
No files found.
center-channel/app/base/api/impl/action/zcbusinesschanceApi.js
0 → 100644
View file @
7003165e
var
APIBase
=
require
(
"../../api.base"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
class
PaymentAPI
extends
APIBase
{
constructor
()
{
super
();
this
.
execlient
=
system
.
getObject
(
"util.execClient"
);
this
.
utilsProductSve
=
system
.
getObject
(
"service.utilsSve.utilsProductSve"
);
this
.
centerAppUrl
=
settings
.
centerAppUrl
();
}
/**
* 接口跳转-POST请求
* actionProcess 执行的流程
* actionType 执行的类型
* actionBody 执行的参数
*/
async
springBoard
(
pobj
,
qobj
,
req
)
{
if
(
!
pobj
.
actionProcess
)
{
return
system
.
getResult
(
null
,
"actionProcess参数不能为空"
);
}
if
(
!
pobj
.
actionType
)
{
return
system
.
getResult
(
null
,
"actionType参数不能为空"
);
}
var
result
=
await
this
.
opActionProcess
(
pobj
,
pobj
.
actionType
,
pobj
.
actionBody
,
req
);
return
result
;
}
async
opActionProcess
(
pobj
,
action_type
,
action_body
,
req
)
{
var
opResult
=
null
;
var
url
=
""
;
switch
(
action_type
)
{
// sy
case
"getQrCode"
:
//pc端订单支付二维码生成
url
=
this
.
centerAppUrl
+
"payment/paymentApi/getQrCode"
;
break
;
case
"queryOrder"
:
//通联支付查询
url
=
this
.
centerAppUrl
+
"payment/paymentApi/queryOrder"
;
break
;
case
"receiveCallBackNotify"
:
//通联支付查询
url
=
this
.
centerAppUrl
+
"payment/paymentApi/receiveCallBackNotify"
;
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
}
if
(
url
)
{
opResult
=
system
.
getResultSuccess
(
null
,
"action_type参数错误"
);
}
var
opResultstr
=
await
this
.
execlient
.
execPost
(
pobj
,
url
);
opResult
=
JSON
.
parse
(
opResultstr
.
stdout
)
return
opResult
;
}
}
module
.
exports
=
PaymentAPI
;
\ No newline at end of file
center-channel/app/base/db/impl/dbcorder/businesschanceDao.js
0 → 100644
View file @
7003165e
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
BusinesschanceDao
extends
Dao
{
constructor
(){
super
(
Dao
.
getModelName
(
BusinesschanceDao
));
}
extraWhere
(
obj
,
w
){
if
(
obj
.
codepath
&&
obj
.
codepath
!=
""
){
if
(
obj
.
codepath
.
indexOf
(
"calculateprice"
)
>
0
){
w
[
"user_id"
]
=
obj
.
uid
;
}
}
return
w
;
}
}
module
.
exports
=
BusinesschanceDao
;
center-channel/app/base/db/models/dbcorder/businesschance.js
0 → 100644
View file @
7003165e
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
appKey
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"businesschance"
,
{
app_id
:
DataTypes
.
INTEGER
,
publisherId
:
DataTypes
.
INTEGER
,
//发布者id
publisherName
:
DataTypes
.
STRING
,
//发布者姓名
publisherMobile
:
DataTypes
.
STRING
,
//发布者手机号
publisherOnlyCode
:
DataTypes
.
STRING
(
50
),
//发布者唯一码
publishContent
:
DataTypes
.
STRING
,
//发布内容
followManId
:
DataTypes
.
INTEGER
,
//跟进人id(合伙人)
followManName
:
DataTypes
.
STRING
,
//跟进人姓名(合伙人)
followManMobile
:
DataTypes
.
STRING
,
//跟进人手机号(合伙人)
followManOnlyCode
:
DataTypes
.
STRING
(
50
),
//跟进者唯一码
followContent
:
DataTypes
.
STRING
,
//跟进内容
chanceEvaluation
:{
//评论类型:"0":"差评","5":"一般","10":"好评"
type
:
DataTypes
.
ENUM
,
defaultValue
:
"10"
,
values
:
Object
.
keys
(
uiconfig
.
config
.
pdict
.
service_evaluation
),
set
:
function
(
val
){
this
.
setDataValue
(
"chanceEvaluation"
,
val
);
}
},
followTime
:
DataTypes
.
DATE
,
//跟进时间
chanceTypeName
:
DataTypes
.
STRING
,
chanceType
:{
//商机类型:"ip": "商标", "ic": "版权", "pa": "专利", "common": "增值", "icbc": "工商" “iso":"海外服务”
type
:
DataTypes
.
ENUM
,
values
:
Object
.
keys
(
uiconfig
.
config
.
pdict
.
chanceType
),
set
:
function
(
val
){
this
.
setDataValue
(
"chanceType"
,
val
);
this
.
setDataValue
(
"chanceTypeName"
,
uiconfig
.
config
.
pdict
.
chanceType
[
val
]);
}
},
name
:
DataTypes
.
STRING
,
//暂时没有用
chanceStatusName
:
DataTypes
.
STRING
,
chanceStatus
:{
// 商机:"1":"待服务","2":"跟进中","4":"成功","8":"失败"
type
:
DataTypes
.
ENUM
,
values
:
Object
.
keys
(
uiconfig
.
config
.
pdict
.
chance_status
),
set
:
function
(
val
){
this
.
setDataValue
(
"chanceStatus"
,
val
);
this
.
setDataValue
(
"chanceStatusName"
,
uiconfig
.
config
.
pdict
.
chance_status
[
val
]);
}
},
platformChanceType
:{
//平台商机类型:"common":"普通"
type
:
DataTypes
.
ENUM
,
defaultValue
:
"common"
,
values
:
Object
.
keys
(
uiconfig
.
config
.
pdict
.
platform_chance_type
),
set
:
function
(
val
){
this
.
setDataValue
(
"platformChanceType"
,
val
);
}
},
notes
:
DataTypes
.
STRING
,
//备注
//------------------------------------------渠道相关
channelCode
:{
//渠道编码:p_channel表中的channelCode
type
:
DataTypes
.
STRING
(
20
),
defaultValue
:
"hhr"
,
},
serviceItem_code
:
DataTypes
.
STRING
(
20
),
serviceItem_name
:
DataTypes
.
STRING
,
orderNum
:
DataTypes
.
STRING
(
50
),
//自己订单号,目前与订单表无关
channelUserName
:
DataTypes
.
STRING
(
50
),
//渠道用户名
channelOrderNum
:
DataTypes
.
STRING
(
50
),
//渠道方订单号
totalSum
:
DataTypes
.
DECIMAL
(
12
,
2
),
//总额
channelProfitRatio
:{
type
:
DataTypes
.
DECIMAL
(
12
,
2
),
//渠道分成比率(如:总额100,字段值30,则渠道的利润为30/100,剩下的则为平台利润)
defaultValue
:
0.00
,
},
channelProfit
:
DataTypes
.
DECIMAL
(
12
,
2
),
//渠道利润
platformProfit
:
DataTypes
.
DECIMAL
(
12
,
2
),
//平台利润
disposeNotes
:
DataTypes
.
STRING
,
//处理的备注
profitTypeName
:
DataTypes
.
STRING
(
50
),
//渠道利润类型名称
profitType
:{
//渠道利润类型:1: "比例分成", 2: "每单分成"
type
:
DataTypes
.
ENUM
,
values
:
Object
.
keys
(
uiconfig
.
config
.
pdict
.
channelProfitType
),
defaultValue
:
"1"
,
set
:
function
(
val
){
this
.
setDataValue
(
"profitType"
,
val
);
this
.
setDataValue
(
"profitTypeName"
,
uiconfig
.
config
.
pdict
.
channelProfitType
[
val
]);
},
},
isAllocationName
:{
// 是否分配名称
type
:
DataTypes
.
STRING
,
defaultValue
:
"否"
,
},
isAllocation
:{
//是否分配:"0": "否", "1": "是"
type
:
DataTypes
.
ENUM
,
defaultValue
:
"0"
,
values
:
Object
.
keys
(
uiconfig
.
config
.
pdict
.
isRecommend
),
set
:
function
(
val
){
this
.
setDataValue
(
"isAllocation"
,
val
);
this
.
setDataValue
(
"isAllocationName"
,
uiconfig
.
config
.
pdict
.
isRecommend
[
val
]);
},
defaultValue
:
"0"
,
},
allocationTime
:
DataTypes
.
DATE
,
//分配时间
city
:
DataTypes
.
STRING
(
50
),
// 城市
province
:
DataTypes
.
STRING
(
50
),
// 省份
},{
paranoid
:
true
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
//freezeTableName: true,
// define the table's name
tableName
:
'h_business_chance'
,
validate
:
{
},
indexes
:[
]
});
}
center-channel/app/base/service/impl/dbcorder/businesschanceSve.js
0 → 100644
View file @
7003165e
const
uuidv4
=
require
(
'uuid/v4'
);
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
class
BusinesschanceService
extends
ServiceBase
{
constructor
()
{
super
(
"dbcorder"
,
ServiceBase
.
getDaoName
(
BusinesschanceService
));
}
}
module
.
exports
=
BusinesschanceService
;
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