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
8ccd9019
Commit
8ccd9019
authored
Dec 18, 2020
by
兰国旗
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
laolan
parent
fe5719ca
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
69 deletions
+76
-69
center-order/app/base/api/impl/action/regapi.js
+18
-17
center-order/app/base/service/impl/qcutils/regCenterOrderSve.js
+58
-52
No files found.
center-order/app/base/api/impl/action/reg
CenterOrder
.js
→
center-order/app/base/api/impl/action/reg
api
.js
View file @
8ccd9019
//工商注册
var
APIBase
=
require
(
"../../api.base"
);
var
system
=
require
(
"../../../system"
);
class
BaiduReg
extends
APIBase
{
class
RegAPI
extends
APIBase
{
constructor
()
{
super
();
this
.
regCenterOrder
=
system
.
getObject
(
"service.qcutils.regCenterOrder
"
);
this
.
regCenterOrder
Sve
=
system
.
getObject
(
"service.qcutils.regCenterOrderSve
"
);
}
/**
* 接口跳转-POST请求
...
...
@@ -32,34 +32,35 @@ class BaiduReg extends APIBase {
var
opResult
=
null
;
switch
(
action_type
)
{
case
"receiveSolutionPayInfoNew"
:
//接收reg方案状态及支付信息(方案支付后创建订单时调用)
opResult
=
await
this
.
regCenterOrder
.
receiveSolutionPayInfoNew
(
pobj
);
opResult
=
await
this
.
regCenterOrder
Sve
.
receiveSolutionPayInfoNew
(
pobj
);
break
;
case
"getItemByChannelSolutionNo"
:
//渠道方案号获取需求详情
opResult
=
await
this
.
regCenterOrder
.
getItemByChannelSolutionNo
(
pobj
,
pobj
.
actionBody
,
req
);
opResult
=
await
this
.
regCenterOrder
Sve
.
getItemByChannelSolutionNo
(
pobj
,
pobj
.
actionBody
,
req
);
break
;
case
"getRegOrderStatus"
:
//接收订单状态推送 百度reg 2.3
opResult
=
await
this
.
regCenterOrder
.
getRegOrderStatus
(
pobj
);
opResult
=
await
this
.
regCenterOrder
Sve
.
getRegOrderStatus
(
pobj
);
break
;
case
"addRegSalesmanInfo"
:
//添加业务员信息,用于直接下单的reg订单
opResult
=
await
this
.
regCenterOrder
.
addRegSalesmanInfo
(
pobj
);
opResult
=
await
this
.
regCenterOrder
Sve
.
addRegSalesmanInfo
(
pobj
);
break
;
case
"submitRegNeed"
:
//提交需求
opResult
=
await
this
.
regCenterOrder
.
submitRegNeed
(
pobj
,
pobj
.
actionBody
,
req
);
opResult
=
await
this
.
regCenterOrder
Sve
.
submitRegNeed
(
pobj
,
pobj
.
actionBody
,
req
);
break
;
case
"submitBdRegSolution"
:
//方案提交
opResult
=
await
this
.
regCenterOrder
.
submitBdRegSolution
(
pobj
);
case
"submitRegSolution"
:
//方案提交
opResult
=
await
this
.
regCenterOrderSve
.
submitRegSolution
(
pobj
);
break
;
case
"writeRegCommunicationLog"
:
//新增沟通记录
opResult
=
await
this
.
regCenterOrder
.
writeRegCommunicationLog
(
pobj
);
opResult
=
await
this
.
regCenterOrder
Sve
.
writeRegCommunicationLog
(
pobj
);
break
;
case
"queryExpertRegCommunicationLogs"
:
//获取沟通记录
opResult
=
await
this
.
regCenterOrder
.
queryExpertRegCommunicationLogs
(
pobj
);
opResult
=
await
this
.
regCenterOrder
Sve
.
queryExpertRegCommunicationLogs
(
pobj
);
break
;
case
"updateOrdertatus"
:
//提交交付信息/修改订单状态
opResult
=
await
this
.
regCenterOrder
.
update
Ordertatus
(
pobj
);
case
"update
Reg
Ordertatus"
:
//提交交付信息/修改订单状态
opResult
=
await
this
.
regCenterOrder
Sve
.
updateReg
Ordertatus
(
pobj
);
break
;
case
"close
Bd
RegNeed"
:
//需求关闭
opResult
=
await
this
.
regCenterOrder
.
closeBd
RegNeed
(
pobj
);
case
"closeRegNeed"
:
//需求关闭
opResult
=
await
this
.
regCenterOrder
Sve
.
close
RegNeed
(
pobj
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
...
...
@@ -68,4 +69,4 @@ class BaiduReg extends APIBase {
return
opResult
;
}
}
module
.
exports
=
BaiduReg
;
\ No newline at end of file
module
.
exports
=
RegAPI
;
\ No newline at end of file
center-order/app/base/service/impl/qcutils/regCenterOrderSve.js
View file @
8ccd9019
...
...
@@ -312,8 +312,8 @@ class regCenterOrderService {
}
//提交方案
async
submit
Bd
RegSolution
(
pobj
)
{
console
.
log
(
"pobj++submit
Bd
RegSolution++"
,
pobj
)
async
submitRegSolution
(
pobj
)
{
console
.
log
(
"pobj++submitRegSolution++"
,
pobj
)
var
ab
=
pobj
.
actionBody
;
var
user
=
pobj
.
userInfo
;
if
(
!
user
||
!
user
.
id
)
{
...
...
@@ -323,9 +323,15 @@ class regCenterOrderService {
if
(
!
ab
.
needNo
)
{
return
system
.
getResultFail
(
-
101
,
"渠道需求号不能为空"
);
}
if
(
!
ab
.
solutionContent
)
{
var
i
=
0
;
if
(
ab
.
solutionList
){
var
solutionListLength
=
ab
.
solutionList
.
length
;
}
for
(
i
=
0
;
i
<
solutionListLength
;
i
++
){
if
(
!
ab
.
solutionList
[
i
].
solutionContent
)
{
return
system
.
getResultFail
(
-
102
,
"方案信息有误"
);
}
}
//获取需求信息
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
where
:
{
channelNeedNo
:
ab
.
needNo
},
raw
:
true
...
...
@@ -337,61 +343,52 @@ class regCenterOrderService {
return
system
.
getResultFail
(
-
202
,
"该方案需求状态为"
+
needinfo
.
statusName
+
",不能创建方案"
);
}
var
bizType
=
needinfo
.
typeCode
;
//ab.solutionContent.bizType;//业务类型
ab
.
solutionContent
.
bizType
=
bizType
;
if
(
!
bizType
)
{
return
system
.
getResultFail
(
-
205
,
"方案类型错误"
);
}
if
(
!
needinfo
.
channelTypeCode
)
{
return
system
.
getResultFail
(
-
206
,
"渠道方案类型错误"
);
}
ab
.
solutionContent
.
typeCode
=
needinfo
.
typeCode
;
ab
.
solutionContent
.
typeName
=
needinfo
.
typeName
;
var
needsolutions
=
[];
//最后返回结果用
var
j
=
0
;
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
;
var
ns
=
await
this
.
needsolutionDao
.
model
.
findAll
({
where
:
{
channelNeedNo
:
ab
.
needNo
},
raw
:
true
,
order
:
[[
"id"
,
'asc'
]]
});
for
(
var
i
=
0
;
i
<
ns
.
length
;
i
++
)
{
var
fa
=
ns
[
i
];
if
(
fa
.
status
==
"dqr"
||
fa
.
status
==
"ywc"
)
{
return
system
.
getResultFail
(
-
207
,
"需求方案已存在,不能重复提交"
);
}
var
k
=
0
;
for
(
k
=
0
;
k
<
ns
.
length
;
k
++
)
{
var
fa
=
ns
[
k
];
// if (fa.status == "dqr" || fa.status == "ywc") {
// return system.getResultFail(-207, "需求方案已存在,不能重复提交");
// }
if
(
fa
.
status
==
"ybh"
)
{
ab
.
channelSolutionNo
=
fa
.
channelSolutionNo
;
ab
.
solutionList
[
j
]
.
channelSolutionNo
=
fa
.
channelSolutionNo
;
}
if
(
fa
.
status
==
"yzf"
)
{
ab
.
channelSolutionNo
=
""
;
}
}
var
solution
=
ab
.
solutionContent
.
solution
;
if
(
!
solution
)
{
return
system
.
getResultFail
(
-
103
,
"方案交付信息有误"
);
}
if
(
!
needinfo
.
channelTypeCode
)
{
return
system
.
getResultFail
(
-
104
,
"需求业务类型有误"
);
ab
.
solutionList
[
j
].
channelSolutionNo
=
""
;
}
if
(
!
solution
.
CompanyName
)
{
return
system
.
getResultFail
(
-
105
,
"公司名不能为空"
);
}
if
(
!
solution
.
LicenseType
)
{
return
system
.
getResultFail
(
-
106
,
"业务类型不能为空"
);
}
if
(
!
solution
.
Area
)
{
return
system
.
getResultFail
(
-
107
,
"区域不能为空"
);
}
if
(
!
solution
.
ActionType
)
{
return
system
.
getResultFail
(
-
108
,
"办理类型不能为空"
);
}
var
solutionFlowList
=
ab
.
solutionContent
.
solutionFlowList
||
[];
// var solution = ab.solutionList[j].solutionContent.solution;
var
solutionFlowList
=
ab
.
solutionList
[
j
].
solutionContent
.
solutionFlowList
||
[];
solutionFlowList
.
push
({
status
:
"SOLUTION_SUBMIT"
,
statusName
:
this
.
regSolutionStatus
.
SOLUTION_SUBMIT
,
updated_at
:
new
Date
()
});
ab
.
solutionContent
.
status
=
"SOLUTION_SUBMIT"
;
ab
.
solutionContent
.
statusName
=
this
.
regSolutionStatus
.
SOLUTION_SUBMIT
;
ab
.
solutionContent
.
solutionFlowList
=
solutionFlowList
;
ab
[
"channelNeedNo"
]
=
needinfo
.
channelNeedNo
;
var
solutionNo
=
await
this
.
getBusUid
(
"ns"
);
ab
[
"solutionNo"
]
=
solutionNo
;
ab
[
"status"
]
=
"dqr"
;
ab
.
solutionList
[
j
].
solutionContent
.
status
=
"SOLUTION_SUBMIT"
;
ab
.
solutionList
[
j
].
solutionContent
.
statusName
=
this
.
regSolutionStatus
.
SOLUTION_SUBMIT
;
ab
.
solutionList
[
j
].
solutionContent
.
solutionFlowList
=
solutionFlowList
;
ab
.
solutionList
[
j
][
"channelNeedNo"
]
=
needinfo
.
channelNeedNo
;
// var solutionNo = await this.getBusUid("ns");//chuangjian
var
solutionNo
=
[];
//chuangjian
solutionNo
[
j
]
=
await
this
.
getBusUid
(
"ns"
)
console
.
log
(
'solutionNo[j]----'
,
solutionNo
[
j
])
ab
.
solutionList
[
j
][
"solutionNo"
]
=
solutionNo
[
j
];
ab
.
solutionList
[
j
][
"status"
]
=
"dqr"
;
var
customerInfo
=
{
//客户信息
"publishName"
:
needinfo
.
publishName
,
"publishMobile"
:
needinfo
.
publishMobile
...
...
@@ -402,14 +399,15 @@ class regCenterOrderService {
"salesmanId"
:
user
.
id
,
"salesmanChannelId"
:
user
.
channel_userid
};
ab
.
solutionContent
[
"customerInfo"
]
=
customerInfo
;
ab
.
solutionContent
[
"salesmanInfo"
]
=
salesmanInfo
;
ab
.
solutionContent
.
solution
.
SolutionPrice
=
(
ab
.
solutionContent
.
solution
.
SolutionPrice
)
/
100
||
""
;
//分转元
ab
.
solutionContent
=
JSON
.
stringify
(
ab
.
solutionContent
);
ab
.
solutionList
[
j
].
solutionContent
[
"customerInfo"
]
=
customerInfo
;
ab
.
solutionList
[
j
].
solutionContent
[
"salesmanInfo"
]
=
salesmanInfo
;
ab
.
solutionList
[
j
].
solutionContent
.
solution
.
solutionPrice
=
(
ab
.
solutionList
[
j
].
solutionContent
.
solution
.
solutionPrice
)
/
100
||
""
;
//分转元
ab
.
solutionList
[
j
].
solutionContent
=
JSON
.
stringify
(
ab
.
solutionList
[
j
].
solutionContent
);
console
.
log
(
'abababab---+++---++'
,
ab
)
var
self
=
this
;
return
await
this
.
needsolutionDao
.
db
.
transaction
(
async
function
(
t
)
{
ab
[
"needNo"
]
=
needinfo
.
needNo
;
var
od
=
await
self
.
needsolutionDao
.
create
(
ab
,
t
);
var
res
=
await
this
.
needsolutionDao
.
db
.
transaction
(
async
function
(
t
)
{
ab
.
solutionList
[
j
]
[
"needNo"
]
=
needinfo
.
needNo
;
var
od
=
await
self
.
needsolutionDao
.
create
(
ab
.
solutionList
[
j
]
,
t
);
if
(
od
&&
od
.
id
)
{
var
needObj
=
{
id
:
needinfo
.
id
...
...
@@ -426,7 +424,7 @@ class regCenterOrderService {
if
(
!
needinfo
.
followContent
)
{
var
followContent
=
[{
followDate
:
new
Date
(),
content
:
"nc
提交方案"
content
:
"reg
提交方案"
}];
followContent
=
JSON
.
stringify
(
followContent
);
needObj
[
"followContent"
]
=
followContent
;
...
...
@@ -435,12 +433,20 @@ class regCenterOrderService {
needinfo
=
await
self
.
needinfoDao
.
model
.
findOne
({
where
:
{
id
:
needinfo
.
id
},
raw
:
true
});
return
system
.
getResultSuccess
({
needinfo
:
needinfo
,
needsolution
:
od
});
}
else
{
return
system
.
getResultFail
(
-
302
,
"提交方案失败"
);
//
return system.getResultSuccess({ needinfo: needinfo, needsolution: od });
needsolutions
.
push
(
od
.
dataValues
)
console
.
log
(
'needsolutions-------'
,
needsolutions
)
}
// else {
// return system.getResultFail(-302, "提交方案失败");
// }
})
}
}
return
system
.
getResultSuccess
({
needinfo
:
needinfo
,
needsolutions
:
needsolutions
});
}
//交付商通知状态变更
async
ncNotification
(
pobj
)
{
...
...
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