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
cc3dbefa
Commit
cc3dbefa
authored
Dec 21, 2020
by
兰国旗
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
laolan
parent
3c9aeb12
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
354 additions
and
44 deletions
+354
-44
center-order/app/base/api/impl/action/regapi.js
+12
-12
center-order/app/base/service/impl/qcutils/regCenterOrderSve.js
+342
-32
No files found.
center-order/app/base/api/impl/action/regapi.js
View file @
cc3dbefa
...
...
@@ -31,8 +31,8 @@ class RegAPI extends APIBase {
console
.
log
(
"pobj"
,
pobj
)
var
opResult
=
null
;
switch
(
action_type
)
{
case
"re
ceiveSolutionPayInfoNew
"
:
//接收reg方案状态及支付信息(方案支付后创建订单时调用)
opResult
=
await
this
.
regCenterOrderSve
.
re
ceiveSolutionPayInfoNew
(
pobj
);
case
"re
gReceiveSolutionPayInfo
"
:
//接收reg方案状态及支付信息(方案支付后创建订单时调用)
opResult
=
await
this
.
regCenterOrderSve
.
re
gReceiveSolutionPayInfo
(
pobj
);
break
;
// case "receiveOrderStatusNotify"://接收订单状态推送 百度reg 2.3
// opResult = await this.regCenterOrderSve.receiveOrderStatusNotify(pobj);
...
...
@@ -50,20 +50,20 @@ class RegAPI extends APIBase {
opResult
=
await
this
.
regCenterOrderSve
.
submitRegNeed
(
pobj
,
pobj
.
actionBody
,
req
);
break
;
case
"
submitReg
Solution"
:
//方案提交
opResult
=
await
this
.
regCenterOrderSve
.
submitReg
Solution
(
pobj
);
case
"
regSubmit
Solution"
:
//方案提交
opResult
=
await
this
.
regCenterOrderSve
.
regSubmit
Solution
(
pobj
);
break
;
case
"
writeReg
CommunicationLog"
:
//新增沟通记录
opResult
=
await
this
.
regCenterOrderSve
.
writeReg
CommunicationLog
(
pobj
);
case
"
regWrite
CommunicationLog"
:
//新增沟通记录
opResult
=
await
this
.
regCenterOrderSve
.
regWrite
CommunicationLog
(
pobj
);
break
;
case
"
queryExpertReg
CommunicationLogs"
:
//获取沟通记录
opResult
=
await
this
.
regCenterOrderSve
.
queryExpertReg
CommunicationLogs
(
pobj
);
case
"
regQueryExpert
CommunicationLogs"
:
//获取沟通记录
opResult
=
await
this
.
regCenterOrderSve
.
regQueryExpert
CommunicationLogs
(
pobj
);
break
;
case
"
updateRegOrder
tatus"
:
//提交交付信息/修改订单状态
opResult
=
await
this
.
regCenterOrderSve
.
updateRegOrder
tatus
(
pobj
);
case
"
regUpdateOrderS
tatus"
:
//提交交付信息/修改订单状态
opResult
=
await
this
.
regCenterOrderSve
.
regUpdateOrderS
tatus
(
pobj
);
break
;
case
"
closeRegNeed
"
:
//前端关闭reg需求及方案
opResult
=
await
this
.
regCenterOrderSve
.
closeRegNeed
(
pobj
);
case
"
regNeedClose
"
:
//前端关闭reg需求及方案
opResult
=
await
this
.
regCenterOrderSve
.
regNeedClose
(
pobj
);
break
;
case
"getRegInfoByChannelNeedNo"
:
//获取需求方案列表
opResult
=
await
this
.
regCenterOrderSve
.
reqCenterOrderApi
(
pobj
);
...
...
center-order/app/base/service/impl/qcutils/regCenterOrderSve.js
View file @
cc3dbefa
...
...
@@ -13,31 +13,65 @@ class RegCenterOrderService extends ServiceBase {
//工商注册状态
this
.
regSolutionStatus
=
{
"SOLUTION_SUBMIT"
:
"提交服务单"
,
"MATERIAL_UNCONFIRM"
:
"服务商递交⽂件"
,
"REGISTRATION"
:
"完成账户注册"
,
"SUBMITTED"
:
"服务商完成提交资料到⼯信部"
,
"ACCEPTED"
:
"⼯商部已受理"
,
"NOT_ACCEPTED"
:
"⼯商部不予受理"
,
"APPROVED"
:
"⼯商部通过"
,
"NOT_APPROVED"
:
"⼯商部未通过"
,
"CLOSE"
:
"方案关闭"
'RECEIVED'
:
'已接单'
,
//
'COLLECTING'
:
'材料收集环节'
,
//
'AUDITING'
:
'工商审核环节'
,
//
'ENGRAVING'
:
'刻章环节'
,
//
'SUCCESS'
:
'已完成'
//
};
//工商注册状态
this
.
regNumberStatus
=
{
// "SOLUTION_SUBMIT": "提交服务单",
"MATERIAL_UNCONFIRM"
:
506
,
"REGISTRATION"
:
507
,
"SUBMITTED"
:
508
,
"ACCEPTED"
:
509
,
"NOT_ACCEPTED"
:
510
,
"APPROVED"
:
511
,
"NOT_APPROVED"
:
512
// "CLOSE": "方案关闭"
};
this
.
regStatus
=
{
'RECEIVED'
:
701
,
//已接单
'COLLECTING'
:
702
,
//材料收集环节
'AUDITING'
:
703
,
//工商审核环节
'ENGRAVING'
:
704
,
//刻章环节
'SUCCESS'
:
705
//已完成
}
}
//----------2.
async
submitRegNeed
(
pobj
,
actionBody
,
req
)
{
var
needNo
=
await
this
.
getBusUid
(
"n"
);
if
(
!
actionBody
.
intentionBizId
)
{
return
system
.
getResultFail
(
-
5001
,
"intentionBizId不能为空"
);
}
if
(
!
actionBody
.
mobile
)
{
return
system
.
getResultFail
(
-
5002
,
"mobile不能为空"
);
}
if
(
!
actionBody
.
type
)
{
return
system
.
getResultFail
(
-
5003
,
"type不能为空"
);
}
var
ninfo
=
await
this
.
findOne
({
channelNeedNo
:
actionBody
.
intentionBizId
});
if
(
ninfo
)
{
return
system
.
getResultSuccess
(
ninfo
);
}
var
nobj
=
{
uapp_id
:
pobj
.
appInfo
.
uapp_id
,
channelNeedNo
:
actionBody
.
intentionBizId
,
needNo
:
needNo
,
channelUserId
:
actionBody
.
mobile
,
publishName
:
actionBody
.
userName
,
publishContent
:
actionBody
.
description
,
publishMobile
:
actionBody
.
mobile
,
city
:
actionBody
.
area
,
// disposeNotes: actionBody.ext,
typeCode
:
actionBody
.
type_code
,
typeName
:
actionBody
.
type_name
,
channelTypeCode
:
actionBody
.
channel_type_code
,
channelTypeName
:
actionBody
.
channel_type_name
,
status
:
"wts"
,
level
:
actionBody
.
level
||
""
,
probability
:
actionBody
.
probability
||
""
,
notes
:
actionBody
.
notes
}
if
(
nobj
.
channelTypeCode
==
"GSREG"
)
{
nobj
.
province
=
nobj
.
city
,
nobj
.
city
=
""
;
}
var
needInfo
=
await
this
.
dao
.
create
(
nobj
);
return
system
.
getResultSuccess
(
needInfo
);
}
//添加业务员信息,用于直接下单的reg订单
async
addRegSalesmanInfo
(
pobj
)
{
...
...
@@ -215,6 +249,94 @@ class RegCenterOrderService extends ServiceBase {
return
system
.
getResultSuccess
(
ns
);
}
//接收方案状态及支付信息
async
regReceiveSolutionPayInfo
(
pobj
)
{
var
ab
=
pobj
.
actionBody
;
var
app
=
pobj
.
appInfo
;
if
(
!
app
||
!
app
.
uapp_id
)
{
return
system
.
getResultFail
(
-
100
,
"未知渠道"
);
}
if
(
!
ab
.
channelSolutionNo
)
{
return
system
.
getResultFail
(
-
101
,
"渠道方案编号不能为空"
);
}
if
(
ab
.
isDirectBuy
&&
ab
.
isDirectBuy
==
1
){
//直接下单
var
oldNs
=
await
this
.
dao
.
model
.
findOne
({
where
:
{
orderNo
:
ab
.
orderNo
},
raw
:
true
});
var
newNsObj
=
{
orderNo
:
ab
.
orderNo
,
channelSolutionNo
:
ab
.
channelSolutionNo
,
solutionNo
:
ab
.
channelSolutionNo
,
needNo
:
ab
.
bizId
,
channelNeedNo
:
ab
.
bizId
,
status
:
"ywc"
};
var
newSolutionCount
=
{
"status"
:
"PAID"
,
"bizType"
:
ab
.
product_info
&&
ab
.
product_info
.
item_code
?
ab
.
product_info
.
item_code
:
""
,
"solution"
:
{
"Area"
:
ab
.
area
||
""
,
"IcpType"
:
ab
.
consultType
,
"CompanyName"
:
ab
.
companyName
||
""
,
"CompanyAddress"
:
ab
.
area
||
""
},
"totalSum"
:
ab
.
totalSum
||
""
,
"typeCode"
:
ab
.
product_info
&&
ab
.
product_info
.
item_code
?
ab
.
product_info
.
item_code
:
""
,
"typeName"
:
ab
.
product_info
&&
ab
.
product_info
.
item_name
?
ab
.
product_info
.
item_name
:
""
,
"needStatus"
:
"3"
,
"statusName"
:
"用户支付"
,
"customerInfo"
:
{
"publishName"
:
pobj
.
userInfo
.
channel_nickname
||
""
,
"publishMobile"
:
pobj
.
userInfo
.
mobile
||
""
},
"customerRemark"
:
""
,
"needStatusName"
:
"处理中"
,
"customerMaterial"
:
{},
"solutionFlowList"
:
[
{
"status"
:
"PAID"
,
"statusName"
:
"用户支付"
,
"updated_at"
:
new
Date
()
}
]
};
newNsObj
.
solutionContent
=
JSON
.
stringify
(
newSolutionCount
);
var
ns
=
null
;
if
(
oldNs
&&
oldNs
.
id
){
ns
=
oldNs
;
}
else
{
ns
=
await
this
.
dao
.
create
(
newNsObj
);
}
var
ns2
=
await
this
.
dao
.
model
.
findOne
({
where
:
{
id
:
ns
.
id
},
raw
:
true
});
return
system
.
getResultSuccess
(
ns2
);
}
else
{
var
needsolutioninfo
=
await
this
.
dao
.
model
.
findOne
({
attributes
:[
"id"
,
"solutionContent"
,
"status"
,
"orderNo"
],
where
:
{
channelSolutionNo
:
ab
.
channelSolutionNo
,
isInvalid
:
0
},
raw
:
true
});
if
(
!
needsolutioninfo
||
!
needsolutioninfo
.
id
)
{
return
system
.
getResultFail
(
-
400
,
"未知方案"
);
}
var
solutionContent
=
needsolutioninfo
.
solutionContent
;
if
(
ab
.
orderPrice
)
{
// solutionContent = JSON.parse(solutionContent);
solutionContent
[
"totalSum"
]
=
Number
(
ab
.
orderPrice
||
"0"
);
}
// 2020 1017 lin 新增去掉status的判断,生成订单这个方案才算完成,所以没必要再判断,另一个原因网文2.3每个状态都有不同status,所以不能以来有没有status来决定方案完成情况。
// if (ab.status) {
// needsolutioninfo.status = "ywc";
// }
if
(
ab
.
orderNo
)
{
needsolutioninfo
.
orderNo
=
ab
.
orderNo
;
needsolutioninfo
.
status
=
"ywc"
;
}
needsolutioninfo
.
solutionContent
=
JSON
.
stringify
(
solutionContent
);
await
this
.
dao
.
update
(
needsolutioninfo
);
var
ns
=
await
this
.
dao
.
model
.
findOne
({
where
:
{
id
:
needsolutioninfo
.
id
},
raw
:
true
});
return
system
.
getResultSuccess
(
ns
);
}
}
...
...
@@ -375,7 +497,7 @@ class RegCenterOrderService extends ServiceBase {
// return system.getResultFail(-301, "方案状态错误,只能废弃待确认方案");
// }
var
solutionContent
=
ns
.
solutionContent
;
if
(
!
solutionContent
.
status
||
[
"MATERIAL_UNCONFIRM"
,
"
REGISTRATION
"
,
"SUBMITTED"
].
indexOf
(
solutionContent
.
status
)
<
0
)
{
if
(
!
solutionContent
.
status
||
[
"MATERIAL_UNCONFIRM"
,
"
AUDITING
"
,
"SUBMITTED"
].
indexOf
(
solutionContent
.
status
)
<
0
)
{
return
system
.
getResultFail
(
-
302
,
"方案流程状态错误,不能执行此操作"
);
}
solutionContent
.
serviceProviderNote
=
ab
.
note
;
...
...
@@ -396,7 +518,7 @@ class RegCenterOrderService extends ServiceBase {
//------------3.
//提交方案 yiwancheng
async
submitReg
Solution
(
pobj
)
{
async
regSubmit
Solution
(
pobj
)
{
console
.
log
(
"pobj++submitRegSolution++"
,
pobj
)
var
ab
=
pobj
.
actionBody
;
var
user
=
pobj
.
userInfo
;
...
...
@@ -488,10 +610,10 @@ class RegCenterOrderService extends ServiceBase {
var
solutionFlowList
=
ab
.
solutionList
[
j
].
solutionContent
.
solutionFlowList
||
[];
solutionFlowList
.
push
({
status
:
"
SOLUTION_SUBMIT"
,
statusName
:
this
.
regSolutionStatus
.
SOLUTION_SUBMIT
,
updated_at
:
new
Date
()
status
:
"
RECEIVED"
,
statusName
:
this
.
regSolutionStatus
.
RECEIVED
,
updated_at
:
new
Date
()
});
ab
.
solutionList
[
j
].
solutionContent
.
status
=
"
SOLUTION_SUBMIT
"
;
ab
.
solutionList
[
j
].
solutionContent
.
statusName
=
this
.
regSolutionStatus
.
SOLUTION_SUBMIT
;
ab
.
solutionList
[
j
].
solutionContent
.
status
=
"
RECEIVED
"
;
ab
.
solutionList
[
j
].
solutionContent
.
statusName
=
this
.
regSolutionStatus
.
RECEIVED
;
ab
.
solutionList
[
j
].
solutionContent
.
solutionFlowList
=
solutionFlowList
;
ab
.
solutionList
[
j
][
"channelNeedNo"
]
=
needinfo
.
channelNeedNo
;
// var solutionNo = await this.getBusUid("ns");//chuangjian
...
...
@@ -596,7 +718,7 @@ class RegCenterOrderService extends ServiceBase {
}
//回写沟通记录
async
writeReg
CommunicationLog
(
pobj
)
{
async
regWrite
CommunicationLog
(
pobj
)
{
console
.
log
(
'actionBody------'
,
pobj
)
// 查询需求沟通记录
pobj
.
actionBody
.
Note
=
[
"noteTime"
,
moment
().
format
(
"YYYY-MM-DD HH:mm:ss"
),
"note"
,
pobj
.
actionBody
.
note
];
...
...
@@ -660,7 +782,7 @@ class RegCenterOrderService extends ServiceBase {
}
}
//新增查询需求沟通记录
async
queryExpertReg
CommunicationLogs
(
pobj
){
async
regQueryExpert
CommunicationLogs
(
pobj
){
console
.
log
(
'query++pobj'
,
pobj
)
if
(
!
pobj
.
actionBody
.
intentionBizId
)
{
return
system
.
getResult
(
null
,
"actionBody.intentionBizId can not be empty,100493"
);
...
...
@@ -680,7 +802,7 @@ class RegCenterOrderService extends ServiceBase {
}
//根据需求查看方案列表
async
getReg
InfoByChannelNeedNo
(
pobj
)
{
async
regGet
InfoByChannelNeedNo
(
pobj
)
{
var
ab
=
pobj
.
actionBody
;
var
user
=
pobj
.
userInfo
;
if
(
!
user
||
!
user
.
id
)
{
...
...
@@ -705,8 +827,8 @@ class RegCenterOrderService extends ServiceBase {
}
//根据需求关闭reg需求/方案
async
closeRegNeed
(
pobj
)
{
console
.
log
(
"
abolishRegProgrammeByNeed
+++"
,
pobj
)
async
regNeedClose
(
pobj
)
{
console
.
log
(
"
regNeedClose
+++"
,
pobj
)
var
ab
=
pobj
.
actionBody
;
var
app
=
pobj
.
appInfo
;
if
(
!
app
||
!
app
.
uapp_id
)
{
...
...
@@ -741,8 +863,8 @@ class RegCenterOrderService extends ServiceBase {
}
var
flowStatus
=
ns
[
i
].
solutionContent
&&
ns
[
i
].
solutionContent
.
status
?
ns
[
i
].
solutionContent
.
status
:
""
;
if
(
flowStatus
&&
[
"
GXB_REFUSE"
,
"
CLOSE"
].
indexOf
(
flowStatus
)
<
0
)
{
return
system
.
getResultFail
(
-
104
,
"⽅案状态为关闭
或不予受理
才可关闭需求"
);
if
(
flowStatus
&&
[
"CLOSE"
].
indexOf
(
flowStatus
)
<
0
)
{
return
system
.
getResultFail
(
-
104
,
"⽅案状态为关闭才可关闭需求"
);
}
var
self
=
this
await
this
.
needsolutionDao
.
db
.
transaction
(
async
function
(
t
)
{
...
...
@@ -760,5 +882,193 @@ class RegCenterOrderService extends ServiceBase {
}
return
system
.
getResultSuccess
(
ns
);
}
//交付商通知状态变更
async
regUpdateOrderStatus
(
pobj
)
{
var
ab
=
pobj
.
actionBody
;
if
(
!
ab
.
orderNo
)
{
return
system
.
getResultFail
(
-
101
,
"订单号不能为空"
);
}
if
(
!
ab
.
status
)
{
return
system
.
getResultFail
(
-
102
,
"交付状态不能为空"
);
}
else
{
ab
[
"ApplicationStatus"
]
=
ab
.
status
;
}
if
(
ab
.
officialFileURL
)
{
ab
[
"OfficialFileURL"
]
=
ab
.
officialFileURL
;
}
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
orderNo
:
ab
.
orderNo
},
raw
:
true
});
if
(
!
ns
||
!
ns
.
id
)
{
return
system
.
getResultFail
(
-
301
,
"未知方案"
);
}
ab
[
"bizId"
]
=
ns
.
channelSolutionNo
;
ab
[
"solutionNo"
]
=
ns
.
solutionNo
;
pobj
.
actionBody
=
ab
;
return
this
.
regAcceptPartnerNotification
(
pobj
);
}
//服务商通知状态变更
async
regAcceptPartnerNotification
(
pobj
)
{
console
.
log
(
'服务商通知状态变更pobj++++'
,
pobj
)
var
ab
=
pobj
.
actionBody
;
var
user
=
pobj
.
userInfo
;
if
(
!
user
||
!
user
.
id
)
{
return
system
.
getResultFail
(
-
100
,
"未知用户"
);
}
if
(
!
ab
.
solutionNo
)
{
return
system
.
getResultFail
(
-
101
,
"方案编号不能为空"
);
}
if
(
!
ab
.
ApplicationStatus
)
{
return
system
.
getResultFail
(
-
102
,
"通知状态不能为空"
);
}
//获取方案信息
var
needsolutioninfo
=
await
this
.
needsolutionDao
.
model
.
findOne
({
attributes
:
[
"id"
,
"status"
,
"solutionContent"
,
"needNo"
],
where
:
{
solutionNo
:
ab
.
solutionNo
},
raw
:
true
});
if
(
!
needsolutioninfo
||
!
needsolutioninfo
.
id
)
{
return
system
.
getResultFail
(
-
400
,
"未知方案"
);
}
if
(
!
needsolutioninfo
.
needNo
)
{
return
system
.
getResultFail
(
-
401
,
"方案需求信息有误"
);
}
//获取jiaofu信息
let
orderdeliverySqlData
=
{
sourceOrderNo
:
ab
.
orderNo
}
let
orderdeliverySql
=
"SELECT * FROM `c_order_delivery` WHERE sourceOrderNo = :sourceOrderNo ORDER BY id DESC limit 1"
;
let
orderdeliveryInfo
=
await
this
.
orderdeliveryDao
.
customQuery
(
orderdeliverySql
,
orderdeliverySqlData
)
var
solutionFlowList
=
[];
var
deliveryContent
;
if
(
orderdeliveryInfo
[
0
]
&&
orderdeliveryInfo
[
0
].
deliveryContent
){
deliveryContent
=
orderdeliveryInfo
[
0
].
deliveryContent
;
if
(
deliveryContent
&&
deliveryContent
.
status
&&
deliveryContent
.
ApplicationStatus
&&
deliveryContent
.
solutionFlowList
){
if
(
this
.
regStatus
[
deliveryContent
.
status
]
&&
this
.
regStatus
[
deliveryContent
.
status
]
>
ab
.
ApplicationStatus
)
{
return
system
.
getResultFail
(
-
403
,
"操作失败,交付流程未按顺序执行"
);
}
if
(
this
.
regStatus
[
deliveryContent
.
ApplicationStatus
]
&&
this
.
regStatus
[
deliveryContent
.
ApplicationStatus
]
==
ab
.
ApplicationStatus
)
{
return
system
.
getResultFail
(
-
405
,
"操作失败,该流程状态已提交,不能重复提交"
);
}
solutionFlowList
=
deliveryContent
.
solutionFlowList
||
[];
}
}
else
{
var
deliveryContent
=
needsolutioninfo
.
solutionContent
;
solutionFlowList
=
needsolutioninfo
.
solutionContent
.
solutionFlowList
}
// console.log('reg +++ deliveryContent+++',deliveryContent)
// if (!deliveryContent) {
// return system.getResultFail(-402, "方案交付信息有误");
// }
// if(needsolutioninfo){
// if (this.regStatus[needsolutioninfo.solutionContent.status] && this.regStatus[needsolutioninfo.solutionContent.status] > ab.ApplicationStatus) {
// return system.getResultFail(-403, "操作失败,交付流程未按顺序执行");
// }
// if (this.regStatus[needsolutioninfo.solutionContent.ApplicationStatus] && this.regStatus[needsolutioninfo.solutionContent.ApplicationStatus] == ab.ApplicationStatus) {
// return system.getResultFail(-405, "操作失败,该流程状态已提交,不能重复提交");
// }
// var solutionFlowList = needsolutioninfo.solutionContent.solutionFlowList || [];
// }
var
orderInfo
=
await
this
.
orderinfoDao
.
model
.
findOne
({
attributes
:[
"uapp_id"
,
"channelOrderNo"
],
where
:
{
orderNo
:
ab
.
orderNo
},
raw
:
true
})
console
.
log
(
"orderInfo+++"
,
orderInfo
)
if
(
orderInfo
){
var
uappId
=
orderInfo
.
uapp_id
;
var
channelOrderNo
=
orderInfo
.
channelOrderNo
}
if
(
ab
.
ApplicationStatus
==
702
)
{
//材料收集环节
if
(
needsolutioninfo
.
solutionContent
.
status
!=
"RECEIVED"
)
{
return
system
.
getResultFail
(
-
702
,
"交付流程错误,请先完成账户注册"
);
}
deliveryContent
[
'ApplicationStatus'
]
=
702
;
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"COLLECTING"
,
statusName
:
this
.
regSolutionStatus
.
COLLECTING
,
updated_at
:
new
Date
()
});
deliveryContent
.
status
=
"COLLECTING"
;
deliveryContent
.
statusName
=
this
.
regSolutionStatus
.
COLLECTING
;
}
if
(
ab
.
ApplicationStatus
==
703
)
{
//工商审核环节
if
(
deliveryContent
.
status
!=
"COLLECTING"
)
{
return
system
.
getResultFail
(
-
703
,
"交付流程错误,请先完成账户注册"
);
}
deliveryContent
[
'ApplicationStatus'
]
=
703
;
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"AUDITING"
,
statusName
:
this
.
regSolutionStatus
.
AUDITING
,
updated_at
:
new
Date
()
});
deliveryContent
.
status
=
"AUDITING"
;
deliveryContent
.
statusName
=
this
.
regSolutionStatus
.
AUDITING
;
}
if
(
ab
.
ApplicationStatus
==
704
)
{
//刻章环节
if
(
deliveryContent
.
status
!=
"AUDITING"
)
{
return
system
.
getResultFail
(
-
704
,
"交付流程错误,请先完成资料递交"
);
}
deliveryContent
[
'ApplicationStatus'
]
=
704
;
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"ENGRAVING"
,
statusName
:
this
.
regSolutionStatus
.
ENGRAVING
,
updated_at
:
new
Date
()
});
deliveryContent
.
status
=
"ENGRAVING"
;
deliveryContent
.
statusName
=
this
.
regSolutionStatus
.
ENGRAVING
;
}
if
(
ab
.
ApplicationStatus
==
705
)
{
//已完成
if
(
deliveryContent
.
status
!=
"ENGRAVING"
)
{
return
system
.
getResultFail
(
-
705
,
"交付流程错误,请先完成资料递交"
);
}
deliveryContent
[
'ApplicationStatus'
]
=
705
;
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"SUCCESS"
,
statusName
:
this
.
regSolutionStatus
.
SUCCESS
,
updated_at
:
new
Date
()
});
deliveryContent
.
status
=
"SUCCESS"
;
needsolutioninfo
.
status
=
"ywc"
;
deliveryContent
.
statusName
=
this
.
regSolutionStatus
.
SUCCESS
;
}
deliveryContent
.
solutionFlowList
=
solutionFlowList
;
var
applicationStatusList
=
deliveryContent
.
applicationStatusList
||
[];
var
statusObj
=
{
"OfficialFileURL"
:
ab
.
OfficialFileURL
||
""
,
"ApplicationStatus"
:
ab
.
ApplicationStatus
,
"ApplicationStatusName"
:
this
.
regSolutionStatus
[
ab
.
ApplicationStatus
],
"created_at"
:
new
Date
()
};
applicationStatusList
.
push
(
statusObj
);
deliveryContent
.
applicationStatusList
=
applicationStatusList
;
deliveryContent
[
"applicationStatus"
]
=
ab
.
applicationStatus
;
deliveryContent
=
JSON
.
stringify
(
deliveryContent
);
let
orderdeliveryData
=
{
sourceOrderNo
:
ab
.
orderNo
,
deliveryContent
:
deliveryContent
,
}
if
(
!
orderdeliveryInfo
[
0
]){
let
sql
=
"INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUES (:sourceOrderNo,:deliveryContent)"
;
var
orderdelivery
=
await
this
.
orderdeliveryDao
.
customInsert
(
sql
,
orderdeliveryData
);
}
else
{
let
sql
=
"UPDATE `c_order_delivery` SET deliveryContent ='"
+
deliveryContent
+
"' where sourceOrderNo='"
+
ab
.
orderNo
+
"'"
;
var
orderdelivery
=
await
this
.
orderdeliveryDao
.
customInsert
(
sql
);
}
let
orderdeliveryQuery
=
"SELECT * from `c_order_delivery` where sourceOrderNo='"
+
ab
.
orderNo
+
"'"
;
let
QueryDatas
=
{
sourceOrderNo
:
ab
.
orderNo
}
orderdelivery
=
await
this
.
orderdeliveryDao
.
customQuery
(
orderdeliveryQuery
,
QueryDatas
)
console
.
log
(
'orderdelivery++orderdelivery++++++'
,
orderdelivery
)
if
(
orderdelivery
){
orderdelivery
=
orderdelivery
[
0
]
orderdelivery
[
"bizId"
]
=
ab
.
bizId
;
orderdelivery
[
'uapp_id'
]
=
uappId
;
orderdelivery
[
'channelOrderNo'
]
=
channelOrderNo
;
}
console
.
log
(
'orderdelivery++'
,
orderdelivery
)
return
system
.
getResultSuccess
(
orderdelivery
);
}
}
module
.
exports
=
RegCenterOrderService
;
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