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
07770a33
Commit
07770a33
authored
Jul 19, 2021
by
linboxuan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'center-order' of
http://gitlab.gongsibao.com/jiangyong/zhichan
into center-order
parents
18646194
66665bd0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
716 additions
and
495 deletions
+716
-495
center-order/app/base/service/impl/dbcorder/orderinfoSve.js
+6
-7
center-order/app/base/service/impl/qcutils/regCenterOrderSve.js
+693
-484
center-order/app/base/utils/execClient.js
+17
-4
No files found.
center-order/app/base/service/impl/dbcorder/orderinfoSve.js
View file @
07770a33
...
...
@@ -1761,6 +1761,12 @@ class OrderInfoService extends ServiceBase {
}
//增加流程状态列表数据
try
{
//商标状态推送 360
if
(
orderItem
.
uapp_id
==
50
)
{
actionBody
.
deliveryInfo
=
deliveryInfo
;
this
.
push360Sve
.
pushTmStatus
(
actionBody
);
this
.
push360Sve
.
sendMessage
(
actionBody
)
}
await
self
.
db
.
transaction
(
async
function
(
t
)
{
if
(
Object
.
keys
(
updateOrderFields
).
length
>
0
)
{
self
.
updateByWhere
(
updateOrderFields
,
{
where
:
{
orderNo
:
actionBody
.
orderNo
}},
t
);
...
...
@@ -1778,13 +1784,6 @@ class OrderInfoService extends ServiceBase {
}
//更新商标官文
deliveryInfo
.
opNotes
=
actionBody
.
opNotes
||
""
;
this
.
putOrderDelivery
(
deliveryInfo
,
actionBody
.
orderNo
);
//商标状态推送 360
if
(
orderItem
.
uapp_id
==
50
)
{
actionBody
.
deliveryInfo
=
deliveryInfo
;
this
.
push360Sve
.
pushTmStatus
(
actionBody
);
this
.
push360Sve
.
sendMessage
(
actionBody
)
}
}
catch
(
error
)
{
console
.
log
(
"error------------------------"
,
e
.
stack
);
}
...
...
center-order/app/base/service/impl/qcutils/regCenterOrderSve.js
View file @
07770a33
//工商注册
const
system
=
require
(
"../../../system"
);
const
moment
=
require
(
'moment'
);
class
RegCenterOrderService
{
class
RegCenterOrderService
{
constructor
()
{
this
.
needsolutionDao
=
system
.
getObject
(
"db.dbneed.needsolutionDao"
);
this
.
needinfoDao
=
system
.
getObject
(
"db.dbneed.needinfoDao"
);
this
.
orderinfoDao
=
system
.
getObject
(
"db.dbcorder.orderinfoDao"
);
this
.
orderdeliveryDao
=
system
.
getObject
(
"db.dbcorder.orderdeliveryDao"
);
this
.
db
=
system
.
getObject
(
"db.common.connection"
).
getCon
()
//工商注册状态
this
.
regSolutionStatus
=
{
'RECEIVED'
:
'已接单'
,
'COLLECTING'
:
'材料收集环节'
,
'AUDITING'
:
'工商审核环节'
,
'ENGRAVING'
:
'刻章环节'
,
'SUCCESS'
:
'已完成'
,
'PAID'
:
'已支付'
,
"CLOSE"
:
"已关闭"
,
'ACTIVE'
:
'服务中'
'SUCCESS'
:
'已完成'
,
'PAID'
:
'已支付'
,
"CLOSE"
:
"已关闭"
,
'ACTIVE'
:
'服务中'
};
//工商注册状态
...
...
@@ -30,14 +30,32 @@ class RegCenterOrderService{
'SUCCESS'
:
705
,
//已完成
'ACTIVE'
:
706
//服务中
}
this
.
regDeliveryStatus
=
{
701
:
'RECEIVED'
,
//已接单
702
:
'COLLECTING'
,
//材料收集环节
703
:
'AUDITING'
,
//工商审核环节
704
:
'ENGRAVING'
,
//刻章环节
705
:
'SUCCESS'
,
//已完成
706
:
'ACTIVE'
//服务中
}
this
.
regDeliveryStatusName
=
{
701
:
'已接单'
,
702
:
'材料收集环节'
,
703
:
'工商审核环节'
,
704
:
'刻章环节'
,
705
:
'已完成'
,
706
:
'服务中'
}
}
// 获取需求详情
async
selectNeedInfo
(
pobj
){
// 获取需求详情
async
selectNeedInfo
(
pobj
)
{
pobj
.
actionType
=
"selectNeedInfo"
var
needinfo
=
{}
if
(
pobj
.
actionBody
.
orderNo
)
{
var
orderinfo
=
await
this
.
orderinfoDao
.
findOne
({
channelOrderNo
:
pobj
.
actionBody
.
orderNo
,
deleted_at
:
null
});
if
(
pobj
.
actionBody
.
orderNo
)
{
var
orderinfo
=
await
this
.
orderinfoDao
.
findOne
({
channelOrderNo
:
pobj
.
actionBody
.
orderNo
,
deleted_at
:
null
});
if
(
!
orderinfo
||
!
orderinfo
.
orderNo
)
{
return
system
.
getResult
(
null
,
"订单数据为空,30210"
);
}
...
...
@@ -53,12 +71,12 @@ class RegCenterOrderService{
needinfo
[
'solutionContent'
]
=
needsolution
.
solutionContent
}
}
if
(
pobj
.
actionBody
.
channelNeedNo
){
needinfo
=
await
this
.
needinfoDao
.
findOne
({
channelNeedNo
:
pobj
.
actionBody
.
channelNeedNo
});
if
(
!
needinfo
||
!
needinfo
.
channelNeedNo
)
{
return
system
.
getResult
(
null
,
"需求数据为空,30213"
);
if
(
pobj
.
actionBody
.
channelNeedNo
)
{
needinfo
=
await
this
.
needinfoDao
.
findOne
({
channelNeedNo
:
pobj
.
actionBody
.
channelNeedNo
});
if
(
!
needinfo
||
!
needinfo
.
channelNeedNo
)
{
return
system
.
getResult
(
null
,
"需求数据为空,30213"
);
}
}
}
return
system
.
getResultSuccess
(
needinfo
);
}
...
...
@@ -75,7 +93,7 @@ class RegCenterOrderService{
return
system
.
getResultFail
(
-
5003
,
"type不能为空"
);
}
var
needInfo
=
await
this
.
needinfoDao
.
findOne
({
channelNeedNo
:
actionBody
.
intentionBizId
});
console
.
log
(
'needInfo---'
,
needInfo
)
console
.
log
(
'needInfo---'
,
needInfo
)
if
(
needInfo
)
{
return
system
.
getResultSuccess
(
needInfo
);
}
...
...
@@ -108,21 +126,21 @@ class RegCenterOrderService{
}
//根据渠道订单获取方案信息
async
getSolutionByChannelOrderNo
(
pobj
){
async
getSolutionByChannelOrderNo
(
pobj
)
{
var
orderinfo
=
await
this
.
orderinfoDao
.
findOne
({
channelOrderNo
:
pobj
.
actionBody
.
orderNo
});
if
(
!
orderinfo
||
!
orderinfo
.
orderNo
)
{
return
system
.
getResult
(
null
,
"订单数据为空,30210"
);
}
var
item
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
orderNo
:
orderinfo
.
orderNo
}
where
:
{
orderNo
:
orderinfo
.
orderNo
}
});
if
(
!
item
)
{
return
system
.
getResult
(
null
,
"方案数据为空,30210"
);
}
return
system
.
getResultSuccess
(
item
);
}
//接收reg用户方案反馈
async
regFeedbackSubmit
(
pobj
)
{
//接收reg用户方案反馈
async
regFeedbackSubmit
(
pobj
)
{
var
ab
=
pobj
.
actionBody
;
if
(
!
ab
.
intentionBizId
)
{
return
system
.
getResultFail
(
-
101
,
"渠道需求编号错误"
);
...
...
@@ -137,7 +155,7 @@ class RegCenterOrderService{
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
where
:
{
channelNeedNo
:
ab
.
intentionBizId
},
raw
:
true
});
console
.
log
(
'needinfo-----reg---'
,
needinfo
)
console
.
log
(
'needinfo-----reg---'
,
needinfo
)
if
(
!
needinfo
)
{
return
system
.
getResultFail
(
-
104
,
"未知方案需求"
);
}
...
...
@@ -154,49 +172,50 @@ class RegCenterOrderService{
var
solutionContent
;
var
i
;
var
nsLength
var
needData
=
{
id
:
needinfo
.
id
};
if
(
ab
.
intentionStatus
)
{
if
(
ab
.
intentionStatus
==
5
)
{
var
needData
=
{
id
:
needinfo
.
id
};
if
(
ab
.
intentionStatus
)
{
if
(
ab
.
intentionStatus
==
5
)
{
needData
[
'status'
]
=
'ygb'
needData
[
'statusName'
]
=
'已关闭'
}
if
(
ab
.
intentionStatus
==
1
)
{
if
(
ab
.
intentionStatus
==
1
)
{
needData
[
"status"
]
=
"ygb"
;
needData
[
'statusName'
]
=
'已关闭'
}
if
(
ns
.
length
<
1
)
{
//如果没有方案直接关闭需求,更新需求状态
if
(
ns
.
length
<
1
)
{
//如果没有方案直接关闭需求,更新需求状态
await
this
.
needinfoDao
.
update
(
needData
);
//更新状态修改
}
}
else
{
nsLength
=
ns
.
length
for
(
i
=
0
;
i
<
nsLength
;
i
++
){
updateObj
=
{
id
:
ns
[
i
].
id
};
solutionContent
=
ns
[
i
].
solutionContent
;
solutionContent
.
customerRemark
=
ab
.
description
;
solutionContent
.
needStatus
=
ab
.
intentionStatus
;
if
(
ab
.
intentionStatus
==
1
)
{
updateObj
[
"status"
]
=
"ybh"
;
updateObj
[
"isInvalid"
]
=
1
;
}
else
if
(
ab
.
intentionStatus
==
2
)
{
updateObj
[
"status"
]
=
"dqr"
;
}
else
if
(
ab
.
intentionStatus
==
3
)
{
updateObj
[
"status"
]
=
"dqr"
;
}
else
if
(
ab
.
intentionStatus
==
4
)
{
updateObj
[
"status"
]
=
"dqr"
;
}
else
if
(
ab
.
intentionStatus
==
5
)
{
updateObj
[
"status"
]
=
"yzf"
;
updateObj
[
"isInvalid"
]
=
1
;
}
else
{
return
system
.
getResultFail
(
-
107
,
"需求当前状态错误--"
+
ab
.
intentionStatus
);
else
{
nsLength
=
ns
.
length
for
(
i
=
0
;
i
<
nsLength
;
i
++
)
{
updateObj
=
{
id
:
ns
[
i
].
id
};
solutionContent
=
ns
[
i
].
solutionContent
;
solutionContent
.
customerRemark
=
ab
.
description
;
solutionContent
.
needStatus
=
ab
.
intentionStatus
;
if
(
ab
.
intentionStatus
==
1
)
{
updateObj
[
"status"
]
=
"ybh"
;
updateObj
[
"isInvalid"
]
=
1
;
}
else
if
(
ab
.
intentionStatus
==
2
)
{
updateObj
[
"status"
]
=
"dqr"
;
}
else
if
(
ab
.
intentionStatus
==
3
)
{
updateObj
[
"status"
]
=
"dqr"
;
}
else
if
(
ab
.
intentionStatus
==
4
)
{
updateObj
[
"status"
]
=
"dqr"
;
}
else
if
(
ab
.
intentionStatus
==
5
)
{
updateObj
[
"status"
]
=
"yzf"
;
updateObj
[
"isInvalid"
]
=
1
;
}
else
{
return
system
.
getResultFail
(
-
107
,
"需求当前状态错误--"
+
ab
.
intentionStatus
);
}
solutionContent
.
needStatusName
=
intentionStatusList
[
ab
.
intentionStatus
];
solutionContent
=
JSON
.
stringify
(
solutionContent
);
updateObj
[
"solutionContent"
]
=
solutionContent
;
await
this
.
needsolutionDao
.
update
(
updateObj
);
//方案状态修改
await
this
.
needinfoDao
.
update
(
needData
);
//更新状态修改
}
solutionContent
.
needStatusName
=
intentionStatusList
[
ab
.
intentionStatus
];
solutionContent
=
JSON
.
stringify
(
solutionContent
);
updateObj
[
"solutionContent"
]
=
solutionContent
;
await
this
.
needsolutionDao
.
update
(
updateObj
);
//方案状态修改
await
this
.
needinfoDao
.
update
(
needData
);
//更新状态修改
}
}
return
system
.
getResultSuccess
();
...
...
@@ -224,20 +243,20 @@ class RegCenterOrderService{
//渠道方案号获取需求详情
async
getItemByChannelSolutionNo
(
pobj
)
{
console
.
log
(
'getItemByChannelSolutionNo---'
,
pobj
)
console
.
log
(
'getItemByChannelSolutionNo---'
,
pobj
)
var
solutionitem
=
{}
var
orderinfo
=
{}
var
item
=
{}
if
(
pobj
.
actionBody
.
channelSolutionId
)
{
solutionitem
=
await
this
.
needsolutionDao
.
findOne
({
channelSolutionNo
:
pobj
.
actionBody
.
channelSolutionId
});
console
.
log
(
'solutionitem---'
,
solutionitem
)
if
(
pobj
.
actionBody
.
channelSolutionId
)
{
solutionitem
=
await
this
.
needsolutionDao
.
findOne
({
channelSolutionNo
:
pobj
.
actionBody
.
channelSolutionId
});
console
.
log
(
'solutionitem---'
,
solutionitem
)
if
(
!
solutionitem
)
{
return
system
.
getResult
(
null
,
"方案数据为空,30210"
);
}
}
if
(
pobj
.
actionBody
.
orderNo
)
{
if
(
pobj
.
actionBody
.
orderNo
)
{
orderinfo
=
await
this
.
orderinfoDao
.
findOne
({
channelOrderNo
:
pobj
.
actionBody
.
orderNo
});
if
(
orderinfo
)
{
if
(
orderinfo
)
{
solutionitem
=
await
this
.
needsolutionDao
.
findOne
({
orderNo
:
orderinfo
.
orderNo
});
}
}
...
...
@@ -245,19 +264,19 @@ class RegCenterOrderService{
if
(
!
item
&&
!
solutionitem
)
{
return
system
.
getResult
(
null
,
"需求或者方案不存在,30211"
);
}
if
(
!
item
)
{
if
(
!
item
)
{
item
=
{}
item
[
'publishMobile'
]
=
solutionitem
.
solutionContent
.
customerInfo
.
publishMobile
item
[
'publishMobile'
]
=
solutionitem
.
solutionContent
.
customerInfo
.
publishMobile
item
[
'solutionProvince'
]
=
solutionitem
.
solutionContent
.
solution
.
area
;
item
[
'solutionContent'
]
=
solutionitem
.
solutionContent
item
[
'channelSolutionNo'
]
=
solutionitem
.
channelSolutionNo
}
else
{
}
else
{
item
.
solutionProvince
=
solutionitem
.
solutionContent
.
solution
.
area
;
item
.
solutionContent
=
solutionitem
.
solutionContent
item
.
channelSolutionNo
=
solutionitem
.
channelSolutionNo
}
return
system
.
getResultSuccess
(
item
);
}
...
...
@@ -291,8 +310,8 @@ class RegCenterOrderService{
}
var
solutionContent
=
ns
.
solutionContent
;
var
checkStatus
=
{
COLLECTING
:
"材料收集环节"
,
AUDITING
:
"工商审核环节"
,
ACTIVE
:
"服务中"
,
ENGRAVING
:
"刻章环节"
,
SUCCESS
:
"已完成"
,
CLOSE
:
"方案关闭"
COLLECTING
:
"材料收集环节"
,
AUDITING
:
"工商审核环节"
,
ACTIVE
:
"服务中"
,
ENGRAVING
:
"刻章环节"
,
SUCCESS
:
"已完成"
,
CLOSE
:
"方案关闭"
};
if
(
solutionContent
.
status
&&
checkStatus
[
solutionContent
.
status
])
{
return
system
.
getResultFail
(
-
111
,
"方案已进入"
+
solutionContent
.
statusName
+
"流程,不能执行此操作"
);
...
...
@@ -301,7 +320,7 @@ class RegCenterOrderService{
var
solutionFlowList
=
solutionContent
.
solutionFlowList
||
[];
if
(
ab
.
status
==
"1"
)
{
//⽤户已支付
var
afterStatusList
=
[
//用户支付后的流程状态
"COLLECTING"
,
"AUDITING"
,
"ENGRAVING"
,
"SUCCESS"
"COLLECTING"
,
"AUDITING"
,
"ENGRAVING"
,
"SUCCESS"
];
if
(
!
solutionContent
.
status
||
afterStatusList
.
indexOf
(
solutionContent
.
status
)
<
0
)
{
solutionFlowList
.
push
({
...
...
@@ -339,7 +358,7 @@ class RegCenterOrderService{
});
solutionContent
.
status
=
"CLOSE"
;
solutionContent
.
statusName
=
this
.
regSolutionStatus
.
CLOSE
;
}
else
{
}
else
{
return
system
.
getResultFail
(
-
110
,
"状态错误-5"
);
}
solutionContent
.
solutionFlowList
=
solutionFlowList
;
...
...
@@ -387,9 +406,9 @@ class RegCenterOrderService{
});
return
system
.
getResultSuccess
(
new_ns
);
}
//接收方案状态及支付信息
async
regReceiveSolutionPayInfo
(
pobj
)
{
//接收方案状态及支付信息
async
regReceiveSolutionPayInfo
(
pobj
)
{
var
ab
=
pobj
.
actionBody
;
var
app
=
pobj
.
appInfo
;
if
(
!
app
||
!
app
.
uapp_id
)
{
...
...
@@ -398,55 +417,55 @@ class RegCenterOrderService{
if
(
!
ab
.
channelSolutionNo
)
{
return
system
.
getResultFail
(
-
101
,
"渠道方案编号不能为空"
);
}
if
(
ab
.
isDirectBuy
&&
ab
.
isDirectBuy
==
1
)
{
//直接下单
if
(
ab
.
isDirectBuy
&&
ab
.
isDirectBuy
==
1
)
{
//直接下单
var
oldNs
=
await
this
.
orderinfoDao
.
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
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
:
""
,
"companyName"
:
ab
.
companyName
||
""
,
"engagedIndustry"
:
ab
.
engagedIndustry
||
""
,
"bizScope"
:
ab
.
bizScope
||
""
,
"hasAddress"
:
ab
.
hasAddress
||
""
,
"solution"
:
{
// companyName:公司名称
// engagedIndustry:从事行业
// bizScope:经营范围
// hasAddress:是否自有地址,布尔值
companyName
:
ab
.
companyName
||
""
,
engagedIndustry
:
ab
.
engagedIndustry
||
""
,
bizScope
:
ab
.
bizScope
||
""
,
hasAddress
:
ab
.
hasAddress
||
""
,
area
:
ab
.
area
||
""
,
price
:
ab
.
orderPrice
||
""
,
regType
:
ab
.
consultType
||
""
,
taxpayerType
:
ab
.
taxpayerType
||
""
,
companyProperties
:
ab
.
companyProperties
||
""
},
"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"
:
ab
.
description
||
""
,
"needStatusName"
:
"处理中"
,
"customerMaterial"
:
{},
"solutionFlowList"
:
[
{
"status"
:
"PAID"
,
"statusName"
:
"用户支付"
,
"updated_at"
:
new
Date
()
}
]
"status"
:
"PAID"
,
"bizType"
:
ab
.
product_info
&&
ab
.
product_info
.
item_code
?
ab
.
product_info
.
item_code
:
""
,
"companyName"
:
ab
.
companyName
||
""
,
"engagedIndustry"
:
ab
.
engagedIndustry
||
""
,
"bizScope"
:
ab
.
bizScope
||
""
,
"hasAddress"
:
ab
.
hasAddress
||
""
,
"solution"
:
{
// companyName:公司名称
// engagedIndustry:从事行业
// bizScope:经营范围
// hasAddress:是否自有地址,布尔值
companyName
:
ab
.
companyName
||
""
,
engagedIndustry
:
ab
.
engagedIndustry
||
""
,
bizScope
:
ab
.
bizScope
||
""
,
hasAddress
:
ab
.
hasAddress
||
""
,
area
:
ab
.
area
||
""
,
price
:
ab
.
orderPrice
||
""
,
regType
:
ab
.
consultType
||
""
,
taxpayerType
:
ab
.
taxpayerType
||
""
,
companyProperties
:
ab
.
companyProperties
||
""
},
"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"
:
ab
.
description
||
""
,
"needStatusName"
:
"处理中"
,
"customerMaterial"
:
{},
"solutionFlowList"
:
[
{
"status"
:
"PAID"
,
"statusName"
:
"用户支付"
,
"updated_at"
:
new
Date
()
}
]
};
newNsObj
.
solutionContent
=
JSON
.
stringify
(
newSolutionCount
);
var
ns
=
null
;
...
...
@@ -454,16 +473,16 @@ class RegCenterOrderService{
// ns = oldNs;
// console.log('ddddddd---ns=====',ns)
// }else{
ns
=
await
this
.
needsolutionDao
.
create
(
newNsObj
);
ns
=
await
this
.
needsolutionDao
.
create
(
newNsObj
);
// }
var
ns2
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
id
:
ns
.
id
},
raw
:
true
});
return
system
.
getResultSuccess
(
ns2
);
}
else
{
}
else
{
var
needsolutioninfo
=
await
this
.
needsolutionDao
.
model
.
findOne
({
attributes
:
[
"id"
,
"solutionContent"
,
"status"
,
"orderNo"
],
where
:
{
channelSolutionNo
:
ab
.
channelSolutionId
,
isInvalid
:
0
},
raw
:
true
attributes
:
[
"id"
,
"solutionContent"
,
"status"
,
"orderNo"
],
where
:
{
channelSolutionNo
:
ab
.
channelSolutionId
,
isInvalid
:
0
},
raw
:
true
});
if
(
!
needsolutioninfo
||
!
needsolutioninfo
.
id
)
{
return
system
.
getResultFail
(
-
400
,
"未知方案"
);
...
...
@@ -484,7 +503,7 @@ class RegCenterOrderService{
});
return
system
.
getResultSuccess
(
ns
);
}
}
/*
...
...
@@ -531,13 +550,13 @@ class RegCenterOrderService{
//关闭订单
async
regOrderClose
(
pobj
)
{
async
regOrderClose
(
pobj
)
{
var
ab
=
pobj
.
actionBody
;
if
(
!
ab
.
orderNo
)
{
return
system
.
getResultFail
(
-
101
,
"渠道订单号不能为空"
);
}
var
orderInfo
=
await
this
.
orderinfoDao
.
model
.
findOne
({
where
:
{
channelOrderNo
:
ab
.
orderNo
},
raw
:
true
where
:
{
channelOrderNo
:
ab
.
orderNo
},
raw
:
true
});
if
(
!
orderInfo
||
!
orderInfo
.
id
)
{
return
system
.
getResultFail
(
-
103
,
"未知订单"
);
...
...
@@ -573,24 +592,24 @@ class RegCenterOrderService{
}
solutionContent
=
JSON
.
stringify
(
solutionContent
);
var
updateObj
=
{
id
:
ns
.
id
,
solutionContent
:
solutionContent
,
status
:
"yzf"
,
isInvalid
:
1
id
:
ns
.
id
,
solutionContent
:
solutionContent
,
status
:
"yzf"
,
isInvalid
:
1
};
var
self
=
this
;
return
await
this
.
needsolutionDao
.
db
.
transaction
(
async
function
(
t
)
{
await
self
.
needsolutionDao
.
update
(
updateObj
);
//方案状态修改
await
self
.
orderinfoDao
.
update
({
id
:
orderInfo
.
id
,
orderStatus
:
16
});
//订单状态修改
var
new_ns
=
await
self
.
needsolutionDao
.
model
.
findOne
({
await
self
.
orderinfoDao
.
update
({
id
:
orderInfo
.
id
,
orderStatus
:
16
});
//订单状态修改
var
new_ns
=
await
self
.
needsolutionDao
.
model
.
findOne
({
where
:
{
id
:
ns
.
id
},
raw
:
true
});
return
system
.
getResultSuccess
(
new_ns
);
})
}
//------------3.
//提交方案 yiwancheng
async
regSubmitSolution
(
pobj
)
{
console
.
log
(
"pobj++submitRegSolution++"
,
pobj
)
console
.
log
(
"pobj++submitRegSolution++"
,
pobj
)
var
ab
=
pobj
.
actionBody
;
var
user
=
pobj
.
userInfo
;
if
(
!
user
||
!
user
.
id
)
{
...
...
@@ -607,6 +626,7 @@ class RegCenterOrderService{
var
solutionType
=
[];
var
solutionContent
;
var
needsolutions
=
[];
//最后返回结果用
var
bizType
=
[];
//业务类型 百度公司注册兼容公司注册套餐
if
(
ab
.
solutionList
)
{
var
solutionListLength
=
ab
.
solutionList
.
length
;
}
...
...
@@ -618,7 +638,9 @@ class RegCenterOrderService{
solutionContent
=
ab
.
solutionList
[
i
].
solutionContent
solutionType
.
push
(
solutionContent
.
solution
.
regType
)
console
.
log
(
'solutionType------'
,
solutionType
)
bizType
.
push
(
solutionContent
.
solution
.
regType
)
}
bizType
=
bizType
.
toString
()
//获取需求信息
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
where
:
{
channelNeedNo
:
ab
.
needNo
},
raw
:
true
...
...
@@ -629,7 +651,8 @@ class RegCenterOrderService{
if
(
needinfo
.
status
==
"ycd"
||
needinfo
.
status
==
"ygb"
)
{
return
system
.
getResultFail
(
-
202
,
"该方案需求状态为"
+
needinfo
.
statusName
+
",不能创建方案"
);
}
var
bizType
=
needinfo
.
typeCode
;
//业务类型
// var bizType = needinfo.typeCode;//业务类型 原百度公司注册
if
(
!
bizType
)
{
return
system
.
getResultFail
(
-
205
,
"方案类型错误"
);
}
...
...
@@ -646,14 +669,14 @@ class RegCenterOrderService{
if
(
ns
)
{
var
nsLength
=
ns
.
rows
.
length
;
for
(
l
=
0
;
l
<
nsLength
;
l
++
)
{
if
(
ns
.
rows
[
l
].
isInvalid
==
0
)
{
if
(
ns
.
rows
[
l
].
isInvalid
==
0
)
{
nsRegType
.
push
(
ns
.
rows
[
l
].
solutionContent
.
solution
.
regType
)
}
if
(
ns
.
rows
[
l
].
isInvalid
==
1
&&
!
ns
.
rows
[
l
].
solutionContent
.
solution
.
channelSolutionNo
&&
ns
.
rows
[
l
].
status
==
"ybh"
)
{
if
(
ns
.
rows
[
l
].
isInvalid
==
1
&&
!
ns
.
rows
[
l
].
solutionContent
.
solution
.
channelSolutionNo
&&
ns
.
rows
[
l
].
status
==
"ybh"
)
{
return
system
.
getResultFail
(
-
207
,
"该方案中包含已驳回方案,不能新建方案,只能修改方案"
);
}
}
var
diff
;
diff
=
nsRegType
.
find
(
item
=>
solutionType
.
includes
(
item
))
console
.
log
(
'diff---'
,
diff
)
...
...
@@ -664,8 +687,19 @@ class RegCenterOrderService{
for
(
j
=
0
;
j
<
solutionListLength
;
j
++
)
{
if
(
ab
.
solutionList
[
j
].
solutionContent
)
{
ab
.
solutionList
[
j
].
solutionContent
.
bizType
=
bizType
;
ab
.
solutionList
[
j
].
solutionContent
.
typeCode
=
needinfo
.
typeCode
;
ab
.
solutionList
[
j
].
solutionContent
.
typeName
=
needinfo
.
typeName
;
ab
.
solutionList
[
j
].
solutionContent
.
typeCode
=
bizType
;
// ab.solutionList[j].solutionContent.typeName = needinfo.typeName;//需求类型中文 原百度公司注册
switch
(
bizType
)
{
case
"GSREG"
:
ab
.
solutionList
[
j
].
solutionContent
.
typeName
=
needinfo
.
typeName
break
;
case
"QYJYTC1"
:
ab
.
solutionList
[
j
].
solutionContent
.
typeName
=
"企业经营套餐一"
break
;
case
"QYJYTC2"
:
ab
.
solutionList
[
j
].
solutionContent
.
typeName
=
"企业经营套餐二"
break
;
}
for
(
k
=
0
;
k
<
ns
.
rows
.
length
;
k
++
)
{
var
fa
=
ns
.
rows
[
k
];
// if (fa.status == "dqr" || fa.status == "ywc") {
...
...
@@ -746,8 +780,8 @@ class RegCenterOrderService{
}
//方案更新
async
updateSolution
(
pobj
){
console
.
log
(
"pobj++updateSolution++"
,
pobj
)
async
updateSolution
(
pobj
)
{
console
.
log
(
"pobj++updateSolution++"
,
pobj
)
var
ab
=
pobj
.
actionBody
;
var
user
=
pobj
.
userInfo
;
if
(
!
user
||
!
user
.
id
)
{
...
...
@@ -757,9 +791,9 @@ class RegCenterOrderService{
if
(
!
ab
.
needNo
)
{
return
system
.
getResultFail
(
-
101
,
"渠道需求号不能为空"
);
}
var
needsolutions
=
[];
//最后返回结果用
console
.
log
(
'ab.solutionList------'
,
ab
.
solutionList
)
if
(
!
ab
.
solutionList
[
0
].
solutionContent
)
{
return
system
.
getResultFail
(
-
102
,
"方案信息有误"
);
...
...
@@ -767,7 +801,7 @@ class RegCenterOrderService{
if
(
!
ab
.
solutionList
[
0
].
solutionContent
.
solution
.
channelSolutionNo
)
{
return
system
.
getResultFail
(
-
103
,
"渠道方案号不能为空"
);
}
//获取需求信息
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
where
:
{
channelNeedNo
:
ab
.
needNo
},
raw
:
true
...
...
@@ -788,12 +822,12 @@ class RegCenterOrderService{
//查询对应类型方案是否有驳回,驳回后直接更新
var
bhns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
channelSolutionNo
:
ab
.
solutionList
[
0
].
solutionContent
.
solution
.
channelSolutionNo
,
isInvalid
:
1
,
status
:
"ybh"
},
raw
:
true
,
order
:
[[
"id"
,
'asc'
]]
where
:
{
channelSolutionNo
:
ab
.
solutionList
[
0
].
solutionContent
.
solution
.
channelSolutionNo
,
isInvalid
:
1
,
status
:
"ybh"
},
raw
:
true
,
order
:
[[
"id"
,
'asc'
]]
});
console
.
log
(
'bhns----'
,
bhns
)
if
(
!
bhns
)
{
return
system
.
getResultFail
(
-
108
,
"修改方案,不存在的驳回方案"
);
}
else
{
}
else
{
var
self
=
this
ab
.
solutionList
[
0
].
solutionContent
=
JSON
.
stringify
(
ab
.
solutionList
[
0
].
solutionContent
);
await
this
.
needsolutionDao
.
db
.
transaction
(
async
function
(
t
)
{
...
...
@@ -802,16 +836,16 @@ class RegCenterOrderService{
ab
.
solutionList
[
0
][
"isInvalid"
]
=
0
;
var
jsonDatas
=
ab
.
solutionList
[
0
].
solutionContent
var
jsonData
=
JSON
.
parse
(
jsonDatas
)
var
od
=
await
self
.
needsolutionDao
.
updateByWhere
(
ab
.
solutionList
[
0
],
{
where
:{
channelSolutionNo
:
jsonData
.
solution
.
channelSolutionNo
}
},
t
);
console
.
log
(
"od-----"
,
od
)
if
(
od
&&
od
.
length
>
0
)
{
var
needObj
=
{
id
:
needinfo
.
id
,
followManUserId
:
user
.
id
,
//跟进人id
followManName
:
user
.
channel_username
,
//跟进人姓名
followManMobile
:
user
.
mobile
,
//跟进人手机号(合伙人)
followManOnlyCode
:
user
.
channel_userid
};
var
od
=
await
self
.
needsolutionDao
.
updateByWhere
(
ab
.
solutionList
[
0
],
{
where
:
{
channelSolutionNo
:
jsonData
.
solution
.
channelSolutionNo
}
},
t
);
console
.
log
(
"od-----"
,
od
)
if
(
od
&&
od
.
length
>
0
)
{
var
needObj
=
{
id
:
needinfo
.
id
,
followManUserId
:
user
.
id
,
//跟进人id
followManName
:
user
.
channel_username
,
//跟进人姓名
followManMobile
:
user
.
mobile
,
//跟进人手机号(合伙人)
followManOnlyCode
:
user
.
channel_userid
};
var
followContent
=
[{
followDate
:
new
Date
(),
content
:
"驳回后更新方案"
...
...
@@ -831,9 +865,9 @@ class RegCenterOrderService{
}
//方案推送baidu后,接收保存方案编号/链接
async
saveReginfo
(
pobj
)
{
console
.
log
(
'----pobj--'
,
pobj
)
console
.
log
(
'----pobj--'
,
pobj
)
var
ab
=
pobj
.
actionBody
;
console
.
log
(
'---ab---'
,
ab
)
console
.
log
(
'---ab---'
,
ab
)
if
(
!
ab
.
infos
)
{
return
system
.
getResultFail
(
-
101
,
"渠道信息不能为空"
);
}
...
...
@@ -845,11 +879,11 @@ class RegCenterOrderService{
for
(
i
=
0
;
i
<
infosLength
;
i
++
)
{
solutionNos
.
push
(
ab
.
infos
[
i
].
gsbBizId
)
}
console
.
log
(
'----solutionNos----'
,
solutionNos
)
console
.
log
(
'----solutionNos----'
,
solutionNos
)
var
ns
=
await
this
.
needsolutionDao
.
model
.
findAll
({
where
:
{
solutionNo
:
{
[
this
.
db
.
Op
.
in
]:
solutionNos
},
isInvalid
:
0
},
raw
:
true
});
console
.
log
(
"----ns----"
,
ns
)
console
.
log
(
"----ns----"
,
ns
)
var
nsLength
=
ns
.
length
if
(
!
ns
)
{
return
system
.
getResultFail
(
-
103
,
"未知方案"
);
...
...
@@ -864,29 +898,29 @@ class RegCenterOrderService{
return
system
.
getResultFail
(
-
105
,
"该方案需求状态为"
+
needinfo
.
statusName
+
",不能执行此操作"
);
}
var
confirmUrl
=
[]
var
str
;
var
str
;
for
(
j
=
0
;
j
<
nsLength
;
j
++
)
{
confirmUrl
.
push
(
ab
.
infos
[
j
].
confirmUrl
)
ns
[
j
].
solutionContent
[
'confirmUrl'
]
=
ab
.
infos
[
j
].
confirmUrl
str
=
ns
[
j
].
solutionContent
str
=
JSON
.
stringify
(
str
)
await
this
.
needsolutionDao
.
model
.
update
({
channelSolutionNo
:
ab
.
infos
[
j
].
bizId
,
solutionContent
:
str
},
{
where
:
{
id
:
ns
[
j
].
id
}
});
//修改方案信息
await
this
.
needsolutionDao
.
model
.
update
({
channelSolutionNo
:
ab
.
infos
[
j
].
bizId
,
solutionContent
:
str
},
{
where
:
{
id
:
ns
[
j
].
id
}
});
//修改方案信息
}
return
system
.
getResultSuccess
();
}
//回写沟通记录
async
regWriteCommunicationLog
(
pobj
)
{
console
.
log
(
'回写沟通记录----pobj------'
,
pobj
)
console
.
log
(
'回写沟通记录----pobj------'
,
pobj
)
// 查询需求沟通记录
pobj
.
actionBody
.
Note
=
[
"noteTime"
,
moment
().
format
(
"YYYY-MM-DD HH:mm:ss"
),
"note"
,
pobj
.
actionBody
.
note
];
let
needRes
=
await
this
.
needinfoDao
.
findOne
({
channelNeedNo
:
pobj
.
actionBody
.
intentionBizId
});
console
.
log
(
'回写沟通记录----needRes------'
,
needRes
)
console
.
log
(
'回写沟通记录----needRes------'
,
needRes
)
var
uappIds
// 没有需求单直接返回
if
(
!
needRes
)
{
return
system
.
getResult
(
"没有这个需求单"
);
}
else
{
}
else
{
uappIds
=
needRes
.
uapp_id
}
// 如果未推送/以推送 修改为已跟进
...
...
@@ -895,29 +929,29 @@ class RegCenterOrderService{
statusName
:
'已跟进'
,
status
:
'ygj'
};
var
updateRes
=
await
this
.
needinfoDao
.
updateByWhere
(
paramWhere
,{
where
:
{
channelNeedNo
:
pobj
.
actionBody
.
intentionBizId
}
});
console
.
log
(
'回写沟通记录----updateRes---'
,
updateRes
)
var
updateRes
=
await
this
.
needinfoDao
.
updateByWhere
(
paramWhere
,
{
where
:
{
channelNeedNo
:
pobj
.
actionBody
.
intentionBizId
}
});
console
.
log
(
'回写沟通记录----updateRes---'
,
updateRes
)
}
// 有需求单但没有沟通记录 直接set
if
(
!
needRes
.
followContent
)
{
var
paramWhere
=
{
followContent
:
pobj
.
actionBody
.
Note
};
var
updateRes
=
await
this
.
needinfoDao
.
updateByWhere
(
paramWhere
,{
where
:
{
channelNeedNo
:
pobj
.
actionBody
.
intentionBizId
}
});
console
.
log
(
'回写沟通记录----updateRes---updateRes---'
,
updateRes
)
var
updateRes
=
await
this
.
needinfoDao
.
updateByWhere
(
paramWhere
,
{
where
:
{
channelNeedNo
:
pobj
.
actionBody
.
intentionBizId
}
});
console
.
log
(
'回写沟通记录----updateRes---updateRes---'
,
updateRes
)
// 有需求单有沟通记录 json_array_append
}
else
{
var
paramWhere
=
{
Note
:
pobj
.
actionBody
.
Note
};
var
updateRes
=
await
this
.
needinfoDao
.
updateByWhere
(
paramWhere
,{
where
:
{
channelNeedNo
:
pobj
.
actionBody
.
intentionBizId
}
});
console
.
log
(
'updateRes------'
,
updateRes
)
var
updateRes
=
await
this
.
needinfoDao
.
updateByWhere
(
paramWhere
,
{
where
:
{
channelNeedNo
:
pobj
.
actionBody
.
intentionBizId
}
});
console
.
log
(
'updateRes------'
,
updateRes
)
}
return
system
.
getResultSuccess
(
uappIds
);
}
//新增查询需求沟通记录
async
regQueryExpertCommunicationLogs
(
pobj
){
console
.
log
(
'query++pobj'
,
pobj
)
async
regQueryExpertCommunicationLogs
(
pobj
)
{
console
.
log
(
'query++pobj'
,
pobj
)
if
(
!
pobj
.
actionBody
.
intentionBizId
)
{
return
system
.
getResult
(
null
,
"actionBody.intentionBizId can not be empty,100493"
);
}
...
...
@@ -931,7 +965,7 @@ class RegCenterOrderService{
//根据需求关闭reg需求/方案
async
regNeedClose
(
pobj
)
{
console
.
log
(
"regNeedClose+++"
,
pobj
)
console
.
log
(
"regNeedClose+++"
,
pobj
)
var
ab
=
pobj
.
actionBody
;
var
app
=
pobj
.
appInfo
;
var
uappId
;
...
...
@@ -948,7 +982,7 @@ class RegCenterOrderService{
});
if
(
!
needinfo
||
!
needinfo
.
id
)
{
return
system
.
getResultFail
(
-
201
,
"未知需求信息"
);
}
else
{
}
else
{
uappId
=
needinfo
.
uapp_id
}
if
(
needinfo
.
status
==
"ygb"
||
needinfo
.
status
==
"ycd"
)
{
...
...
@@ -971,7 +1005,7 @@ class RegCenterOrderService{
if
(
ns
.
rows
[
i
].
id
)
{
ns
.
rows
[
i
][
'uapp_id'
]
=
uappId
;
if
(
ns
.
rows
[
i
].
status
==
"ywc"
)
{
return
system
.
getResultFail
(
-
103
,
"方案状态错误,不能废弃"
+
ns
.
rows
[
i
].
statusName
+
"方案"
);
return
system
.
getResultFail
(
-
103
,
"方案状态错误,不能废弃"
+
ns
.
rows
[
i
].
statusName
+
"方案"
);
}
var
flowStatus
=
ns
.
rows
[
i
].
solutionContent
&&
ns
.
rows
[
i
].
solutionContent
.
status
?
ns
.
rows
[
i
].
solutionContent
.
status
:
""
;
...
...
@@ -980,25 +1014,25 @@ class RegCenterOrderService{
}
var
self
=
this
updateSolution
=
{
status
:
"yzf"
,
isInvalid
:
1
status
:
"yzf"
,
isInvalid
:
1
}
await
this
.
needsolutionDao
.
db
.
transaction
(
async
function
(
t
)
{
needObj
=
{
status
:
"ygb"
,
notes
:
ab
.
note
status
:
"ygb"
,
notes
:
ab
.
note
};
await
self
.
needinfoDao
.
updateByWhere
(
needObj
,
{
where
:{
id
:
needinfo
.
id
},
t
});
//关闭需求
var
a
=
await
self
.
needsolutionDao
.
updateByWhere
(
updateSolution
,
{
where
:
{
id
:
ns
.
rows
[
i
].
id
},
t
});
//方案废弃
console
.
log
(
"aaaa---"
,
a
)
await
self
.
needinfoDao
.
updateByWhere
(
needObj
,
{
where
:
{
id
:
needinfo
.
id
},
t
});
//关闭需求
var
a
=
await
self
.
needsolutionDao
.
updateByWhere
(
updateSolution
,
{
where
:
{
id
:
ns
.
rows
[
i
].
id
},
t
});
//方案废弃
console
.
log
(
"aaaa---"
,
a
)
})
return
system
.
getResultSuccess
(
ns
);
}
}
}
else
{
}
else
{
needObj
=
{
id
:
needinfo
.
id
,
status
:
"ygb"
,
notes
:
ab
.
note
};
await
this
.
needinfoDao
.
updateByWhere
(
needObj
,
{
where
:{
id
:
needinfo
.
id
}
})
await
this
.
needinfoDao
.
updateByWhere
(
needObj
,
{
where
:
{
id
:
needinfo
.
id
}
})
return
system
.
getResultSuccess
(
needinfo
);
}
}
...
...
@@ -1006,6 +1040,14 @@ class RegCenterOrderService{
//交付商通知状态变更
async
regUpdateOrderStatus
(
pobj
)
{
var
ab
=
pobj
.
actionBody
;
if
(
!
ab
.
consultType
)
{
return
system
.
getResultFail
(
-
101
,
"业务大类不能为空"
);
}
if
(
ab
.
consultType
==
"QYJYTC1"
||
ab
.
consultType
==
"QYJYTC2"
)
{
if
(
!
ab
.
productType
)
{
return
system
.
getResultFail
(
-
101
,
"业务小类不能为空"
);
}
}
if
(
!
ab
.
orderNo
)
{
return
system
.
getResultFail
(
-
101
,
"订单号不能为空"
);
}
...
...
@@ -1017,8 +1059,8 @@ class RegCenterOrderService{
if
(
ab
.
officialFileURL
)
{
ab
[
"OfficialFileURL"
]
=
ab
.
officialFileURL
;
}
if
(
pobj
.
deliverContent
)
{
ab
[
'deliverContent'
]
=
ab
.
deliverContent
if
(
pobj
.
deliverContent
)
{
ab
[
'deliverContent'
]
=
ab
.
deliverContent
}
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
orderNo
:
ab
.
orderNo
},
raw
:
true
...
...
@@ -1037,7 +1079,7 @@ class RegCenterOrderService{
}
//服务商通知状态变更
async
regAcceptPartnerNotification
(
pobj
)
{
console
.
log
(
'服务商通知状态变更pobj++++'
,
pobj
)
console
.
log
(
'服务商通知状态变更pobj++++'
,
pobj
)
var
ab
=
pobj
.
actionBody
;
var
user
=
pobj
.
userInfo
;
if
(
!
user
||
!
user
.
id
)
{
...
...
@@ -1050,7 +1092,7 @@ class RegCenterOrderService{
return
system
.
getResultFail
(
-
102
,
"通知状态不能为空"
);
}
var
deliveryContents
;
if
(
ab
.
deliverContent
)
{
if
(
ab
.
deliverContent
)
{
deliveryContents
=
ab
.
deliverContent
}
//获取方案信息
...
...
@@ -1064,194 +1106,315 @@ class RegCenterOrderService{
if
(
!
needsolutioninfo
.
needNo
)
{
return
system
.
getResultFail
(
-
401
,
"方案需求信息有误"
);
}
//获取jiaofu信息
//获取交付信息 原始公司注册 start
let
bizTypeName
let
productType
=
ab
.
productType
let
orderdeliverySqlData
=
{
sourceOrderNo
:
ab
.
orderNo
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
&&
ab
.
ApplicationStatus
==
705
)
{
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, "方案交付信息有误");
// }
let
orderdeliveryInfo
=
await
this
.
orderdeliveryDao
.
customQuery
(
orderdeliverySql
,
orderdeliverySqlData
)
let
solutionFlowList
=
[];
var
deliveryFlowList
=
[];
let
deliveryContent
=
{};
var
applicationStatusList
// 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
attributes
:
[
"uapp_id"
,
"channelOrderNo"
],
where
:
{
orderNo
:
ab
.
orderNo
},
raw
:
true
})
console
.
log
(
"orderInfo+++"
,
orderInfo
)
if
(
orderInfo
)
{
console
.
log
(
"orderInfo+++"
,
orderInfo
)
if
(
orderInfo
)
{
var
uappId
=
orderInfo
.
uapp_id
;
var
channelOrderNo
=
orderInfo
.
channelOrderNo
}
//2021-5-18区分套餐与非套餐改版之前非套餐的原有数据 start
// if (ab.ApplicationStatus == 702) {//材料收集环节
// if (needsolutioninfo.solutionContent.status != "PAID") {
// 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) {//工商审核环节
// var afterStatusList = [//用户支付后的流程状态
// "COLLECTING", "AUDITING", "ENGRAVING" ,"SUCCESS"
// ];
// if (!deliveryContent.status || afterStatusList.indexOf(deliveryContent.status) < 0){
// return system.getResultFail(-703, "交付流程错误,请先完成材料收集");
// }
// if (deliveryContent.status == "SUCCESS") {
// return system.getResultFail(-706, "该方案已完成,不可更改");
// }
// 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;
// console.log('deliveryContent-----sss---',deliveryContent)
// console.log('deliveryContent-----ss+++',typeof(deliveryContent))
// deliveryContent['deliveryContent'] = deliveryContents
// }
// if (ab.ApplicationStatus == 704) {//刻章环节
// var afterStatusList = [//用户支付后的流程状态
// "COLLECTING", "AUDITING", "ENGRAVING" ,"SUCCESS"
// ];
// if (!deliveryContent.status || afterStatusList.indexOf(deliveryContent.status) < 0){
// return system.getResultFail(-704, "交付流程错误,请先工商审核");
// }
// if (deliveryContent.status == "SUCCESS") {
// return system.getResultFail(-707, "该方案已完成,不可更改");
// }
// 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, "交付流程错误,请先刻章");
// }
// if (deliveryContent.status == "SUCCESS") {
// return system.getResultFail(-708, "该方案已完成,不可更改");
// }
// 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;
// }
//2021-5-18区分套餐与非套餐改版之前非套餐的原有数据 end
//2021-5-18 新增百度公司注册与公司注册套餐区分 start
if
(
ab
.
consultType
&&
ab
.
consultType
==
"GSREG"
){
//公司注册
if
(
ab
.
ApplicationStatus
==
702
)
{
//材料收集环节
if
(
needsolutioninfo
.
solutionContent
.
status
!=
"PAID"
)
{
return
system
.
getResultFail
(
-
702
,
"交付流程错误,请先完成支付"
);
let
startTime
let
endTime
if
(
ab
.
startTime
)
{
startTime
=
(
new
Date
(
ab
.
startTime
*
1000
)).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
}
if
(
ab
.
startTime
)
{
endTime
=
(
new
Date
(
ab
.
endTime
*
1000
)).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
}
if
(
ab
.
consultType
==
"QYJYTC1"
)
{
bizTypeName
=
"企业经营套餐一"
}
if
(
ab
.
consultType
==
"QYJYTC2"
)
{
bizTypeName
=
"企业经营套餐二"
}
//判断是否有交付信息
if
(
orderdeliveryInfo
[
0
]
&&
orderdeliveryInfo
[
0
].
deliveryContent
)
{
deliveryContent
=
orderdeliveryInfo
[
0
].
deliveryContent
;
//判断大类是否是套餐
if
(
ab
.
consultType
&&
ab
.
consultType
==
"GSREG"
)
{
//非套餐
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
&&
ab
.
ApplicationStatus
==
705
)
{
return
system
.
getResultFail
(
-
405
,
"操作失败,该方案已完成,不能更改"
);
}
if
(
ab
.
ApplicationStatus
==
702
)
{
//材料收集环节
if
(
needsolutioninfo
.
solutionContent
.
status
!=
"PAID"
)
{
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
)
{
//工商审核环节
var
afterStatusList
=
[
//用户支付后的流程状态
"COLLECTING"
,
"AUDITING"
,
"ENGRAVING"
,
"SUCCESS"
];
if
(
!
deliveryContent
.
status
||
afterStatusList
.
indexOf
(
deliveryContent
.
status
)
<
0
)
{
return
system
.
getResultFail
(
-
703
,
"交付流程错误,请先完成材料收集"
);
}
if
(
deliveryContent
.
status
==
"SUCCESS"
)
{
return
system
.
getResultFail
(
-
706
,
"该方案已完成,不可更改"
);
}
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
;
console
.
log
(
'deliveryContent-----sss---'
,
deliveryContent
)
console
.
log
(
'deliveryContent-----ss+++'
,
typeof
(
deliveryContent
))
deliveryContent
[
'deliveryContent'
]
=
deliveryContents
}
if
(
ab
.
ApplicationStatus
==
704
)
{
//刻章环节
var
afterStatusList
=
[
//用户支付后的流程状态
"COLLECTING"
,
"AUDITING"
,
"ENGRAVING"
,
"SUCCESS"
];
if
(
!
deliveryContent
.
status
||
afterStatusList
.
indexOf
(
deliveryContent
.
status
)
<
0
)
{
return
system
.
getResultFail
(
-
704
,
"交付流程错误,请先工商审核"
);
}
if
(
deliveryContent
.
status
==
"SUCCESS"
)
{
return
system
.
getResultFail
(
-
707
,
"该方案已完成,不可更改"
);
}
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
,
"交付流程错误,请先刻章"
);
}
if
(
deliveryContent
.
status
==
"SUCCESS"
)
{
return
system
.
getResultFail
(
-
708
,
"该方案已完成,不可更改"
);
}
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
;
}
solutionFlowList
=
deliveryContent
.
solutionFlowList
||
[];
applicationStatusList
=
deliveryContent
.
applicationStatusList
||
[];
}
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
)
{
//工商审核环节
var
afterStatusList
=
[
//用户支付后的流程状态
"COLLECTING"
,
"AUDITING"
,
"ENGRAVING"
,
"SUCCESS"
];
if
(
!
deliveryContent
.
status
||
afterStatusList
.
indexOf
(
deliveryContent
.
status
)
<
0
){
return
system
.
getResultFail
(
-
703
,
"交付流程错误,请先完成材料收集"
);
if
(
ab
.
consultType
&&
ab
.
consultType
==
"QYJYTC1"
||
ab
.
consultType
&&
ab
.
consultType
==
"QYJYTC2"
)
{
//公司注册套餐1和公司注册套餐2
if
(
ab
.
productType
&&
ab
.
productType
==
"GSZZ"
)
{
//工商执照
if
(
ab
.
ApplicationStatus
==
702
)
{
//材料收集环节
if
(
needsolutioninfo
.
solutionContent
.
status
!=
"PAID"
)
{
return
system
.
getResultFail
(
-
702
,
"交付流程错误,请先完成支付"
);
}
}
if
(
ab
.
ApplicationStatus
==
703
)
{
//工商审核环节
var
afterStatusList
=
[
//用户支付后的流程状态
"COLLECTING"
,
"AUDITING"
,
"ENGRAVING"
,
"SUCCESS"
];
if
(
!
deliveryContent
[
ab
.
productType
]
||
(
deliveryContent
[
ab
.
productType
]
&&
deliveryContent
[
ab
.
productType
].
channelStatus
&&
afterStatusList
.
indexOf
(
deliveryContent
[
ab
.
productType
].
channelStatus
)
<
0
))
{
return
system
.
getResultFail
(
-
703
,
"交付流程错误,请先完成材料收集"
);
}
if
(
deliveryContent
[
ab
.
productType
]
&&
deliveryContent
[
ab
.
productType
].
channelStatus
&&
deliveryContent
[
ab
.
productType
].
channelStatus
==
"SUCCESS"
)
{
return
system
.
getResultFail
(
-
706
,
"该方案已完成,不可更改"
);
}
}
if
(
ab
.
ApplicationStatus
==
704
)
{
//刻章环节
var
afterStatusList
=
[
//用户支付后的流程状态
"COLLECTING"
,
"AUDITING"
,
"ENGRAVING"
,
"SUCCESS"
];
if
(
!
deliveryContent
[
ab
.
productType
].
channelStatus
||
afterStatusList
.
indexOf
(
deliveryContent
[
ab
.
productType
].
channelStatus
)
<
0
)
{
return
system
.
getResultFail
(
-
704
,
"交付流程错误,请先工商审核"
);
}
if
(
deliveryContent
[
ab
.
productType
]
&&
deliveryContent
[
ab
.
productType
].
channelStatus
&&
deliveryContent
[
ab
.
productType
].
channelStatus
==
"SUCCESS"
)
{
return
system
.
getResultFail
(
-
707
,
"该方案已完成,不可更改"
);
}
}
if
(
ab
.
ApplicationStatus
==
705
)
{
//已完成
if
(
deliveryContent
[
ab
.
productType
]
&&
deliveryContent
[
ab
.
productType
].
channelStatus
&&
deliveryContent
[
ab
.
productType
].
channelStatus
!=
"ENGRAVING"
)
{
return
system
.
getResultFail
(
-
705
,
"交付流程错误,请先刻章"
);
}
if
(
deliveryContent
[
ab
.
productType
]
&&
deliveryContent
[
ab
.
productType
].
channelStatus
&&
deliveryContent
[
ab
.
productType
].
channelStatus
==
"SUCCESS"
)
{
return
system
.
getResultFail
(
-
708
,
"该方案已完成,不可更改"
);
}
}
deliveryContent
[
'GSZZ'
]
=
{
bizType
:
ab
.
consultType
,
bizTypeName
:
bizTypeName
,
productType
:
productType
,
productTypeName
:
"工商执照"
,
status
:
ab
.
ApplicationStatus
,
statusName
:
this
.
regDeliveryStatusName
[
ab
.
ApplicationStatus
],
channelStatus
:
this
.
regDeliveryStatus
[
ab
.
ApplicationStatus
],
customerInfo
:
needsolutioninfo
.
solutionContent
.
customerInfo
,
update_at
:
new
Date
().
Format
(
"yyyy-MM-dd hh:mm:ss"
),
officialFile
:
ab
.
officialFile
||
""
,
deliveryFlowList
:
[]
}
}
if
(
deliveryContent
.
status
==
"SUCCESS"
)
{
return
system
.
getResultFail
(
-
706
,
"该方案已完成,不可更改"
);
if
(
ab
.
productType
&&
ab
.
productType
==
"DZFW"
)
{
//地址服务
if
(
ab
.
ApplicationStatus
==
702
)
{
//材料收集环节
if
(
needsolutioninfo
.
solutionContent
.
status
!=
"PAID"
)
{
return
system
.
getResultFail
(
-
702
,
"交付流程错误,请先完成支付"
);
}
}
if
(
ab
.
ApplicationStatus
==
703
)
{
//工商审核环节
var
afterStatusList
=
[
//用户支付后的流程状态
"COLLECTING"
,
"AUDITING"
,
"ENGRAVING"
,
"SUCCESS"
];
if
(
!
deliveryContent
[
ab
.
productType
]
||
(
deliveryContent
[
ab
.
productType
]
&&
deliveryContent
[
ab
.
productType
].
channelStatus
&&
afterStatusList
.
indexOf
(
deliveryContent
[
ab
.
productType
].
channelStatus
)
<
0
))
{
return
system
.
getResultFail
(
-
703
,
"交付流程错误,请先完成材料收集"
);
}
if
(
deliveryContent
[
ab
.
productType
]
&&
deliveryContent
[
ab
.
productType
].
channelStatus
&&
deliveryContent
[
ab
.
productType
].
channelStatus
==
"SUCCESS"
)
{
return
system
.
getResultFail
(
-
706
,
"该方案已完成,不可更改"
);
}
}
if
(
ab
.
ApplicationStatus
==
706
)
{
//服务中
var
afterStatusList
=
[
//用户支付后的流程状态
"COLLECTING"
,
"AUDITING"
,
"SUCCESS"
];
if
(
!
deliveryContent
[
ab
.
productType
]
||
(
deliveryContent
[
ab
.
productType
]
&&
deliveryContent
[
ab
.
productType
].
channelStatus
&&
afterStatusList
.
indexOf
(
deliveryContent
[
ab
.
productType
].
channelStatus
)
<
0
))
{
return
system
.
getResultFail
(
-
704
,
"交付流程错误,请先工商审核"
);
}
if
(
deliveryContent
[
ab
.
productType
]
&&
deliveryContent
[
ab
.
productType
].
channelStatus
&&
deliveryContent
[
ab
.
productType
].
channelStatus
==
"SUCCESS"
)
{
return
system
.
getResultFail
(
-
707
,
"该方案已完成,不可更改"
);
}
}
if
(
ab
.
ApplicationStatus
==
705
)
{
//已完成
if
(
deliveryContent
[
ab
.
productType
]
&&
deliveryContent
[
ab
.
productType
].
channelStatus
&&
deliveryContent
[
ab
.
productType
].
channelStatus
!=
"ACTIVE"
)
{
return
system
.
getResultFail
(
-
705
,
"交付流程错误,请先变更状态为服务中"
);
}
if
(
deliveryContent
[
ab
.
productType
]
&&
deliveryContent
[
ab
.
productType
].
channelStatus
&&
deliveryContent
[
ab
.
productType
].
channelStatus
==
"SUCCESS"
)
{
return
system
.
getResultFail
(
-
708
,
"该方案已完成,不可更改"
);
}
}
deliveryContent
[
'DZFW'
]
=
{
bizType
:
ab
.
consultType
,
bizTypeName
:
bizTypeName
,
productType
:
productType
,
productTypeName
:
"地址服务"
,
startTime
:
startTime
||
""
,
endTime
:
endTime
||
""
,
status
:
ab
.
ApplicationStatus
,
statusName
:
this
.
regDeliveryStatusName
[
ab
.
ApplicationStatus
],
channelStatus
:
this
.
regDeliveryStatus
[
ab
.
ApplicationStatus
],
update_at
:
new
Date
().
Format
(
"yyyy-MM-dd hh:mm:ss"
),
officialFile
:
ab
.
officialFile
||
""
,
deliveryFlowList
:
[]
}
}
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
;
console
.
log
(
'deliveryContent-----sss---'
,
deliveryContent
)
console
.
log
(
'deliveryContent-----ss+++'
,
typeof
(
deliveryContent
))
deliveryContent
[
'deliveryContent'
]
=
deliveryContents
}
if
(
ab
.
ApplicationStatus
==
704
)
{
//刻章环节
var
afterStatusList
=
[
//用户支付后的流程状态
"COLLECTING"
,
"AUDITING"
,
"ENGRAVING"
,
"SUCCESS"
];
if
(
!
deliveryContent
.
status
||
afterStatusList
.
indexOf
(
deliveryContent
.
status
)
<
0
){
return
system
.
getResultFail
(
-
704
,
"交付流程错误,请先工商审核"
);
if
(
ab
.
productType
&&
ab
.
productType
==
"SWBD"
)
{
//税务报道:有已接单,已完成状态
if
(
ab
.
ApplicationStatus
==
705
)
{
//已完成
if
(
deliveryContent
[
ab
.
productType
]
&&
deliveryContent
[
ab
.
productType
].
channelStatus
&&
deliveryContent
[
ab
.
productType
].
channelStatus
==
"SUCCESS"
)
{
return
system
.
getResultFail
(
-
707
,
"该方案已完成,不可更改"
);
}
}
deliveryContent
[
'SWBD'
]
=
{
bizType
:
ab
.
consultType
,
bizTypeName
:
bizTypeName
,
productType
:
productType
,
productTypeName
:
"税务报道"
,
status
:
ab
.
ApplicationStatus
,
statusName
:
this
.
regDeliveryStatusName
[
ab
.
ApplicationStatus
],
channelStatus
:
this
.
regDeliveryStatus
[
ab
.
ApplicationStatus
],
update_at
:
new
Date
().
Format
(
"yyyy-MM-dd hh:mm:ss"
),
officialFile
:
ab
.
officialFile
||
""
,
deliveryFlowList
:
[]
}
}
if
(
deliveryContent
.
status
==
"SUCCESS"
)
{
return
system
.
getResultFail
(
-
707
,
"该方案已完成,不可更改"
);
if
(
ab
.
productType
&&
ab
.
productType
==
"YHKH"
)
{
//银行开户、:有已接单,已完成状态
if
(
ab
.
ApplicationStatus
==
705
)
{
//已完成
if
(
deliveryContent
[
ab
.
productType
]
&&
deliveryContent
[
ab
.
productType
].
channelStatus
&&
deliveryContent
[
ab
.
productType
].
channelStatus
==
"SUCCESS"
)
{
return
system
.
getResultFail
(
-
707
,
"该方案已完成,不可更改"
);
}
}
deliveryContent
[
'YHKH'
]
=
{
bizType
:
ab
.
consultType
,
bizTypeName
:
bizTypeName
,
productType
:
productType
,
productTypeName
:
"银行开户"
,
status
:
ab
.
ApplicationStatus
,
statusName
:
this
.
regDeliveryStatusName
[
ab
.
ApplicationStatus
],
channelStatus
:
this
.
regDeliveryStatus
[
ab
.
ApplicationStatus
],
update_at
:
new
Date
().
Format
(
"yyyy-MM-dd hh:mm:ss"
),
officialFile
:
ab
.
officialFile
||
""
,
deliveryFlowList
:
[]
}
}
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
,
"交付流程错误,请先刻章"
);
if
(
ab
.
productType
&&
ab
.
productType
==
"DLJZ"
)
{
//代理记账:有已接单,服务中,已完成状态
if
(
ab
.
ApplicationStatus
==
706
)
{
//服务中
if
(
deliveryContent
[
ab
.
productType
]
&&
deliveryContent
[
ab
.
productType
].
channelStatus
&&
deliveryContent
[
ab
.
productType
].
channelStatus
==
"ACTIVE"
)
{
return
system
.
getResultFail
(
-
707
,
"该交付单已在服务中,不能重复提交"
);
}
}
if
(
ab
.
ApplicationStatus
==
705
)
{
//已完成
if
(
deliveryContent
[
ab
.
productType
]
&&
deliveryContent
[
ab
.
productType
].
channelStatus
&&
deliveryContent
[
ab
.
productType
].
channelStatus
==
"SUCCESS"
)
{
return
system
.
getResultFail
(
-
707
,
"该交付单已在服务中,不能重复提交"
);
}
}
deliveryContent
[
'DLJZ'
]
=
{
bizType
:
ab
.
consultType
,
bizTypeName
:
bizTypeName
,
productType
:
productType
,
productTypeName
:
"代理记账"
,
startTime
:
startTime
||
""
,
endTime
:
endTime
||
""
,
status
:
ab
.
ApplicationStatus
,
statusName
:
this
.
regDeliveryStatusName
[
ab
.
ApplicationStatus
],
channelStatus
:
this
.
regDeliveryStatus
[
ab
.
ApplicationStatus
],
update_at
:
new
Date
().
Format
(
"yyyy-MM-dd hh:mm:ss"
),
officialFile
:
ab
.
officialFile
||
""
,
deliveryFlowList
:
[]
}
}
if
(
deliveryContent
.
status
==
"SUCCESS"
)
{
return
system
.
getResultFail
(
-
708
,
"该方案已完成,不可更改"
);
//如果存在交付信息的话就去进行逻辑判断
if
(
deliveryContent
&&
deliveryContent
[
ab
.
productType
]
&&
deliveryContent
[
ab
.
productType
].
status
&&
deliveryContent
[
ab
.
productType
].
deliveryFlowList
)
{
if
(
this
.
regStatus
[
deliveryContent
.
ApplicationStatus
]
&&
this
.
regStatus
[
deliveryContent
.
ApplicationStatus
]
==
ab
.
ApplicationStatus
&&
ab
.
ApplicationStatus
==
705
)
{
return
system
.
getResultFail
(
-
406
,
"操作失败,该交付已完成,不能更改"
);
}
deliveryFlowList
=
deliveryContent
[
ab
.
productType
].
solutionFlowList
||
[];
}
deliveryContent
[
'ApplicationStatus'
]
=
705
;
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"SUCCESS"
,
statusName
:
this
.
regSolutionStatus
.
SUCCESS
,
updated_at
:
new
Date
()
deliveryContent
[
ab
.
productType
].
deliveryFlowList
.
push
({
status
:
ab
.
ApplicationStatus
,
statusName
:
this
.
regDeliveryStatusName
[
ab
.
ApplicationStatus
],
file
:
ab
.
officialFile
||
""
,
update_at
:
new
Date
().
Format
(
"yyyy-MM-dd hh:mm:ss"
)
});
deliveryContent
.
status
=
"SUCCESS"
;
needsolutioninfo
.
status
=
"ywc"
;
deliveryContent
.
statusName
=
this
.
regSolutionStatus
.
SUCCESS
;
deliveryContent
[
ab
.
productType
].
status
=
ab
.
ApplicationStatus
deliveryContent
[
ab
.
productType
].
statusName
=
this
.
regDeliveryStatusName
[
ab
.
ApplicationStatus
]
deliveryContent
[
ab
.
productType
].
channelStatus
=
this
.
regDeliveryStatus
[
ab
.
ApplicationStatus
]
}
}
else
{
//公司注册套餐
if
(
ab
.
productType
&&
ab
.
productType
==
"GSZZ"
){
//工商执照
}
else
{
//如果交付信息不存在
if
(
ab
.
consultType
&&
ab
.
consultType
==
"GSREG"
)
{
//非套餐
solutionFlowList
=
needsolutioninfo
.
solutionContent
.
solutionFlowList
deliveryContent
.
solutionFlowList
=
solutionFlowList
;
deliveryContent
=
needsolutioninfo
.
solutionContent
;
deliveryContent
[
'ApplicationStatus'
]
=
ab
.
ApplicationStatus
applicationStatusList
=
deliveryContent
.
applicationStatusList
||
[];
if
(
ab
.
ApplicationStatus
==
702
)
{
//材料收集环节
if
(
needsolutioninfo
.
solutionContent
.
status
!=
"PAID"
)
{
return
system
.
getResultFail
(
-
702
,
"交付流程错误,请先完成支付"
);
...
...
@@ -1266,9 +1429,9 @@ class RegCenterOrderService{
}
if
(
ab
.
ApplicationStatus
==
703
)
{
//工商审核环节
var
afterStatusList
=
[
//用户支付后的流程状态
"COLLECTING"
,
"AUDITING"
,
"ENGRAVING"
,
"SUCCESS"
"COLLECTING"
,
"AUDITING"
,
"ENGRAVING"
,
"SUCCESS"
];
if
(
!
deliveryContent
.
status
||
afterStatusList
.
indexOf
(
deliveryContent
.
status
)
<
0
)
{
if
(
!
deliveryContent
.
status
||
afterStatusList
.
indexOf
(
deliveryContent
.
status
)
<
0
)
{
return
system
.
getResultFail
(
-
703
,
"交付流程错误,请先完成材料收集"
);
}
if
(
deliveryContent
.
status
==
"SUCCESS"
)
{
...
...
@@ -1281,15 +1444,15 @@ class RegCenterOrderService{
});
deliveryContent
.
status
=
"AUDITING"
;
deliveryContent
.
statusName
=
this
.
regSolutionStatus
.
AUDITING
;
console
.
log
(
'deliveryContent-----sss---'
,
deliveryContent
)
console
.
log
(
'deliveryContent-----ss+++'
,
typeof
(
deliveryContent
))
console
.
log
(
'deliveryContent-----sss---'
,
deliveryContent
)
console
.
log
(
'deliveryContent-----ss+++'
,
typeof
(
deliveryContent
))
deliveryContent
[
'deliveryContent'
]
=
deliveryContents
}
if
(
ab
.
ApplicationStatus
==
704
)
{
//刻章环节
var
afterStatusList
=
[
//用户支付后的流程状态
"COLLECTING"
,
"AUDITING"
,
"ENGRAVING"
,
"SUCCESS"
"COLLECTING"
,
"AUDITING"
,
"ENGRAVING"
,
"SUCCESS"
];
if
(
!
deliveryContent
.
status
||
afterStatusList
.
indexOf
(
deliveryContent
.
status
)
<
0
)
{
if
(
!
deliveryContent
.
status
||
afterStatusList
.
indexOf
(
deliveryContent
.
status
)
<
0
)
{
return
system
.
getResultFail
(
-
704
,
"交付流程错误,请先工商审核"
);
}
if
(
deliveryContent
.
status
==
"SUCCESS"
)
{
...
...
@@ -1320,152 +1483,197 @@ class RegCenterOrderService{
deliveryContent
.
statusName
=
this
.
regSolutionStatus
.
SUCCESS
;
}
}
if
(
ab
.
productType
&&
(
ab
.
productType
==
"YHKH"
||
ab
.
productType
==
"SWBD"
)){
//YHKH:银行开户; SWBD:税务报道;只有已接单和已完成状态
if
(
ab
.
ApplicationStatus
==
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
;
}
}
if
(
ab
.
productType
&&
ab
.
productType
==
"DZFW"
){
//地址服务
if
(
ab
.
ApplicationStatus
==
702
)
{
//材料收集环节
if
(
needsolutioninfo
.
solutionContent
.
status
!=
"PAID"
)
{
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
.
consultType
&&
ab
.
consultType
==
"QYJYTC1"
||
ab
.
consultType
&&
ab
.
consultType
==
"QYJYTC2"
)
{
//公司注册套餐1和公司注册套餐2
if
(
ab
.
consultType
==
"QYJYTC1"
)
{
bizTypeName
=
"企业经营套餐一"
}
if
(
ab
.
ApplicationStatus
==
703
)
{
//工商审核环节
var
afterStatusList
=
[
//用户支付后的流程状态
"COLLECTING"
,
"AUDITING"
,
"ENGRAVING"
,
"SUCCESS"
];
if
(
!
deliveryContent
.
status
||
afterStatusList
.
indexOf
(
deliveryContent
.
status
)
<
0
){
return
system
.
getResultFail
(
-
703
,
"交付流程错误,请先完成材料收集"
);
}
if
(
deliveryContent
.
status
==
"SUCCESS"
)
{
return
system
.
getResultFail
(
-
706
,
"该方案已完成,不可更改"
);
}
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
;
console
.
log
(
'deliveryContent-----sss---'
,
deliveryContent
)
console
.
log
(
'deliveryContent-----ss+++'
,
typeof
(
deliveryContent
))
deliveryContent
[
'deliveryContent'
]
=
deliveryContents
if
(
ab
.
consultType
==
"QYJYTC2"
)
{
bizTypeName
=
"企业经营套餐二"
}
if
(
ab
.
ApplicationStatus
==
706
)
{
//服务中
var
afterStatusList
=
[
//用户支付后的流程状态
"COLLECTING"
,
"AUDITING"
,
"SUCCESS"
];
if
(
!
deliveryContent
.
status
||
afterStatusList
.
indexOf
(
deliveryContent
.
status
)
<
0
){
return
system
.
getResultFail
(
-
704
,
"交付流程错误,请先工商审核"
);
}
if
(
deliveryContent
.
status
==
"SUCCESS"
)
{
return
system
.
getResultFail
(
-
707
,
"该方案已完成,不可更改"
);
}
deliveryContent
[
'ApplicationStatus'
]
=
706
;
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"ACTIVE"
,
statusName
:
this
.
regSolutionStatus
.
ACTIVE
,
updated_at
:
new
Date
()
});
deliveryContent
.
status
=
"ACTIVE"
;
deliveryContent
.
statusName
=
this
.
regSolutionStatus
.
ACTIVE
;
}
if
(
ab
.
ApplicationStatus
==
705
)
{
//已完成
if
(
deliveryContent
.
status
!=
"ACTIVE"
)
{
return
system
.
getResultFail
(
-
705
,
"交付流程错误,请先变更状态为服务中"
);
}
if
(
deliveryContent
.
status
==
"SUCCESS"
)
{
return
system
.
getResultFail
(
-
708
,
"该方案已完成,不可更改"
);
}
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
;
}
}
if
(
ab
.
productType
&&
ab
.
productType
==
"DLJZ"
){
//代理记账:有已接单,服务中,已完成状态
if
(
ab
.
ApplicationStatus
==
706
)
{
//服务中
if
(
deliveryContent
.
status
==
"SUCCESS"
)
{
return
system
.
getResultFail
(
-
707
,
"该方案已完成,不可更改"
);
}
deliveryContent
[
'ApplicationStatus'
]
=
706
;
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"ACTIVE"
,
statusName
:
this
.
regSolutionStatus
.
ACTIVE
,
updated_at
:
new
Date
()
});
deliveryContent
.
status
=
"ACTIVE"
;
deliveryContent
.
statusName
=
this
.
regSolutionStatus
.
ACTIVE
;
}
if
(
ab
.
ApplicationStatus
==
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
;
switch
(
productType
)
{
case
"GSZZ"
:
deliveryContent
[
'GSZZ'
]
=
{
bizType
:
ab
.
consultType
,
bizTypeName
:
bizTypeName
,
productType
:
productType
,
productTypeName
:
"工商执照"
,
status
:
ab
.
ApplicationStatus
,
statusName
:
this
.
regDeliveryStatusName
[
ab
.
ApplicationStatus
],
channelStatus
:
this
.
regDeliveryStatus
[
ab
.
ApplicationStatus
],
customerInfo
:
needsolutioninfo
.
solutionContent
.
customerInfo
,
update_at
:
new
Date
().
Format
(
"yyyy-MM-dd hh:mm:ss"
),
officialFile
:
ab
.
officialFile
||
""
,
deliveryFlowList
:
[]
}
break
;
case
"YHKH"
:
deliveryContent
[
'YHKH'
]
=
{
bizType
:
ab
.
consultType
,
bizTypeName
:
bizTypeName
,
productType
:
productType
,
productTypeName
:
"银行开户"
,
status
:
ab
.
ApplicationStatus
,
statusName
:
this
.
regDeliveryStatusName
[
ab
.
ApplicationStatus
],
channelStatus
:
this
.
regDeliveryStatus
[
ab
.
ApplicationStatus
],
update_at
:
new
Date
().
Format
(
"yyyy-MM-dd hh:mm:ss"
),
officialFile
:
ab
.
officialFile
||
""
,
deliveryFlowList
:
[]
}
break
;
case
"SWBD"
:
deliveryContent
[
'SWBD'
]
=
{
bizType
:
ab
.
consultType
,
bizTypeName
:
bizTypeName
,
productType
:
productType
,
productTypeName
:
"税务报道"
,
status
:
ab
.
ApplicationStatus
,
statusName
:
this
.
regDeliveryStatusName
[
ab
.
ApplicationStatus
],
channelStatus
:
this
.
regDeliveryStatus
[
ab
.
ApplicationStatus
],
update_at
:
new
Date
().
Format
(
"yyyy-MM-dd hh:mm:ss"
),
officialFile
:
ab
.
officialFile
||
""
,
deliveryFlowList
:
[]
}
break
;
case
"DLJZ"
:
deliveryContent
[
'DLJZ'
]
=
{
bizType
:
ab
.
consultType
,
bizTypeName
:
bizTypeName
,
productType
:
productType
,
productTypeName
:
"代理记账"
,
status
:
ab
.
ApplicationStatus
,
statusName
:
this
.
regDeliveryStatusName
[
ab
.
ApplicationStatus
],
channelStatus
:
this
.
regDeliveryStatus
[
ab
.
ApplicationStatus
],
update_at
:
new
Date
().
Format
(
"yyyy-MM-dd hh:mm:ss"
),
officialFile
:
ab
.
officialFile
||
""
,
deliveryFlowList
:
[]
}
break
;
case
"DZFW"
:
deliveryContent
[
'DZFW'
]
=
{
bizType
:
ab
.
consultType
,
bizTypeName
:
bizTypeName
,
productType
:
productType
,
productTypeName
:
"地址服务"
,
status
:
ab
.
ApplicationStatus
,
statusName
:
this
.
regDeliveryStatusName
[
ab
.
ApplicationStatus
],
channelStatus
:
this
.
regDeliveryStatus
[
ab
.
ApplicationStatus
],
update_at
:
new
Date
().
Format
(
"yyyy-MM-dd hh:mm:ss"
),
officialFile
:
ab
.
officialFile
||
""
,
deliveryFlowList
:
[]
}
break
;
}
}
}
//2021-5-18 新增百度公司注册与公司注册套餐区分 end
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
,
sourceOrderNo
:
ab
.
orderNo
,
deliveryContent
:
deliveryContent
,
}
if
(
!
orderdeliveryInfo
[
0
])
{
if
(
!
orderdeliveryInfo
[
0
])
{
let
sql
=
"INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUES (:sourceOrderNo,:deliveryContent)"
;
var
orderdelivery
=
await
this
.
orderdeliveryDao
.
customInsert
(
sql
,
orderdeliveryData
);
}
else
{
}
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
){
sourceOrderNo
:
ab
.
orderNo
}
orderdelivery
=
await
this
.
orderdeliveryDao
.
customQuery
(
orderdeliveryQuery
,
QueryDatas
)
console
.
log
(
'orderdelivery++orderdelivery++++++'
,
orderdelivery
)
//todo 推送云服订单所有交付单状态为完成时订单状态为完成的判断 以下所有注释都是相关代码
// let gszzDeliveryStatus
// let yhkhDeliveryStatus
// let swbdDeliveryStatus
// let gszzDeliveryStatus2
// let yhkhDeliveryStatus2
// let swbdDeliveryStatus2
// let dljzDeliveryStatus2
// let dzfwDeliveryStatus2
// let update_at = new Date().Format("yyyy-MM-dd hh:mm:ss")
// var deliveryFlag
// var deliveryFlag2
if
(
orderdelivery
)
{
orderdelivery
=
orderdelivery
[
0
]
orderdelivery
[
"bizId"
]
=
ab
.
bizId
;
orderdelivery
[
'uapp_id'
]
=
uappId
;
orderdelivery
[
'channelOrderNo'
]
=
channelOrderNo
;
// if (ab.consultType && ab.consultType == "QYJYTC1") {
// switch (ab.productType) {
// case "GSZZ":
// if (deliveryContent["GSZZ"] && deliveryContent["GSZZ"].status == 705) {
// gszzDeliveryStatus = 705
// }
// break;
// case "YHKH":
// if (deliveryContent["YHKH"] && deliveryContent["YHKH"].status == 705) {
// yhkhDeliveryStatus = 705
// }
// break;
// case "SWBD":
// if (deliveryContent["SWBD"] && deliveryContent["SWBD"].status == 705) {
// swbdDeliveryStatus = 705
// }
// break;
// }
// if (gszzDeliveryStatus && yhkhDeliveryStatus && swbdDeliveryStatus && 705 == swbdDeliveryStatus == yhkhDeliveryStatus == gszzDeliveryStatus) {
// let sql = "UPDATE `c_order_info` SET orderStatusName ='已完成',orderStatus= 8,updated_at='" + update_at + "' where orderNo ='" + ab.orderNo + "'";
// let updateOrderInfo = await this.orderdeliveryDao.customInsert(sql);
// if (updateOrderInfo) {
// deliveryFlag = 200
// orderdelivery['deliveryFlag'] = deliveryFlag;
// }
// }
// }
// if (ab.consultType && ab.consultType == "QYJYTC2") {
// switch (ab.productType) {
// case "GSZZ":
// if (deliveryContent["GSZZ"] && deliveryContent["GSZZ"].status == 705) {
// gszzDeliveryStatus2 = 705
// }
// break;
// case "YHKH":
// if (deliveryContent["YHKH"] && deliveryContent["YHKH"].status == 705) {
// yhkhDeliveryStatus2 = 705
// }
// break;
// case "SWBD":
// if (deliveryContent["SWBD"] && deliveryContent["SWBD"].status == 705) {
// swbdDeliveryStatus2 = 705
// }
// break;
// case "DLJZ":
// if (deliveryContent["DLJZ"] && deliveryContent["DLJZ"].status == 705) {
// dljzDeliveryStatus2 = 705
// }
// break;
// case "DZFW":
// if (deliveryContent["DZFW"] && deliveryContent["DZFW"].status == 705) {
// dzfwDeliveryStatus2 = 705
// }
// break;
// }
// if (gszzDeliveryStatus2 && yhkhDeliveryStatus2 && swbdDeliveryStatus2 && dljzDeliveryStatus2 && dzfwDeliveryStatus2 && 705 == swbdDeliveryStatus2 == yhkhDeliveryStatus2 == gszzDeliveryStatus2 == dljzDeliveryStatus2 == dzfwDeliveryStatus2) {
// let sql2 = "UPDATE `c_order_info` SET orderStatusName ='已完成',orderStatus= 8,updated_at='" + update_at + "' where orderNo ='" + ab.orderNo + "'";
// let updateOrderInfo2 = await this.orderdeliveryDao.customInsert(sql2);
// if (updateOrderInfo2) {
// deliveryFlag2 = 200
// orderdelivery['deliveryFlag2'] = deliveryFlag2;
// }
// }
// }
}
console
.
log
(
'orderdelivery++'
,
orderdelivery
)
console
.
log
(
'orderdelivery++'
,
orderdelivery
)
return
system
.
getResultSuccess
(
orderdelivery
);
}
}
module
.
exports
=
RegCenterOrderService
;
\ No newline at end of file
center-order/app/base/utils/execClient.js
View file @
07770a33
...
...
@@ -41,13 +41,26 @@ class ExecClient {
console
.
log
(
cmd
);
return
cmd
;
}
Fetch360TokenCmd
(
subData
,
url
)
{
Fetch360TokenCmd
(
subData
,
url
)
{
let
cmd
=
this
.
cmd360Token
.
replace
(
/
\{
data
\}
/g
,
subData
).
replace
(
/
\{
url
\}
/g
,
url
);
console
.
log
(
cmd
);
return
cmd
;
}
async
execPost
(
subData
,
url
)
{
//本机windows curl json格式
// if (settings.env == 'dev') {
// const rs = await axios.post(url, subData, {
// auth: {
// username: "admines",
// password: "adminGSBes"
// }
// });
// const ret = {
// stdout: JSON.stringify(rs.data)
// }
// return ret;
// }
let
cmd
=
this
.
FetchPostCmd
(
subData
,
url
);
var
result
=
await
this
.
exec
(
cmd
);
return
result
;
...
...
@@ -62,9 +75,9 @@ class ExecClient {
var
result
=
await
this
.
exec2
(
cmd
);
return
result
;
}
async
exec360GetToken
(
url
){
async
exec360GetToken
(
url
)
{
const
qs
=
require
(
'qs'
)
let
obj
=
{
"scope"
:
"smart_business"
,
"grant_type"
:
"client_credentials"
}
let
obj
=
{
"scope"
:
"smart_business"
,
"grant_type"
:
"client_credentials"
}
// if(settings.env == 'dev'){
// const rs = await axios({
// method: 'post',
...
...
@@ -80,7 +93,7 @@ class ExecClient {
// }
// return ret;
// }
let
cmd
=
this
.
Fetch360TokenCmd
(
qs
.
stringify
(
obj
),
url
);
let
cmd
=
this
.
Fetch360TokenCmd
(
qs
.
stringify
(
obj
),
url
);
console
.
log
(
cmd
);
var
result
=
await
this
.
exec
(
cmd
);
return
result
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment