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
8657e712
Commit
8657e712
authored
Feb 27, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
179b856a
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
104 additions
and
307 deletions
+104
-307
center-order/app/base/api/impl/action/order.js
+5
-26
center-order/app/base/db/cache/appTokenByHostsCache.js
+0
-27
center-order/app/base/db/cache/appUserPinByChannelUserId.js
+0
-25
center-order/app/base/db/cache/appUserPinByLoginPwdCache.js
+0
-25
center-order/app/base/db/cache/appUserPinByLoginVcodeCache.js
+0
-25
center-order/app/base/db/metadata/apps/platform.js
+1
-1
center-order/app/base/db/models/dbcorder/orderinfo.js
+1
-0
center-order/app/base/db/models/dbneed/needinfo.js
+1
-1
center-order/app/base/service/impl/dbcorder/orderinfoSve.js
+95
-8
center-order/app/base/service/impl/utilsSve/utilsFqAliyunSve.js
+0
-101
center-order/app/base/utils/aliyunClient.js
+0
-39
center-order/app/config/settings.js
+1
-29
No files found.
center-order/app/base/api/impl/action/order.js
View file @
8657e712
...
@@ -27,8 +27,6 @@ class OrderAPI extends APIBase {
...
@@ -27,8 +27,6 @@ class OrderAPI extends APIBase {
switch
(
action_type
)
{
switch
(
action_type
)
{
case
"addOrder"
:
//创建订单
case
"addOrder"
:
//创建订单
opResult
=
await
this
.
addOrder
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
addOrder
(
pobj
,
pobj
.
actionBody
);
await
this
.
pushInfo
(
orderResult
,
pobj
,
pobj
.
actionBody
,
"pushOrder"
);
await
this
.
pushInfo
(
orderResult
,
pobj
,
pobj
.
actionBody
,
"pushBusiness"
);
break
;
break
;
case
"getOrderInfo"
:
//获取订单列表信息
case
"getOrderInfo"
:
//获取订单列表信息
opResult
=
await
this
.
orderinfoSve
.
getOrderInfo
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
orderinfoSve
.
getOrderInfo
(
pobj
,
pobj
.
actionBody
);
...
@@ -81,30 +79,11 @@ class OrderAPI extends APIBase {
...
@@ -81,30 +79,11 @@ class OrderAPI extends APIBase {
if
(
!
interface_info
.
interface_url
)
{
if
(
!
interface_info
.
interface_url
)
{
return
system
.
getResult
(
null
,
"产品接口地址信息有误,20080"
);
return
system
.
getResult
(
null
,
"产品接口地址信息有误,20080"
);
}
}
var
opResult
=
await
this
.
reflexAction
(
interface_info
,
pobj
);
var
refOpResult
=
await
this
.
reflexAction
(
interface_info
,
pobj
);
return
opResult
;
return
refOpResult
;
}
async
pushOrder
(
orderResult
,
pobj
,
actionBody
,
opType
)
{
if
(
opResult
.
status
!=
0
)
{
return
""
;
}
var
interface_list
=
actionBody
.
product_info
.
interface_info
;
if
(
!
interface_list
)
{
return
""
;
}
var
interface_info
=
null
;
var
interface_list_temp
=
interface_list
.
filter
(
f
=>
f
.
op_type
==
opType
)
if
(
interface_list_temp
&&
interface_list_temp
.
length
>
0
)
{
interface_info
=
interface_list_temp
[
0
];
}
if
(
!
interface_info
)
{
return
""
;
}
pobj
.
orderResult
=
orderResult
;
var
opResult
=
this
.
reflexAction
(
interface_info
,
pobj
);
return
opResult
;
}
}
async
reflexAction
(
interface_info
,
pobj
)
{
async
reflexAction
(
interface_info
,
pobj
)
{
var
refResult
=
null
;
if
(
interface_info
.
interface_type
==
"bd"
)
{
if
(
interface_info
.
interface_type
==
"bd"
)
{
if
(
!
interface_info
.
method_name
)
{
if
(
!
interface_info
.
method_name
)
{
return
system
.
getResult
(
null
,
"产品接口参数信息有误,20110"
);
return
system
.
getResult
(
null
,
"产品接口参数信息有误,20110"
);
...
@@ -115,12 +94,12 @@ class OrderAPI extends APIBase {
...
@@ -115,12 +94,12 @@ class OrderAPI extends APIBase {
}
}
pobj
.
interface_params
=
interface_info
.
params
;
pobj
.
interface_params
=
interface_info
.
params
;
var
params
=
[
pobj
];
var
params
=
[
pobj
];
op
Result
=
await
invokeObj
[
interface_info
.
method_name
].
apply
(
invokeObj
,
params
);
ref
Result
=
await
invokeObj
[
interface_info
.
method_name
].
apply
(
invokeObj
,
params
);
}
}
else
if
(
interface_info
.
interface_type
==
"yc"
)
{
else
if
(
interface_info
.
interface_type
==
"yc"
)
{
}
}
return
op
Result
;
return
ref
Result
;
}
}
}
}
...
...
center-order/app/base/db/cache/appTokenByHostsCache.js
deleted
100644 → 0
View file @
179b856a
const
CacheBase
=
require
(
"../cache.base"
);
const
system
=
require
(
"../../system"
);
const
settings
=
require
(
"../../../config/settings"
);
class
AppTokenByHostsCache
extends
CacheBase
{
constructor
()
{
super
();
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
}
desc
()
{
return
"应用中缓存访问token"
;
}
prefix
()
{
return
settings
.
cacheprefix
+
"_accesskey:"
;
}
async
buildCacheVal
(
cachekey
,
inputkey
,
val
,
ex
,
...
items
)
{
var
actionBody
=
val
;
var
acckapp
=
await
this
.
restClient
.
execPost
(
actionBody
,
settings
.
centerAppUrl
()
+
"auth/accessAuth/getTokenByHosts"
);
var
result
=
acckapp
.
stdout
;
console
.
log
(
acckapp
.
stdout
,
"AppTokenByHostsCache............. acckapp.stdout.........."
)
if
(
result
)
{
var
tmp
=
JSON
.
parse
(
result
);
return
tmp
;
}
return
system
.
getResult
(
null
,
"data is empty"
);
}
}
module
.
exports
=
AppTokenByHostsCache
;
center-order/app/base/db/cache/appUserPinByChannelUserId.js
deleted
100644 → 0
View file @
179b856a
const
CacheBase
=
require
(
"../cache.base"
);
const
system
=
require
(
"../../system"
);
const
settings
=
require
(
"../../../config/settings"
);
class
AppUserPinByChannelUserId
extends
CacheBase
{
constructor
()
{
super
();
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
}
desc
()
{
return
"应用中缓存访问token"
;
}
prefix
()
{
return
settings
.
cacheprefix
+
"_userPin:"
;
}
async
buildCacheVal
(
cachekey
,
inputkey
,
val
,
ex
,
...
items
)
{
var
acckapp
=
await
this
.
restClient
.
execPost
(
val
,
settings
.
centerAppUrl
()
+
"auth/accessAuth/loginUserByChannelUserId"
);
var
result
=
acckapp
.
stdout
;
if
(
result
)
{
var
tmp
=
JSON
.
parse
(
result
);
return
tmp
;
}
return
system
.
getResult
(
null
,
"data is empty"
);
}
}
module
.
exports
=
AppUserPinByChannelUserId
;
center-order/app/base/db/cache/appUserPinByLoginPwdCache.js
deleted
100644 → 0
View file @
179b856a
const
CacheBase
=
require
(
"../cache.base"
);
const
system
=
require
(
"../../system"
);
const
settings
=
require
(
"../../../config/settings"
);
class
AppUserPinByLoginPwdCache
extends
CacheBase
{
constructor
()
{
super
();
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
}
desc
()
{
return
"应用中缓存访问token"
;
}
prefix
()
{
return
settings
.
cacheprefix
+
"_userPin:"
;
}
async
buildCacheVal
(
cachekey
,
inputkey
,
val
,
ex
,
...
items
)
{
var
acckapp
=
await
this
.
restClient
.
execPost
(
val
,
settings
.
centerAppUrl
()
+
"auth/accessAuth/login"
);
var
result
=
acckapp
.
stdout
;
if
(
result
)
{
var
tmp
=
JSON
.
parse
(
result
);
return
tmp
;
}
return
system
.
getResult
(
null
,
"data is empty"
);
}
}
module
.
exports
=
AppUserPinByLoginPwdCache
;
center-order/app/base/db/cache/appUserPinByLoginVcodeCache.js
deleted
100644 → 0
View file @
179b856a
const
CacheBase
=
require
(
"../cache.base"
);
const
system
=
require
(
"../../system"
);
const
settings
=
require
(
"../../../config/settings"
);
class
AppUserPinByLoginVcodeCache
extends
CacheBase
{
constructor
()
{
super
();
this
.
restClient
=
system
.
getObject
(
"util.restClient"
);
}
desc
()
{
return
"应用中缓存访问token"
;
}
prefix
()
{
return
settings
.
cacheprefix
+
"_userPin:"
;
}
async
buildCacheVal
(
cachekey
,
inputkey
,
val
,
ex
,
...
items
)
{
var
acckapp
=
await
this
.
restClient
.
execPost
(
val
,
settings
.
centerAppUrl
()
+
"auth/accessAuth/loginByVerifyCode"
);
var
result
=
acckapp
.
stdout
;
if
(
result
)
{
var
tmp
=
JSON
.
parse
(
result
);
return
tmp
;
}
return
system
.
getResult
(
null
,
"data is empty"
);
}
}
module
.
exports
=
AppUserPinByLoginVcodeCache
;
center-order/app/base/db/metadata/apps/platform.js
View file @
8657e712
...
@@ -28,7 +28,7 @@ module.exports = {
...
@@ -28,7 +28,7 @@ module.exports = {
//订单类型
//订单类型
"order_type"
:
{
"zzdd"
:
"自主订单"
,
"dkxd"
:
"代客下单"
},
"order_type"
:
{
"zzdd"
:
"自主订单"
,
"dkxd"
:
"代客下单"
},
//订单付款状态
//订单付款状态
"order_status"
:
{
1
:
"待付款"
,
2
:
"已付款"
,
4
:
"
待服务
"
,
8
:
"已完成"
},
"order_status"
:
{
1
:
"待付款"
,
2
:
"已付款"
,
4
:
"
服务中
"
,
8
:
"已完成"
},
//帐户类型( 支付类型)
//帐户类型( 支付类型)
"pay_account_type"
:
{
"cash"
:
"现金"
,
"bank"
:
"银行"
,
"wx"
:
"微信"
,
"alipay"
:
"支付宝"
,
"other"
:
"其它"
},
"pay_account_type"
:
{
"cash"
:
"现金"
,
"bank"
:
"银行"
,
"wx"
:
"微信"
,
"alipay"
:
"支付宝"
,
"other"
:
"其它"
},
//订单服务付款状态
//订单服务付款状态
...
...
center-order/app/base/db/models/dbcorder/orderinfo.js
View file @
8657e712
...
@@ -7,6 +7,7 @@ module.exports = (db, DataTypes) => {
...
@@ -7,6 +7,7 @@ module.exports = (db, DataTypes) => {
orderNo
:
DataTypes
.
STRING
(
64
),
// 订单号
orderNo
:
DataTypes
.
STRING
(
64
),
// 订单号
channelServiceNo
:
DataTypes
.
STRING
(
64
),
// 渠道服务单号
channelServiceNo
:
DataTypes
.
STRING
(
64
),
// 渠道服务单号
channelOrderNo
:
DataTypes
.
STRING
(
1024
),
// 渠道订单号列表,多个以,隔开
channelOrderNo
:
DataTypes
.
STRING
(
1024
),
// 渠道订单号列表,多个以,隔开
needNo
:
DataTypes
.
STRING
(
64
),
//需求号--用于服务商或需求表中创建订单
channelUserId
:
DataTypes
.
STRING
(
64
),
// 渠道用户ID
channelUserId
:
DataTypes
.
STRING
(
64
),
// 渠道用户ID
ownerUserId
:
DataTypes
.
STRING
(
20
),
// 拥有渠道用户ID
ownerUserId
:
DataTypes
.
STRING
(
20
),
// 拥有渠道用户ID
payTime
:
DataTypes
.
DATE
,
// 渠道有支付时间则用渠道的支付时间
payTime
:
DataTypes
.
DATE
,
// 渠道有支付时间则用渠道的支付时间
...
...
center-order/app/base/db/models/dbneed/needinfo.js
View file @
8657e712
...
@@ -4,7 +4,7 @@ const uiconfig = system.getUiConfig2(settings.appKey);
...
@@ -4,7 +4,7 @@ const uiconfig = system.getUiConfig2(settings.appKey);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"needinfo"
,
{
return
db
.
define
(
"needinfo"
,
{
uapp_id
:
DataTypes
.
INTEGER
,
uapp_id
:
DataTypes
.
INTEGER
,
needNo
:
DataTypes
.
STRING
,
needNo
:
DataTypes
.
STRING
(
64
)
,
channelUserId
:
DataTypes
.
INTEGER
,
//发布者id
channelUserId
:
DataTypes
.
INTEGER
,
//发布者id
publisherName
:
DataTypes
.
STRING
,
//发布者姓名
publisherName
:
DataTypes
.
STRING
,
//发布者姓名
publisherOnlyCode
:
DataTypes
.
STRING
(
50
),
//发布者唯一码
publisherOnlyCode
:
DataTypes
.
STRING
(
50
),
//发布者唯一码
...
...
center-order/app/base/service/impl/dbcorder/orderinfoSve.js
View file @
8657e712
...
@@ -14,6 +14,7 @@ class OrderInfoService extends ServiceBase {
...
@@ -14,6 +14,7 @@ class OrderInfoService extends ServiceBase {
async
createOrder
(
pobj
,
orderNo
,
t
)
{
async
createOrder
(
pobj
,
orderNo
,
t
)
{
var
actionBody
=
pobj
.
actionBody
;
var
actionBody
=
pobj
.
actionBody
;
var
channelOrder
=
actionBody
.
channelOrder
;
var
channelOrder
=
actionBody
.
channelOrder
;
var
orderContact
=
actionBody
.
orderContact
;
var
price_item
=
actionBody
.
product_info
.
price_item
;
var
price_item
=
actionBody
.
product_info
.
price_item
;
var
totalServiceCharge
=
Number
(
price_item
.
service_charge
||
0
)
*
Number
(
actionBody
.
quantity
);
var
totalServiceCharge
=
Number
(
price_item
.
service_charge
||
0
)
*
Number
(
actionBody
.
quantity
);
var
totalPublicExpense
=
Number
(
price_item
.
public_expense
||
0
)
*
Number
(
actionBody
.
quantity
);
var
totalPublicExpense
=
Number
(
price_item
.
public_expense
||
0
)
*
Number
(
actionBody
.
quantity
);
...
@@ -27,11 +28,12 @@ class OrderInfoService extends ServiceBase {
...
@@ -27,11 +28,12 @@ class OrderInfoService extends ServiceBase {
var
params
=
{
var
params
=
{
uapp_id
:
pobj
.
appInfo
.
uapp_id
,
//int(11) //
uapp_id
:
pobj
.
appInfo
.
uapp_id
,
//int(11) //
orderNo
:
orderNo
,
//varchar(64) //订单号
orderNo
:
orderNo
,
//varchar(64) //订单号
channelServiceNo
:
channelOrder
.
channelServiceNo
||
""
,
//varchar(64) //渠道服务单号
channelServiceNo
:
channelOrder
.
channelServiceNo
||
orderNo
,
//varchar(64) //渠道服务单号
channelOrderNo
:
channelOrder
.
channelOrderNo
?
channelOrder
.
channelOrderNo
:
""
,
//varchar(1024) //渠道订单号列表,多个以,隔开
channelOrderNo
:
channelOrder
.
channelOrderNo
||
orderNo
,
//varchar(1024) //渠道订单号列表,多个以,隔开
needNo
:
channelOrder
.
needNo
||
""
,
//需求号--用于服务商或需求表中创建订单
channelUserId
:
pobj
.
userInfo
.
channel_userid
,
//varchar(64) //
channelUserId
:
pobj
.
userInfo
.
channel_userid
,
//varchar(64) //
ownerUserId
:
pobj
.
userInfo
.
channel_userid
,
//varchar(20) //
ownerUserId
:
pobj
.
userInfo
.
channel_userid
,
//varchar(20) //
payTime
:
channelOrder
.
orderStatus
&&
channelOrder
.
orderStatus
==
1
?
payTime
:
null
,
//datetime //
payTime
:
channelOrder
.
orderStatus
&&
channelOrder
.
orderStatus
==
2
?
payTime
:
null
,
//datetime //
quantity
:
actionBody
.
quantity
,
//int(11) //项目订单数量(即服务项目的倍数,默认值为1)
quantity
:
actionBody
.
quantity
,
//int(11) //项目订单数量(即服务项目的倍数,默认值为1)
serviceQuantity
:
0
,
//int(11) //项目订单交付数量(即与项目订单数量相对应)
serviceQuantity
:
0
,
//int(11) //项目订单交付数量(即与项目订单数量相对应)
orderStatus
:
channelOrder
.
orderStatus
||
1
,
//int //订单状态: 1: 待付款, 2: 已付款, 4: 待服务, 8: 已完成
orderStatus
:
channelOrder
.
orderStatus
||
1
,
//int //订单状态: 1: 待付款, 2: 已付款, 4: 待服务, 8: 已完成
...
@@ -47,7 +49,7 @@ class OrderInfoService extends ServiceBase {
...
@@ -47,7 +49,7 @@ class OrderInfoService extends ServiceBase {
totalDiscounts
:
0
,
//decimal(12,2) //优惠总额((服务费总额+官费总额)-订单总额(产品价格×优惠费率×订单件数)>0则有优惠额度)暂时没有用到
totalDiscounts
:
0
,
//decimal(12,2) //优惠总额((服务费总额+官费总额)-订单总额(产品价格×优惠费率×订单件数)>0则有优惠额度)暂时没有用到
pfSettleProfit
:
0
,
//int(11) //平台结算渠道利润,0否,1是
pfSettleProfit
:
0
,
//int(11) //平台结算渠道利润,0否,1是
invoiceApplyStatus
:
"00"
,
//varchar(10) //发票状态:00: 未申请, 10: 已申请,20:已开票
invoiceApplyStatus
:
"00"
,
//varchar(10) //发票状态:00: 未申请, 10: 已申请,20:已开票
notes
:
""
,
//varchar(255) //
notes
:
actionBody
.
notes
||
""
,
//varchar(255) //
opNotes
:
""
,
//varchar(255) //操作备注
opNotes
:
""
,
//varchar(255) //操作备注
};
};
var
order
=
await
this
.
dao
.
create
(
params
,
t
);
//创建订单
var
order
=
await
this
.
dao
.
create
(
params
,
t
);
//创建订单
...
@@ -101,11 +103,12 @@ class OrderInfoService extends ServiceBase {
...
@@ -101,11 +103,12 @@ class OrderInfoService extends ServiceBase {
var
moneyJourney
=
await
this
.
moneyJourneyDao
.
create
(
moneyObj
,
t
);
var
moneyJourney
=
await
this
.
moneyJourneyDao
.
create
(
moneyObj
,
t
);
orderReceiptVoucherObj
.
auditStatus
=
"tg"
;
orderReceiptVoucherObj
.
auditStatus
=
"tg"
;
}
}
if
(
channelOrder
.
buyerMobli
e
)
{
if
(
orderContact
&&
orderContact
.
mobil
e
)
{
var
customerContactObj
=
{
var
customerContactObj
=
{
uapp_id
:
pobj
.
appInfo
.
uapp_id
,
//int(11) //
uapp_id
:
pobj
.
appInfo
.
uapp_id
,
//int(11) //
sourceOrderNo
:
orderNo
,
//交付订单号
sourceOrderNo
:
orderNo
,
//交付订单号
mobile
:
channelOrder
.
buyerMoblie
,
//手机号
contacts
:
channelOrder
.
contacts
||
""
,
//手机号
mobile
:
channelOrder
.
mobile
,
//手机号
email
:
channelOrder
.
email
||
""
email
:
channelOrder
.
email
||
""
};
};
await
this
.
ordercontactsDao
.
create
(
customerContactObj
,
t
);
await
this
.
ordercontactsDao
.
create
(
customerContactObj
,
t
);
...
@@ -128,17 +131,100 @@ class OrderInfoService extends ServiceBase {
...
@@ -128,17 +131,100 @@ class OrderInfoService extends ServiceBase {
}
}
*/
*/
async
createTmOrder
(
pobj
)
{
async
createTmOrder
(
pobj
)
{
var
packagingTmResult
=
await
this
.
packagingTmDeliveryData
(
pobj
,
pobj
.
actionBody
);
if
(
packagingTmResult
.
status
!=
0
)
{
return
packagingTmResult
;
}
var
self
=
this
;
var
self
=
this
;
return
await
self
.
db
.
transaction
(
async
function
(
t
)
{
return
await
self
.
db
.
transaction
(
async
function
(
t
)
{
var
orderNo
=
await
self
.
getBusUid
(
"tm"
+
pobj
.
appInfo
.
uapp_id
);
var
orderNo
=
await
self
.
getBusUid
(
"tm"
+
pobj
.
appInfo
.
uapp_id
);
var
item
=
await
self
.
createOrder
(
pobj
,
orderNo
,
t
);
var
item
=
await
self
.
createOrder
(
pobj
,
orderNo
,
t
);
var
sql
=
"INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('"
+
orderNo
+
"','"
+
JSON
.
stringify
(
pobj
.
actionBody
.
deliveryData
)
+
"')"
;
self
.
customQuery
(
sql
);
return
system
.
getResultSuccess
({
return
system
.
getResultSuccess
({
orderNo
:
orderNo
,
orderNo
:
orderNo
,
channelServiceNo
:
pobj
.
actionBody
.
channelOrder
.
channelServiceNo
||
orderNo
,
channelServiceNo
:
pobj
.
actionBody
.
channelOrder
.
channelServiceNo
||
orderNo
,
channelParams
:
opobj
.
actionBody
.
channelOrder
.
channelParams
||
""
channelOrderNo
:
pobj
.
actionBody
.
channelOrder
.
channelOrderNo
||
orderNo
,
channelParams
:
pobj
.
actionBody
.
channelOrder
.
channelParams
||
""
});
});
});
});
}
async
packagingTmDeliveryData
(
pobj
,
actionBody
)
{
//重新组装商标交付信息
if
(
Object
.
keys
(
actionBody
.
deliveryData
).
length
==
0
)
{
return
system
.
getResultSuccess
();
}
if
(
Number
(
actionBody
.
totalSum
)
<
300
)
{
return
"总价有误,总价不能小于300,20140"
;
}
var
deliveryData
=
actionBody
.
deliveryData
;
if
(
!
deliveryData
.
nclones
)
{
return
"商品/服务项不能为空,20150"
;
}
if
(
!
deliveryData
.
tm
)
{
return
"商标信息不能为空,20180"
;
}
if
(
!
deliveryData
.
tm
.
tmName
)
{
return
"商标名称不能为空,20180"
;
}
if
(
!
deliveryData
.
tm
.
picUrl
)
{
return
"商标图样不能为空,20210"
;
}
if
(
!
deliveryData
.
apply
)
{
return
"申请信息不能为空,20230"
;
}
if
(
!
deliveryData
.
apply
.
code
)
{
return
"申请统一社会信用代码不能为空,20250"
;
}
if
(
!
deliveryData
.
apply
.
zipCode
)
{
return
"申请邮编不能为空,20280"
;
}
if
(
!
deliveryData
.
apply
.
customerType
)
{
return
"申请人类型不能为空,20310"
;
}
if
(
deliveryData
.
apply
.
customerType
!=
"ent"
&&
deliveryData
.
apply
.
customerType
==
"person"
)
{
return
"申请人类型错误,20330"
;
}
var
deliveryStatus
=
"dsccl"
;
var
deliveryStatusName
=
"待上传材料"
;
if
(
deliveryData
.
apply
.
customerType
==
"ent"
)
{
if
(
deliveryData
.
apply
.
businessLicensePdf
&&
deliveryData
.
apply
.
gzwtsUrl
)
{
deliveryStatus
=
"dsh"
;
deliveryStatusName
=
"待审核"
;
}
}
else
{
if
(
deliveryData
.
apply
.
businessLicensePdf
&&
deliveryData
.
apply
.
gzwtsUrl
&&
deliveryData
.
apply
.
identityCardPdf
)
{
deliveryStatus
=
"dsh"
;
deliveryStatusName
=
"待审核"
;
}
}
var
price_item
=
actionBody
.
product_info
.
price_item
;
var
self
=
this
;
var
nclList
=
[];
for
(
let
index
=
0
;
index
<
deliveryData
.
nclones
.
length
;
index
++
)
{
var
nclones
=
deliveryData
.
nclones
[
index
];
var
nclThree
=
nclones
.
nclThree
;
var
tempNclones
=
{
ncloneCode
:
nclones
.
code
,
ncloneName
:
nclones
.
name
,
nclThree
:
nclThree
,
nclCount
:
nclThree
.
length
,
nclPublicExpense
:
Number
(
price_item
.
price
)
*
nclThree
.
length
,
payStatus
:
1
,
payStatusName
:
"待付款"
,
deliveryStatus
:
deliveryStatus
,
//商标交付状态
deliveryStatusName
:
deliveryStatusName
,
submitTime
:
""
,
deliveryType
:
pobj
.
appInfo
.
delivery_type
,
//应用数据操作类型:00独立,10全委托
tbCode
:
await
self
.
getBusUid
(
"tb"
+
pobj
.
appInfo
.
uapp_id
)
//提报号(自动生成)
}
nclList
.
push
(
tempNclones
);
}
pobj
.
actionBody
.
deliveryData
.
nclList
=
nclList
;
delete
pobj
.
actionBody
.
deliveryData
[
"nclones"
];
return
system
.
getResultSuccess
();
}
}
/**
/**
* 创建其他订单
* 创建其他订单
...
@@ -152,6 +238,7 @@ class OrderInfoService extends ServiceBase {
...
@@ -152,6 +238,7 @@ class OrderInfoService extends ServiceBase {
return
system
.
getResultSuccess
({
return
system
.
getResultSuccess
({
orderNo
:
orderNo
,
orderNo
:
orderNo
,
channelServiceNo
:
pobj
.
actionBody
.
channelOrder
.
channelServiceNo
||
orderNo
,
channelServiceNo
:
pobj
.
actionBody
.
channelOrder
.
channelServiceNo
||
orderNo
,
channelOrderNo
:
pobj
.
actionBody
.
channelOrder
.
channelOrderNo
||
orderNo
,
channelParams
:
pobj
.
actionBody
.
channelOrder
.
channelParams
||
""
channelParams
:
pobj
.
actionBody
.
channelOrder
.
channelParams
||
""
});
});
});
});
...
...
center-order/app/base/service/impl/utilsSve/utilsFqAliyunSve.js
deleted
100644 → 0
View file @
179b856a
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
AppServiceBase
=
require
(
"../../app.base"
);
const
logCtl
=
system
.
getObject
(
"service.common.oplogSve"
);
const
aliyunClient
=
system
.
getObject
(
"util.aliyunClient"
);
// //aliyunClient
// this.fqReqUrl = "https://yunfuapi.gongsibao.com";//线上域名
// // this.fqReqUrl = "https://yunfuapi-dev.gongsibao.com";//dev域名
// // const client = new Client('203756805', 'crkyej0xlmqa6bmvqijun6ltxparllyn');//开发
// const client = new Client('203763771', 'e5e2ytnn6nrkr9qnqk4w5e6z0xlhkznu');//线上
class
UtilsFqAliyunSve
extends
AppServiceBase
{
constructor
()
{
super
();
}
async
pushBusinessDev
(
pobj
)
{
this
.
logCtl
.
info
({
appid
:
req
.
app
.
id
,
appkey
:
req
.
app
.
uappKey
,
requestId
:
req
.
requestId
||
""
,
op
:
"center-order/service/impl/utilsSve/utilsFqAliyunSve.js/pushBusinessDev"
,
content
:
"请求地址:"
+
reqUrl
+
",参数:"
+
JSON
.
stringify
(
body
)
+
",返回结果:"
+
JSON
.
stringify
(
rtn
),
clientIp
:
pobj
.
clientIp
,
optitle
:
"推送订单商机到FQ信息--again"
,
});
}
async
pushBusinessOnline
(
pobj
)
{
this
.
logCtl
.
info
({
appid
:
req
.
app
.
id
,
appkey
:
req
.
app
.
uappKey
,
requestId
:
req
.
requestId
||
""
,
op
:
"center-order/service/impl/utilsSve/utilsFqAliyunSve.js/pushBusinessOnline"
,
content
:
"请求地址:"
+
reqUrl
+
",参数:"
+
JSON
.
stringify
(
body
)
+
",返回结果:"
+
JSON
.
stringify
(
rtn
),
clientIp
:
pobj
.
clientIp
,
optitle
:
"推送订单商机到FQ信息--again"
,
});
}
async
opAliyunClientPost
(
pobj
)
{
try
{
}
catch
(
e
)
{
//日志记录
this
.
logCtl
.
error
({
appid
:
pobj
.
appInfo
.
uapp_id
,
appkey
:
pobj
.
appInfo
.
uappKey
,
requestId
:
req
.
requestId
||
""
,
op
:
"igirl-channel/app/base/service/impl/dborder/orderSve/againPushFqBusiness"
,
content
:
"error:"
+
e
.
stack
,
clientIp
:
pobj
.
clientIp
,
optitle
:
"推送订单商机到FQ出错--again"
,
});
}
}
// var rc = system.getObject("util.aliyunClient");
// var rtn = null;
// var reqUrl = this.fqReqUrl + "/crm/order/submit";
// var body = pobj.actionBody;
// try {
// rtn = await rc.post(reqUrl, body);
// this.logCtl.info({
// appid: req.app.id,
// appkey: req.app.uappKey,
// requestId: req.requestId || "",
// op: "igirl-channel/app/base/service/impl/dborder/orderSve/againPushFqBusiness",
// content: "请求地址:" + reqUrl + ",参数:" + JSON.stringify(body) + ",返回结果:" + JSON.stringify(rtn),
// clientIp: pobj.clientIp,
// optitle: "推送订单商机到FQ信息--again",
// });
// if (rtn.code != 200 && rtn.success != true) {
// return system.getResult(null, "推送失败,失败原因:" + rtn.errorMsg + ",selfrequestId=" + req.requestId + ",requestId=" + rtn.requestId);
// }
// return system.getResultSuccess(null, "推送成功");
// } catch (e) {
// //日志记录
// this.logCtl.error({
// appid: req.app.id,
// appkey: req.app.uappKey,
// requestId: req.requestId || "",
// op: "igirl-channel/app/base/service/impl/dborder/orderSve/againPushFqBusiness",
// content: "error:" + e.stack,
// clientIp: pobj.clientIp,
// optitle: "推送订单商机到FQ出错--again",
// });
// }
}
module
.
exports
=
UtilsFqAliyunSve
;
center-order/app/base/utils/aliyunClient.js
deleted
100644 → 0
View file @
179b856a
const
Client
=
require
(
'aliyun-api-gateway'
).
Client
;
class
aliyunClient
{
constructor
()
{
}
async
post
(
aliReqUrl
,
key
,
secret
,
actionBody
)
{
const
client
=
new
Client
(
key
,
secret
);
var
param
=
{
data
:
actionBody
,
timeout
:
20000
,
headers
:
{
accept
:
'application/json'
}
};
console
.
log
(
JSON
.
stringify
(
param
),
"______________峰擎---阿里云参数_______"
);
var
result
=
await
client
.
post
(
aliReqUrl
,
param
);
console
.
log
(
JSON
.
stringify
(
result
),
"______________峰擎---阿里云返回结果_______"
);
return
result
;
}
//阿里接口
async
reqbyget
(
obj
,
cbk
)
{
const
aliclient
=
new
RPCClient
({
accessKeyId
:
'LTAI4FmyipY1wuLHjLhMWiPa'
,
accessKeySecret
:
'hp4FF18IDCSym1prqzxrAjnnhNH3ju'
,
endpoint
:
'https://trademark.aliyuncs.com'
,
apiVersion
:
'2018-07-24'
});
var
action
=
obj
.
action
;
var
reqbody
=
obj
.
reqbody
;
return
this
.
aliclient
.
request
(
action
,
reqbody
,
{
timeout
:
3000
,
// default 3000 ms
formatAction
:
true
,
// default true, format the action to Action
formatParams
:
true
,
// default true, format the parameter name to first letter upper case
method
:
'GET'
,
// set the http method, default is GET
headers
:
{},
// set the http request headers
});
}
}
module
.
exports
=
aliyunClient
;
center-order/app/config/settings.js
View file @
8657e712
...
@@ -20,20 +20,6 @@ var settings = {
...
@@ -20,20 +20,6 @@ var settings = {
usertimeout
:
3600
,
//单位秒
usertimeout
:
3600
,
//单位秒
basepath
:
path
.
normalize
(
path
.
join
(
__dirname
,
'../..'
)),
basepath
:
path
.
normalize
(
path
.
join
(
__dirname
,
'../..'
)),
port
:
process
.
env
.
NODE_PORT
||
4011
,
port
:
process
.
env
.
NODE_PORT
||
4011
,
paasUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://p.apps.com:4001/"
;
}
else
{
return
"https://open.gongsibao.com/"
;
}
},
centerAppUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://centerapp.apps.com:4010/"
;
}
else
{
return
"http://center-app-service/"
;
}
},
reqTransferurl
:
function
()
{
reqTransferurl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.18.61:3003/"
;
return
"http://192.168.18.61:3003/"
;
...
@@ -49,20 +35,6 @@ var settings = {
...
@@ -49,20 +35,6 @@ var settings = {
return
"http://43.247.184.94:7200/"
;
return
"http://43.247.184.94:7200/"
;
}
}
},
},
reqZcApi
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://zcapi.apps.com:4002/"
;
//localsettings.reqEsDevUrl;
}
else
{
return
"http://zcapi-service/"
;
//k8s服务名称
}
},
pushFqbossDataUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.18.141:3000/"
;
//localsettings.reqEsDevUrl;
}
else
{
return
"https://fqgirl.gongsibao.com/"
;
}
},
apiconfig
:
{
apiconfig
:
{
opLogUrl
:
function
()
{
opLogUrl
:
function
()
{
return
settings
.
reqEsAddr
()
+
"bigdata_zc_op_log/_doc?pretty"
;
return
settings
.
reqEsAddr
()
+
"bigdata_zc_op_log/_doc?pretty"
;
...
@@ -71,7 +43,7 @@ var settings = {
...
@@ -71,7 +43,7 @@ var settings = {
return
1
;
return
1
;
},
},
},
},
homePage
:
function
()
{
homePage
:
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