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
aa2e4462
Commit
aa2e4462
authored
Jun 08, 2022
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改结果
parent
cae4c9f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
297 additions
and
287 deletions
+297
-287
center-order/app/base/service/impl/qcutils/baiduqcSve.js
+297
-287
No files found.
center-order/app/base/service/impl/qcutils/baiduqcSve.js
View file @
aa2e4462
const
system
=
require
(
"../../../system"
);
const
system
=
require
(
"../../../system"
);
const
moment
=
require
(
'moment'
)
const
moment
=
require
(
'moment'
)
/**
/**
* 百度增值电信相关接口(ICP、EDI)
* 百度增值电信相关接口(ICP、EDI)
* created by zhuangbing
* created by zhuangbing
* created at 2020.07.27
* created at 2020.07.27
*/
*/
class
BaiduQcService
{
class
BaiduQcService
{
constructor
()
{
constructor
()
{
this
.
needsolutionDao
=
system
.
getObject
(
"db.dbneed.needsolutionDao"
);
this
.
needsolutionDao
=
system
.
getObject
(
"db.dbneed.needsolutionDao"
);
this
.
needinfoDao
=
system
.
getObject
(
"db.dbneed.needinfoDao"
);
this
.
needinfoDao
=
system
.
getObject
(
"db.dbneed.needinfoDao"
);
this
.
orderinfoDao
=
system
.
getObject
(
"db.dbcorder.orderinfoDao"
);
this
.
orderinfoDao
=
system
.
getObject
(
"db.dbcorder.orderinfoDao"
);
this
.
icpSolutionStatusReference
=
{
this
.
icpSolutionStatusReference
=
{
SOLUTION_SUBMIT
:
"提交服务单"
,
SOLUTION_SUBMIT
:
"提交服务单"
,
UN_PAID
:
"未支付"
,
PAID
:
"用户支付"
,
USER_UPLOADED
:
"用户上传资料"
,
MATERIAL_UNCONFIRM
:
"服务商递交⽂件"
UN_PAID
:
"未支付"
,
PAID
:
"用户支付"
,
USER_UPLOADED
:
"用户上传资料"
,
MATERIAL_UNCONFIRM
:
"服务商递交⽂件"
,
USER_CONFIRMED
:
"⽤户已确认递交⽂件"
,
ACCOUNT_REGISTERED
:
"完成账户注册"
,
MATERIAL_SUBMITTED
:
"完成资料递交"
,
,
USER_CONFIRMED
:
"⽤户已确认递交⽂件"
,
ACCOUNT_REGISTERED
:
"完成账户注册"
,
MATERIAL_SUBMITTED
:
"完成资料递交"
,
GXB_ACCEPT
:
"⼯信部已受理"
,
GXB_REFUSE
:
"⼯信部不予受理"
,
GXB_FAIL
:
"⼯信部未通过"
,
GXB_SUCCESS
:
"工信部通过"
GXB_ACCEPT
:
"⼯信部已受理"
,
GXB_REFUSE
:
"⼯信部不予受理"
,
GXB_FAIL
:
"⼯信部未通过"
,
GXB_SUCCESS
:
"工信部通过"
,
CLOSE
:
"方案关闭"
,
CLOSE
:
"方案关闭"
};
};
this
.
ediSolutionStatusReference
=
{
this
.
ediSolutionStatusReference
=
{
SOLUTION_SUBMIT
:
"服务单通知服务商"
,
SOLUTION_SUBMIT
:
"服务单通知服务商"
,
USER_PAY_PRODUCE
:
"⽤户⽀付"
,
USER_PAY_PRODUCE
:
"⽤户⽀付"
,
USER_CONFIRM_PRODUCE
:
"⽤户确认资料"
,
USER_CONFIRM_PRODUCE
:
"⽤户确认资料"
,
USER_REFUSE_PRODUCE
:
"资料退回修改"
,
USER_REFUSE_PRODUCE
:
"资料退回修改"
,
ABC_CLOSE_PRODUCE
:
"⼩⼆后台关闭服务单"
,
ABC_CLOSE_PRODUCE
:
"⼩⼆后台关闭服务单"
,
USER_UPLOAD_PRODUCE
:
"⽤户补充基本资料"
USER_UPLOAD_PRODUCE
:
"⽤户补充基本资料"
};
};
this
.
ediProduceStatus
=
{
this
.
ediProduceStatus
=
{
110
:
"⽤户⽀付"
,
110
:
"⽤户⽀付"
,
30
:
"待⽤户确认"
,
30
:
"待⽤户确认"
,
105
:
"账户已注册"
,
105
:
"账户已注册"
,
35
:
"待提交审核"
,
35
:
"待提交审核"
,
109
:
"管局已通过"
,
109
:
"管局已通过"
,
106
:
"材料已递交⼯信部"
,
106
:
"材料已递交⼯信部"
,
10
:
"已⽀付"
,
10
:
"已⽀付"
,
108
:
"管局不予受理"
,
108
:
"管局不予受理"
,
0
:
"初始状态"
,
0
:
"初始状态"
,
50
:
"订单关闭"
,
50
:
"订单关闭"
,
25
:
"待⽤户提交材料"
,
25
:
"待⽤户提交材料"
,
107
:
"管局已受理"
107
:
"管局已受理"
};
};
this
.
icpApplicationStatusReference
=
{
this
.
icpApplicationStatusReference
=
{
507
:
"完成账户注册"
,
507
:
"完成账户注册"
,
508
:
"服务商完成提交资料到⼯信部"
,
508
:
"服务商完成提交资料到⼯信部"
,
509
:
"⼯商部已受理"
,
509
:
"⼯商部已受理"
,
510
:
"⼯商部不予受理"
,
510
:
"⼯商部不予受理"
,
511
:
"⼯商部通过"
,
511
:
"⼯商部通过"
,
512
:
"⼯商部未通过"
512
:
"⼯商部未通过"
};
};
//(文网文状态2020-9-26)
//(文网文状态2020-9-26)
this
.
wangwenStatusReference
=
{
this
.
wangwenStatusReference
=
{
601
:
"服务商提交资料"
,
601
:
"服务商提交资料"
,
602
:
"完成账户注册"
,
602
:
"完成账户注册"
,
603
:
"服务商完成提交资料到⼯信部"
,
603
:
"服务商完成提交资料到⼯信部"
,
604
:
"⼯商部已受理"
,
604
:
"⼯商部已受理"
,
605
:
"⼯商部不予受理"
,
605
:
"⼯商部不予受理"
,
606
:
"⼯商部通过"
,
606
:
"⼯商部通过"
,
607
:
"⼯商部未通过"
,
607
:
"⼯商部未通过"
,
608
:
"用户驳回"
608
:
"用户驳回"
};
};
//(文网文状态2020-9-26)
//(文网文状态2020-9-26)
this
.
wangwenSolutionStatusReference
=
{
this
.
wangwenSolutionStatusReference
=
{
"SOLUTION_SUBMIT"
:
"提交服务单"
,
"SOLUTION_SUBMIT"
:
"提交服务单"
,
"PARTNER_SUBMIT_MATERIAL"
:
"服务商提交资料"
,
"PARTNER_SUBMIT_MATERIAL"
:
"服务商提交资料"
,
"CERT_ACCOUNT_REGISTERED"
:
"完成账户注册"
,
"CERT_ACCOUNT_REGISTERED"
:
"完成账户注册"
,
"CERT_MATERIAL_SUBMITTED"
:
"服务商完成提交资料到⼯信部"
,
"CERT_MATERIAL_SUBMITTED"
:
"服务商完成提交资料到⼯信部"
,
"CERT_GXB_ACCEPT"
:
"⼯商部已受理"
,
"CERT_GXB_ACCEPT"
:
"⼯商部已受理"
,
"CERT_GXB_SUCCESS"
:
"⼯商部通过"
,
"CERT_GXB_SUCCESS"
:
"⼯商部通过"
,
"CERT_GXB_FAIL"
:
"⼯商部未通过"
,
"CERT_GXB_FAIL"
:
"⼯商部未通过"
,
"CERT_GXB_REFUSE"
:
"⼯商部不予受理"
"CERT_GXB_REFUSE"
:
"⼯商部不予受理"
};
};
}
//接收渠道方案状态变更通知
async
receiveOrderStatusNotify
(
pobj
)
{
var
ab
=
pobj
.
actionBody
;
if
(
!
ab
.
BizId
)
{
return
system
.
getResultFail
(
-
101
,
"渠道方案号不能为空"
);
}
if
(
!
ab
.
status
)
{
return
system
.
getResultFail
(
-
102
,
"方案状态不能为空"
);
}
if
(
ab
.
isDirectBuy
&&
ab
.
isDirectBuy
==
1
&&
ab
.
status
==
1
){
//直接下单,无方案 直接返回
return
system
.
getResultSuccess
();
}
//获取方案信息
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
channelSolutionNo
:
ab
.
BizId
,
isInvalid
:
0
},
raw
:
true
});
if
(
!
ns
||
!
ns
.
id
)
{
return
system
.
getResultFail
(
-
102
,
"未知方案"
);
}
}
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
where
:
{
needNo
:
ns
.
needNo
},
raw
:
true
//接收渠道方案状态变更通知
});
async
receiveOrderStatusNotify
(
pobj
)
{
if
(
!
needinfo
)
{
var
ab
=
pobj
.
actionBody
;
return
system
.
getResultFail
(
-
104
,
"未知方案需求"
);
if
(
!
ab
.
BizId
)
{
}
return
system
.
getResultFail
(
-
101
,
"渠道方案号不能为空"
);
if
(
needinfo
.
status
==
"ygb"
)
{
}
return
system
.
getResultFail
(
-
105
,
"该方案需求状态为"
+
needinfo
.
statusName
+
",不能执行此操作"
);
if
(
!
ab
.
status
)
{
}
return
system
.
getResultFail
(
-
102
,
"方案状态不能为空"
);
var
solutionContent
=
ns
.
solutionContent
;
}
var
checkStatus
=
{
if
(
ab
.
isDirectBuy
&&
ab
.
isDirectBuy
==
1
&&
ab
.
status
==
1
)
{
//直接下单,无方案 直接返回
ACCOUNT_REGISTERED
:
"完成账户注册"
,
MATERIAL_SUBMITTED
:
"完成资料递交"
,
return
system
.
getResultSuccess
();
GXB_ACCEPT
:
"⼯信部已受理"
,
GXB_REFUSE
:
"⼯信部不予受理"
,
GXB_FAIL
:
"⼯信部未通过"
,
GXB_SUCCESS
:
"工信部通过"
}
,
CLOSE
:
"方案关闭"
//获取方案信息
};
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
if
(
solutionContent
.
status
&&
checkStatus
[
solutionContent
.
status
])
{
where
:
{
channelSolutionNo
:
ab
.
BizId
,
isInvalid
:
0
},
raw
:
true
return
system
.
getResultFail
(
-
111
,
"方案已进入"
+
solutionContent
.
statusName
+
"流程,不能执行此操作"
);
});
if
(
!
ns
||
!
ns
.
id
)
{
return
system
.
getResultFail
(
-
102
,
"未知方案"
);
}
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
where
:
{
needNo
:
ns
.
needNo
},
raw
:
true
});
if
(
!
needinfo
)
{
return
system
.
getResultFail
(
-
104
,
"未知方案需求"
);
}
if
(
needinfo
.
status
==
"ygb"
)
{
return
system
.
getResultFail
(
-
105
,
"该方案需求状态为"
+
needinfo
.
statusName
+
",不能执行此操作"
);
}
var
solutionContent
=
ns
.
solutionContent
;
var
checkStatus
=
{
ACCOUNT_REGISTERED
:
"完成账户注册"
,
MATERIAL_SUBMITTED
:
"完成资料递交"
,
GXB_ACCEPT
:
"⼯信部已受理"
,
GXB_REFUSE
:
"⼯信部不予受理"
,
GXB_FAIL
:
"⼯信部未通过"
,
GXB_SUCCESS
:
"工信部通过"
,
CLOSE
:
"方案关闭"
};
if
(
solutionContent
.
status
&&
checkStatus
[
solutionContent
.
status
])
{
return
system
.
getResultFail
(
-
111
,
"方案已进入"
+
solutionContent
.
statusName
+
"流程,不能执行此操作"
);
}
//方案流程列表
var
solutionFlowList
=
solutionContent
.
solutionFlowList
||
[];
if
(
ab
.
status
==
"1"
)
{
//⽤户已支付
var
afterStatusList
=
[
//用户支付后的流程状态
"USER_UPLOADED"
,
"MATERIAL_UNCONFIRM"
,
"USER_CONFIRMED"
,
"ACCOUNT_REGISTERED"
,
"MATERIAL_SUBMITTED"
,
"GXB_ACCEPT"
,
"GXB_REFUSE"
,
"GXB_FAIL"
,
"GXB_SUCCESS"
,
"CLOSE"
];
if
(
!
solutionContent
.
status
||
afterStatusList
.
indexOf
(
solutionContent
.
status
)
<
0
)
{
solutionFlowList
.
push
({
status
:
"PAID"
,
statusName
:
this
.
icpSolutionStatusReference
.
PAID
,
updated_at
:
new
Date
()
});
solutionContent
.
status
=
"PAID"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
PAID
;
}
// 2020 0826 lin修改 n_need_info status为ycd 已成单
let
needObj
=
{
id
:
needinfo
.
id
,
status
:
"ycd"
}
await
this
.
needinfoDao
.
update
(
needObj
);
//关闭需求
}
else
if
(
ab
.
status
==
"2"
)
{
//⽤户已上传
if
(
solutionContent
.
status
==
"USER_CONFIRMED"
)
{
//防止用户确认后又否决
return
system
.
getResultFail
(
-
112
,
"操作失败,⽤户已确认递交⽂件"
);
}
solutionFlowList
.
push
({
status
:
"USER_UPLOADED"
,
statusName
:
this
.
icpSolutionStatusReference
.
USER_UPLOADED
,
updated_at
:
new
Date
()
});
solutionContent
.
status
=
"USER_UPLOADED"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
USER_UPLOADED
;
}
else
if
(
ab
.
status
==
"4"
)
{
//⽤户已确认
if
(
solutionContent
.
status
!=
"MATERIAL_UNCONFIRM"
)
{
return
system
.
getResultFail
(
-
113
,
"操作失败,服务商递交⽂件后才能执行此操作"
);
}
solutionFlowList
.
push
({
status
:
"USER_CONFIRMED"
,
statusName
:
this
.
icpSolutionStatusReference
.
USER_CONFIRMED
,
updated_at
:
new
Date
()
});
solutionContent
.
status
=
"USER_CONFIRMED"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
USER_CONFIRMED
;
}
else
if
(
ab
.
status
==
"11"
)
{
//⽅案已关闭
solutionFlowList
.
push
({
status
:
"CLOSE"
,
statusName
:
this
.
icpSolutionStatusReference
.
CLOSE
,
updated_at
:
new
Date
()
});
solutionContent
.
status
=
"CLOSE"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
CLOSE
;
}
else
{
return
system
.
getResultFail
(
-
110
,
"状态错误-4"
);
}
solutionContent
.
solutionFlowList
=
solutionFlowList
;
var
material
=
solutionContent
.
customerMaterial
||
{};
if
(
ab
.
remark
)
{
solutionContent
.
customerRemark
=
ab
.
remark
;
}
if
(
ab
.
newbusinessLicense
)
{
material
.
businessLicense
=
ab
.
newbusinessLicense
;
material
.
aliBusinessLicense
=
ab
.
businessLicense
;
}
if
(
ab
.
newidCardUrlList
&&
ab
.
newidCardUrlList
.
length
>
0
)
{
material
.
idCardUrlList
=
ab
.
newidCardUrlList
;
material
.
aliIdCardUrlList
=
ab
.
idCardUrlList
;
}
if
(
ab
.
newuserPlan
)
{
material
.
userPlan
=
ab
.
newuserPlan
;
material
.
aliUserPlan
=
ab
.
userPlan
;
}
if
(
ab
.
newuserForeig
)
{
material
.
userForeig
=
ab
.
newuserForeig
;
material
.
aliUserForeig
=
ab
.
userForeig
;
}
if
(
ab
.
newuserLaw
)
{
material
.
userLaw
=
ab
.
newuserLaw
;
material
.
aliUserLaw
=
ab
.
userLaw
;
}
if
(
ab
.
newuserOtherList
&&
ab
.
newuserOtherList
.
length
>
0
)
{
material
.
userOtherList
=
ab
.
newuserOtherList
;
material
.
aliUserOtherList
=
ab
.
userOtherList
;
}
solutionContent
.
customerMaterial
=
material
;
solutionContent
=
JSON
.
stringify
(
solutionContent
);
var
updateObj
=
{
id
:
ns
.
id
,
solutionContent
:
solutionContent
};
if
(
ab
.
status
==
"11"
)
{
//⽅案已关闭
updateObj
[
"status"
]
=
"yzf"
;
updateObj
[
"isInvalid"
]
=
1
;
}
await
this
.
needsolutionDao
.
update
(
updateObj
);
//方案状态修改
var
new_ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
id
:
ns
.
id
},
raw
:
true
});
return
system
.
getResultSuccess
(
ns
);
}
}
//方案流程列表
var
solutionFlowList
=
solutionContent
.
solutionFlowList
||
[];
//关闭ICP订单 百度icp 2.4
if
(
ab
.
status
==
"1"
)
{
//⽤户已支付
async
icpOrderClose
(
pobj
)
{
var
afterStatusList
=
[
//用户支付后的流程状态
var
ab
=
pobj
.
actionBody
;
"USER_UPLOADED"
,
"MATERIAL_UNCONFIRM"
,
"USER_CONFIRMED"
,
"ACCOUNT_REGISTERED"
,
if
(
!
ab
.
orderNo
)
{
"MATERIAL_SUBMITTED"
,
"GXB_ACCEPT"
,
"GXB_REFUSE"
,
"GXB_FAIL"
,
"GXB_SUCCESS"
,
"CLOSE"
return
system
.
getResultFail
(
-
101
,
"渠道订单号不能为空"
);
];
}
if
(
!
solutionContent
.
status
||
afterStatusList
.
indexOf
(
solutionContent
.
status
)
<
0
){
var
orderInfo
=
await
this
.
orderinfoDao
.
model
.
findOne
({
where
:
{
channelOrderNo
:
ab
.
orderNo
},
raw
:
true
});
if
(
!
orderInfo
||
!
orderInfo
.
id
)
{
return
system
.
getResultFail
(
-
103
,
"未知订单"
);
}
//获取方案信息
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
orderNo
:
orderInfo
.
orderNo
,
isInvalid
:
0
},
raw
:
true
});
if
(
!
ns
||
!
ns
.
id
)
{
return
system
.
getResultFail
(
-
102
,
"未知方案"
);
}
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
where
:
{
needNo
:
ns
.
needNo
},
raw
:
true
});
var
solutionContent
=
ns
.
solutionContent
;
var
checkStatus
=
{
MATERIAL_UNCONFIRM
:
"服务商递交文件"
,
ACCOUNT_REGISTERED
:
"完成账户注册"
,
MATERIAL_SUBMITTED
:
"完成资料递交"
,
GXB_ACCEPT
:
"⼯信部已受理"
,
GXB_REFUSE
:
"⼯信部不予受理"
,
GXB_FAIL
:
"⼯信部未通过"
,
GXB_SUCCESS
:
"工信部通过"
};
if
(
solutionContent
.
status
&&
checkStatus
[
solutionContent
.
status
])
{
return
system
.
getResultFail
(
-
111
,
"方案已进入"
+
solutionContent
.
statusName
+
"流程,不能执行此操作"
);
}
//方案流程列表
var
solutionFlowList
=
solutionContent
.
solutionFlowList
||
[];
solutionFlowList
.
push
({
solutionFlowList
.
push
({
status
:
"PAID"
,
statusName
:
this
.
icpSolutionStatusReference
.
PAID
,
updated_at
:
new
Date
()
status
:
"CLOSE"
,
statusName
:
this
.
icpSolutionStatusReference
.
CLOSE
,
updated_at
:
new
Date
()
});
});
solutionContent
.
status
=
"PAID"
;
solutionContent
.
status
=
"CLOSE"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
PAID
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
CLOSE
;
}
solutionContent
.
solutionFlowList
=
solutionFlowList
;
// 2020 0826 lin修改 n_need_info status为ycd 已成单
if
(
ab
.
remark
)
{
let
needObj
=
{
solutionContent
.
customerRemark
=
ab
.
remark
;
id
:
needinfo
.
id
,
status
:
"ycd"
}
}
solutionContent
=
JSON
.
stringify
(
solutionContent
);
await
this
.
needinfoDao
.
update
(
needObj
);
//关闭需求
var
updateObj
=
{
}
else
if
(
ab
.
status
==
"2"
)
{
//⽤户已上传
id
:
ns
.
id
,
solutionContent
:
solutionContent
,
status
:
"yzf"
,
isInvalid
:
1
if
(
solutionContent
.
status
==
"USER_CONFIRMED"
)
{
//防止用户确认后又否决
};
return
system
.
getResultFail
(
-
112
,
"操作失败,⽤户已确认递交⽂件"
);
var
self
=
this
;
}
return
await
this
.
needsolutionDao
.
db
.
transaction
(
async
function
(
t
)
{
solutionFlowList
.
push
({
await
self
.
needsolutionDao
.
update
(
updateObj
);
//方案状态修改
status
:
"USER_UPLOADED"
,
statusName
:
this
.
icpSolutionStatusReference
.
USER_UPLOADED
,
updated_at
:
new
Date
()
if
(
ab
.
isNewMethod
&&
ab
.
isNewMethod
==
1
)
{
});
await
this
.
orderinfoDao
.
update
({
id
:
orderInfo
.
id
,
orderStatus
:
16
});
//订单状态修改
solutionContent
.
status
=
"USER_UPLOADED"
;
}
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
USER_UPLOADED
;
let
new_ns
=
await
self
.
needsolutionDao
.
model
.
findOne
({
}
else
if
(
ab
.
status
==
"4"
)
{
//⽤户已确认
where
:
{
id
:
ns
.
id
},
raw
:
true
if
(
solutionContent
.
status
!=
"MATERIAL_UNCONFIRM"
)
{
});
return
system
.
getResultFail
(
-
113
,
"操作失败,服务商递交⽂件后才能执行此操作"
);
return
system
.
getResultSuccess
(
new_ns
);
}
})
solutionFlowList
.
push
({
status
:
"USER_CONFIRMED"
,
statusName
:
this
.
icpSolutionStatusReference
.
USER_CONFIRMED
,
updated_at
:
new
Date
()
});
solutionContent
.
status
=
"USER_CONFIRMED"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
USER_CONFIRMED
;
}
else
if
(
ab
.
status
==
"11"
)
{
//⽅案已关闭
solutionFlowList
.
push
({
status
:
"CLOSE"
,
statusName
:
this
.
icpSolutionStatusReference
.
CLOSE
,
updated_at
:
new
Date
()
});
solutionContent
.
status
=
"CLOSE"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
CLOSE
;
}
else
{
return
system
.
getResultFail
(
-
110
,
"状态错误-4"
);
}
solutionContent
.
solutionFlowList
=
solutionFlowList
;
var
material
=
solutionContent
.
customerMaterial
||
{};
if
(
ab
.
remark
)
{
solutionContent
.
customerRemark
=
ab
.
remark
;
}
}
if
(
ab
.
newbusinessLicense
)
{
material
.
businessLicense
=
ab
.
newbusinessLicense
;
//添加业务员信息,用于直接下单的icp订单
material
.
aliBusinessLicense
=
ab
.
businessLicense
;
async
addIcpSalesmanInfo
(
pobj
)
{
}
var
ab
=
pobj
.
actionBody
;
if
(
ab
.
newidCardUrlList
&&
ab
.
newidCardUrlList
.
length
>
0
)
{
if
(
!
ab
.
orderNo
)
{
material
.
idCardUrlList
=
ab
.
newidCardUrlList
;
return
system
.
getResultFail
(
-
101
,
"订单号不能为空"
);
material
.
aliIdCardUrlList
=
ab
.
idCardUrlList
;
}
}
var
salesmanObj
=
ab
.
salesmanInfo
;
if
(
ab
.
newuserPlan
)
{
//获取方案信息
material
.
userPlan
=
ab
.
newuserPlan
;
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
material
.
aliUserPlan
=
ab
.
userPlan
;
where
:
{
orderNo
:
ab
.
orderNo
,
isInvalid
:
0
},
raw
:
true
}
});
if
(
ab
.
newuserForeig
)
{
if
(
!
ns
||
!
ns
.
id
)
{
material
.
userForeig
=
ab
.
newuserForeig
;
return
system
.
getResultFail
(
-
102
,
"未知方案"
);
material
.
aliUserForeig
=
ab
.
userForeig
;
}
}
var
solutionContent
=
ns
.
solutionContent
;
if
(
ab
.
newuserLaw
)
{
solutionContent
.
salesmanInfo
=
salesmanObj
;
material
.
userLaw
=
ab
.
newuserLaw
;
var
updateObj
=
{
id
:
ns
.
id
,
solutionContent
:
JSON
.
stringify
(
solutionContent
)}
material
.
aliUserLaw
=
ab
.
userLaw
;
await
this
.
needsolutionDao
.
update
(
updateObj
);
//方案状态修改
}
return
system
.
getResultSuccess
(
solutionContent
);
if
(
ab
.
newuserOtherList
&&
ab
.
newuserOtherList
.
length
>
0
)
{
material
.
userOtherList
=
ab
.
newuserOtherList
;
material
.
aliUserOtherList
=
ab
.
userOtherList
;
}
solutionContent
.
customerMaterial
=
material
;
solutionContent
=
JSON
.
stringify
(
solutionContent
);
var
updateObj
=
{
id
:
ns
.
id
,
solutionContent
:
solutionContent
};
if
(
ab
.
status
==
"11"
)
{
//⽅案已关闭
updateObj
[
"status"
]
=
"yzf"
;
updateObj
[
"isInvalid"
]
=
1
;
}
await
this
.
needsolutionDao
.
update
(
updateObj
);
//方案状态修改
var
new_ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
id
:
ns
.
id
},
raw
:
true
});
return
system
.
getResultSuccess
(
ns
);
}
//关闭ICP订单 百度icp 2.4
async
icpOrderClose
(
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
});
if
(
!
orderInfo
||
!
orderInfo
.
id
)
{
return
system
.
getResultFail
(
-
103
,
"未知订单"
);
}
//获取方案信息
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
orderNo
:
orderInfo
.
orderNo
,
isInvalid
:
0
},
raw
:
true
});
if
(
!
ns
||
!
ns
.
id
)
{
return
system
.
getResultFail
(
-
102
,
"未知方案"
);
}
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
where
:
{
needNo
:
ns
.
needNo
},
raw
:
true
});
var
solutionContent
=
ns
.
solutionContent
;
var
checkStatus
=
{
MATERIAL_UNCONFIRM
:
"服务商递交文件"
,
ACCOUNT_REGISTERED
:
"完成账户注册"
,
MATERIAL_SUBMITTED
:
"完成资料递交"
,
GXB_ACCEPT
:
"⼯信部已受理"
,
GXB_REFUSE
:
"⼯信部不予受理"
,
GXB_FAIL
:
"⼯信部未通过"
,
GXB_SUCCESS
:
"工信部通过"
};
if
(
solutionContent
.
status
&&
checkStatus
[
solutionContent
.
status
])
{
return
system
.
getResultFail
(
-
111
,
"方案已进入"
+
solutionContent
.
statusName
+
"流程,不能执行此操作"
);
}
//方案流程列表
var
solutionFlowList
=
solutionContent
.
solutionFlowList
||
[];
solutionFlowList
.
push
({
status
:
"CLOSE"
,
statusName
:
this
.
icpSolutionStatusReference
.
CLOSE
,
updated_at
:
new
Date
()
});
solutionContent
.
status
=
"CLOSE"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
CLOSE
;
solutionContent
.
solutionFlowList
=
solutionFlowList
;
if
(
ab
.
remark
)
{
solutionContent
.
customerRemark
=
ab
.
remark
;
}
solutionContent
=
JSON
.
stringify
(
solutionContent
);
var
updateObj
=
{
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 this.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
);
})
}
//添加业务员信息,用于直接下单的icp订单
async
addIcpSalesmanInfo
(
pobj
)
{
var
ab
=
pobj
.
actionBody
;
if
(
!
ab
.
orderNo
)
{
return
system
.
getResultFail
(
-
101
,
"订单号不能为空"
);
}
var
salesmanObj
=
ab
.
salesmanInfo
;
//获取方案信息
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
orderNo
:
ab
.
orderNo
,
isInvalid
:
0
},
raw
:
true
});
if
(
!
ns
||
!
ns
.
id
)
{
return
system
.
getResultFail
(
-
102
,
"未知方案"
);
}
}
var
solutionContent
=
ns
.
solutionContent
;
solutionContent
.
salesmanInfo
=
salesmanObj
;
var
updateObj
=
{
id
:
ns
.
id
,
solutionContent
:
JSON
.
stringify
(
solutionContent
)}
await
this
.
needsolutionDao
.
update
(
updateObj
);
//方案状态修改
return
system
.
getResultSuccess
(
solutionContent
);
}
// //易名退款2021-3-23
// async eNameCloseOrder(pobj){
// console.log('order----eNameCloseOrder',pobj)
// let orderNo
// let note
// orderNo = pobj.actionBody.orderNo
// note = pobj.actionBody.note
// if(!orderNo){
// return system.getResultFail(-1011, "订单号不能为空");
// }
// if(!note){
// return system.getResultFail(-1012, "订单关闭理由不能为空");
// }
// let orderInfo = await this.orderinfoDao.model.findOne({
// where: { channelOrderNo: orderNo }, raw: true
// });
// let UpdateObj = {
// //易名退款2021-3-23
// id: orderInfo.id,
// async eNameCloseOrder(pobj){
// orderStatus: 16,
// console.log('order----eNameCloseOrder',pobj)
// orderStatusName:"已退款"
// let orderNo
// }
// let note
// let res = await this.orderinfoDao.update(UpdateObj);//更新订单
// orderNo = pobj.actionBody.orderNo
// }
// note = pobj.actionBody.note
// if(!orderNo){
// return system.getResultFail(-1011, "订单号不能为空");
// }
// if(!note){
// return system.getResultFail(-1012, "订单关闭理由不能为空");
// }
// let orderInfo = await this.orderinfoDao.model.findOne({
// where: { channelOrderNo: orderNo }, raw: true
// });
// let UpdateObj = {
// id: orderInfo.id,
// orderStatus: 16,
// orderStatusName:"已退款"
// }
// let res = await this.orderinfoDao.update(UpdateObj);//更新订单
// }
}
}
module
.
exports
=
BaiduQcService
;
module
.
exports
=
BaiduQcService
;
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