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
c432ab07
Commit
c432ab07
authored
Mar 17, 2022
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加内容
parent
9840e8b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
185 additions
and
172 deletions
+185
-172
center-order/app/base/service/impl/qcutils/baseqcSve.js
+185
-172
No files found.
center-order/app/base/service/impl/qcutils/baseqcSve.js
View file @
c432ab07
...
...
@@ -8,6 +8,7 @@ const moment = require('moment');
*/
class
BaseQcService
{
constructor
()
{
this
.
execClientNew
=
system
.
getObject
(
"util.execClientNew"
);
this
.
needsolutionDao
=
system
.
getObject
(
"db.dbneed.needsolutionDao"
);
this
.
needinfoDao
=
system
.
getObject
(
"db.dbneed.needinfoDao"
);
this
.
orderinfoDao
=
system
.
getObject
(
"db.dbcorder.orderinfoDao"
);
...
...
@@ -425,201 +426,213 @@ class BaseQcService {
//交付商通知状态变更
async
serviceProviderNotification
(
pobj
)
{
let
ab
=
pobj
.
actionBody
;
if
(
!
pobj
.
userInfo
||
!
pobj
.
userInfo
.
id
)
{
return
system
.
getResultFail
(
-
1100
,
"未知用户"
);
}
if
(
!
ab
.
orderNo
)
{
return
system
.
getResultFail
(
-
1101
,
"订单号不能为空"
);
}
if
(
!
ab
.
status
)
{
return
system
.
getResultFail
(
-
1102
,
"交付状态不能为空"
);
}
else
{
ab
[
"ApplicationStatus"
]
=
ab
.
status
;
}
if
(
ab
.
officialFileURL
)
{
ab
[
"OfficialFileURL"
]
=
ab
.
officialFileURL
;
}
//2021-3-18 addNew
if
(
ab
.
certificateNumber
)
{
ab
[
"CertificateNumber"
]
=
ab
.
certificateNumber
;
}
if
(
ab
.
certificateStartTime
)
{
ab
[
"CertificateStartTime"
]
=
ab
.
certificateStartTime
;
}
if
(
ab
.
certificateEndTime
)
{
ab
[
"CertificateEndTime"
]
=
ab
.
certificateEndTime
;
try
{
let
ab
=
pobj
.
actionBody
;
if
(
!
pobj
.
userInfo
||
!
pobj
.
userInfo
.
id
)
{
return
system
.
getResultFail
(
-
1100
,
"未知用户"
);
}
if
(
!
ab
.
orderNo
)
{
return
system
.
getResultFail
(
-
1101
,
"订单号不能为空"
);
}
if
(
!
ab
.
status
)
{
return
system
.
getResultFail
(
-
1102
,
"交付状态不能为空"
);
}
else
{
ab
[
"ApplicationStatus"
]
=
ab
.
status
;
}
if
(
ab
.
officialFileURL
)
{
ab
[
"OfficialFileURL"
]
=
ab
.
officialFileURL
;
}
//2021-3-18 addNew
if
(
ab
.
certificateNumber
)
{
ab
[
"CertificateNumber"
]
=
ab
.
certificateNumber
;
}
if
(
ab
.
certificateStartTime
)
{
ab
[
"CertificateStartTime"
]
=
ab
.
certificateStartTime
;
}
if
(
ab
.
certificateEndTime
)
{
ab
[
"CertificateEndTime"
]
=
ab
.
certificateEndTime
;
}
pobj
.
actionBody
=
ab
;
return
this
.
acceptIcpPartnerNotification
(
pobj
);
}
catch
(
e
)
{
const
stackStr
=
e
.
stack
?
e
.
stack
:
JSON
.
stringify
(
e
);
this
.
execClientNew
.
execLogs
(
"serviceProviderNotification-reqError:"
,
pobj
,
"center-order-serviceProviderNotification"
,
null
,
stackStr
);
return
system
.
getResultFail
(
-
200
,
"serviceProviderNotification操作异常"
);
}
pobj
.
actionBody
=
ab
;
return
this
.
acceptIcpPartnerNotification
(
pobj
);
}
//服务商通知状态变更
async
acceptIcpPartnerNotification
(
pobj
)
{
let
self
=
this
;
let
ab
=
pobj
.
actionBody
;
let
needSolutionWhere
=
{};
if
(
ab
.
solutionNo
)
{
needSolutionWhere
=
{
solutionNo
:
ab
.
solutionNo
};
}
else
if
(
ab
.
orderNo
)
{
needSolutionWhere
=
{
orderNo
:
ab
.
orderNo
};
}
//获取方案信息
let
needsolutioninfo
=
await
this
.
needsolutionDao
.
model
.
findOne
({
attributes
:
[
"id"
,
"status"
,
"solutionContent"
,
"needNo"
,
"channelNeedNo"
],
where
:
needSolutionWhere
,
raw
:
true
});
if
(
!
needsolutioninfo
||
!
needsolutioninfo
.
id
)
{
return
system
.
getResultFail
(
-
400
,
"未知方案"
);
}
let
solutionContent
=
needsolutioninfo
.
solutionContent
;
if
(
!
solutionContent
)
{
return
system
.
getResultFail
(
-
402
,
"方案交付信息有误"
);
}
if
(
solutionContent
.
applicationStatus
&&
solutionContent
.
applicationStatus
>
ab
.
ApplicationStatus
)
{
return
system
.
getResultFail
(
-
403
,
"操作失败,交付流程未按顺序执行"
);
}
if
(
solutionContent
.
ApplicationStatus
&&
solutionContent
.
ApplicationStatus
==
ab
.
ApplicationStatus
)
{
return
system
.
getResultFail
(
-
405
,
"操作失败,该流程状态已提交,不能重复提交"
);
}
let
solutionFlowList
=
solutionContent
.
solutionFlowList
||
[];
let
orderInfo
=
await
this
.
orderinfoDao
.
model
.
findOne
({
attributes
:
[
"uapp_id"
,
"channelOrderNo"
],
where
:
{
orderNo
:
ab
.
orderNo
},
raw
:
true
})
if
(
!
orderInfo
||
!
orderInfo
.
channelOrderNo
)
{
return
system
.
getResultFail
(
-
406
,
"未知订单"
);
}
let
uapp_id
=
orderInfo
.
uapp_id
;
let
channelOrderNo
=
orderInfo
.
channelOrderNo
if
(
ab
.
ApplicationStatus
==
507
)
{
//完成账户注册
if
(
uapp_id
==
'18'
)
{
if
(
solutionContent
.
status
!=
"USER_CONFIRMED"
)
{
return
system
.
getResultFail
(
-
508
,
"交付流程错误,用户确认递交⽂件后才能执行此操作"
);
}
try
{
let
needSolutionWhere
=
{};
if
(
ab
.
solutionNo
)
{
needSolutionWhere
=
{
solutionNo
:
ab
.
solutionNo
};
}
else
if
(
ab
.
orderNo
)
{
needSolutionWhere
=
{
orderNo
:
ab
.
orderNo
};
}
solutionContent
.
ApplicationStatus
=
507
;
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"ACCOUNT_REGISTERED"
,
statusName
:
this
.
icpSolutionStatusReference
.
ACCOUNT_REGISTERED
,
updated_at
:
new
Date
()
});
solutionContent
.
status
=
"ACCOUNT_REGISTERED"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
ACCOUNT_REGISTERED
;
}
if
(
ab
.
ApplicationStatus
==
508
)
{
//"服务商完成提交资料到⼯信部
if
(
solutionContent
.
status
!=
"ACCOUNT_REGISTERED"
)
{
return
system
.
getResultFail
(
-
508
,
"交付流程错误,请先完成账户注册"
);
}
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"MATERIAL_SUBMITTED"
,
statusName
:
this
.
icpSolutionStatusReference
.
MATERIAL_SUBMITTED
,
updated_at
:
new
Date
()
//获取方案信息
let
needsolutioninfo
=
await
this
.
needsolutionDao
.
model
.
findOne
({
attributes
:
[
"id"
,
"status"
,
"solutionContent"
,
"needNo"
,
"channelNeedNo"
],
where
:
needSolutionWhere
,
raw
:
true
});
solutionContent
.
status
=
"MATERIAL_SUBMITTED"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
MATERIAL_SUBMITTED
;
}
if
(
ab
.
ApplicationStatus
==
509
)
{
//⼯商部已受理
if
(
solutionContent
.
status
!=
"MATERIAL_SUBMITTED"
)
{
return
system
.
getResultFail
(
-
509
,
"交付流程错误,请先完成资料递交"
);
if
(
!
needsolutioninfo
||
!
needsolutioninfo
.
id
)
{
return
system
.
getResultFail
(
-
400
,
"未知方案"
);
}
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"GXB_ACCEPT"
,
statusName
:
this
.
icpSolutionStatusReference
.
GXB_ACCEPT
,
updated_at
:
new
Date
()
});
solutionContent
.
status
=
"GXB_ACCEPT"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
GXB_ACCEPT
;
}
if
(
ab
.
ApplicationStatus
==
510
)
{
//⼯商部不予受理
if
(
solutionContent
.
status
!=
"MATERIAL_SUBMITTED"
)
{
return
system
.
getResultFail
(
-
510
,
"交付流程错误,请先完成资料递交"
);
let
solutionContent
=
needsolutioninfo
.
solutionContent
;
if
(
!
solutionContent
)
{
return
system
.
getResultFail
(
-
402
,
"方案交付信息有误"
);
}
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"GXB_REFUSE"
,
statusName
:
this
.
icpSolutionStatusReference
.
GXB_REFUSE
,
updated_at
:
new
Date
()
});
solutionContent
.
status
=
"GXB_REFUSE"
;
needsolutioninfo
.
status
=
"ywc"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
GXB_REFUSE
;
}
if
(
ab
.
ApplicationStatus
==
511
)
{
//⼯商部通过
if
(
solutionContent
.
status
!=
"GXB_ACCEPT"
)
{
return
system
.
getResultFail
(
-
511
,
"交付流程错误,⼯信部已受理后才能执行此操作"
);
if
(
solutionContent
.
applicationStatus
&&
solutionContent
.
applicationStatus
>
ab
.
ApplicationStatus
)
{
return
system
.
getResultFail
(
-
403
,
"操作失败,交付流程未按顺序执行"
);
}
if
(
uapp_id
==
"18"
)
{
if
(
solutionContent
.
ApplicationStatus
&&
solutionContent
.
ApplicationStatus
==
ab
.
ApplicationStatus
)
{
return
system
.
getResultFail
(
-
405
,
"操作失败,该流程状态已提交,不能重复提交"
);
}
let
solutionFlowList
=
solutionContent
.
solutionFlowList
||
[];
let
orderInfo
=
await
this
.
orderinfoDao
.
model
.
findOne
({
attributes
:
[
"uapp_id"
,
"channelOrderNo"
],
where
:
{
orderNo
:
ab
.
orderNo
},
raw
:
true
})
if
(
!
orderInfo
||
!
orderInfo
.
channelOrderNo
)
{
return
system
.
getResultFail
(
-
406
,
"未知订单"
);
}
let
uapp_id
=
orderInfo
.
uapp_id
;
let
channelOrderNo
=
orderInfo
.
channelOrderNo
if
(
ab
.
ApplicationStatus
==
507
)
{
//完成账户注册
if
(
uapp_id
==
'18'
)
{
if
(
solutionContent
.
status
!=
"USER_CONFIRMED"
)
{
return
system
.
getResultFail
(
-
508
,
"交付流程错误,用户确认递交⽂件后才能执行此操作"
);
}
}
solutionContent
.
ApplicationStatus
=
507
;
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"GXB_SUCCESS"
,
statusName
:
this
.
icpSolutionStatusReference
.
GXB_SUCCESS
,
updated_at
:
new
Date
(),
CertificateNumber
:
ab
.
CertificateNumber
,
CertificateStartTime
:
ab
.
CertificateStartTime
,
CertificateEndTime
:
ab
.
CertificateEndTime
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"ACCOUNT_REGISTERED"
,
statusName
:
this
.
icpSolutionStatusReference
.
ACCOUNT_REGISTERED
,
updated_at
:
new
Date
()
});
}
else
{
solutionContent
.
status
=
"ACCOUNT_REGISTERED"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
ACCOUNT_REGISTERED
;
}
if
(
ab
.
ApplicationStatus
==
508
)
{
//"服务商完成提交资料到⼯信部
if
(
solutionContent
.
status
!=
"ACCOUNT_REGISTERED"
)
{
return
system
.
getResultFail
(
-
508
,
"交付流程错误,请先完成账户注册"
);
}
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"
GXB_SUCCESS
"
,
statusName
:
this
.
icpSolutionStatusReference
.
GXB_SUCCESS
,
status
:
"
MATERIAL_SUBMITTED
"
,
statusName
:
this
.
icpSolutionStatusReference
.
MATERIAL_SUBMITTED
,
updated_at
:
new
Date
()
});
solutionContent
.
status
=
"MATERIAL_SUBMITTED"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
MATERIAL_SUBMITTED
;
}
needsolutioninfo
.
status
=
"ywc"
;
solutionContent
.
status
=
"GXB_SUCCESS"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
GXB_SUCCESS
;
}
if
(
ab
.
ApplicationStatus
==
512
)
{
//⼯信部未通过
if
(
solutionContent
.
status
!=
"GXB_ACCEPT"
)
{
return
system
.
getResultFail
(
-
512
,
"交付流程错误,⼯信部已受理后才能执行此操作"
);
if
(
ab
.
ApplicationStatus
==
509
)
{
//⼯商部已受理
if
(
solutionContent
.
status
!=
"MATERIAL_SUBMITTED"
)
{
return
system
.
getResultFail
(
-
509
,
"交付流程错误,请先完成资料递交"
);
}
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"GXB_ACCEPT"
,
statusName
:
this
.
icpSolutionStatusReference
.
GXB_ACCEPT
,
updated_at
:
new
Date
()
});
solutionContent
.
status
=
"GXB_ACCEPT"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
GXB_ACCEPT
;
}
if
(
ab
.
ApplicationStatus
==
510
)
{
//⼯商部不予受理
if
(
solutionContent
.
status
!=
"MATERIAL_SUBMITTED"
)
{
return
system
.
getResultFail
(
-
510
,
"交付流程错误,请先完成资料递交"
);
}
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"GXB_REFUSE"
,
statusName
:
this
.
icpSolutionStatusReference
.
GXB_REFUSE
,
updated_at
:
new
Date
()
});
solutionContent
.
status
=
"GXB_REFUSE"
;
needsolutioninfo
.
status
=
"ywc"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
GXB_REFUSE
;
}
if
(
ab
.
ApplicationStatus
==
511
)
{
//⼯商部通过
if
(
solutionContent
.
status
!=
"GXB_ACCEPT"
)
{
return
system
.
getResultFail
(
-
511
,
"交付流程错误,⼯信部已受理后才能执行此操作"
);
}
if
(
uapp_id
==
"18"
)
{
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"GXB_SUCCESS"
,
statusName
:
this
.
icpSolutionStatusReference
.
GXB_SUCCESS
,
updated_at
:
new
Date
(),
CertificateNumber
:
ab
.
CertificateNumber
,
CertificateStartTime
:
ab
.
CertificateStartTime
,
CertificateEndTime
:
ab
.
CertificateEndTime
});
}
else
{
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"GXB_SUCCESS"
,
statusName
:
this
.
icpSolutionStatusReference
.
GXB_SUCCESS
,
updated_at
:
new
Date
()
});
}
needsolutioninfo
.
status
=
"ywc"
;
solutionContent
.
status
=
"GXB_SUCCESS"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
GXB_SUCCESS
;
}
if
(
ab
.
ApplicationStatus
==
512
)
{
//⼯信部未通过
if
(
solutionContent
.
status
!=
"GXB_ACCEPT"
)
{
return
system
.
getResultFail
(
-
512
,
"交付流程错误,⼯信部已受理后才能执行此操作"
);
}
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"GXB_FAIL"
,
statusName
:
this
.
icpSolutionStatusReference
.
GXB_FAIL
,
updated_at
:
new
Date
()
});
solutionContent
.
status
=
"GXB_FAIL"
;
needsolutioninfo
.
status
=
"ywc"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
GXB_FAIL
;
}
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"GXB_FAIL"
,
statusName
:
this
.
icpSolutionStatusReference
.
GXB_FAIL
,
updated_at
:
new
Date
()
});
solutionContent
.
status
=
"GXB_FAIL"
;
needsolutioninfo
.
status
=
"ywc"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
GXB_FAIL
;
}
solutionContent
.
solutionFlowList
=
solutionFlowList
;
//返回状态
let
statusObj
=
{};
let
applicationStatusList
=
solutionContent
.
applicationStatusList
||
[];
solutionContent
.
solutionFlowList
=
solutionFlowList
;
//返回状态
let
statusObj
=
{};
let
applicationStatusList
=
solutionContent
.
applicationStatusList
||
[];
if
(
uapp_id
==
"18"
)
{
statusObj
=
{
"OfficialFileURL"
:
ab
.
OfficialFileURL
||
""
,
"ApplicationStatus"
:
ab
.
ApplicationStatus
,
"ApplicationStatusName"
:
this
.
icpApplicationStatusReference
[
ab
.
ApplicationStatus
],
"created_at"
:
new
Date
(),
//2021-3-18 addNew
"CertificateNumber"
:
ab
.
CertificateNumber
||
""
,
//证书编号
"CertificateStartTime"
:
ab
.
CertificateStartTime
||
""
,
//证书有效期 开始时间
"CertificateEndTime"
:
ab
.
CertificateEndTime
||
""
//证书有效期 结束时间
};
}
else
{
statusObj
=
{
"OfficialFileURL"
:
ab
.
OfficialFileURL
||
""
,
"ApplicationStatus"
:
ab
.
ApplicationStatus
,
"ApplicationStatusName"
:
this
.
icpApplicationStatusReference
[
ab
.
ApplicationStatus
],
"created_at"
:
new
Date
()
};
}
applicationStatusList
.
push
(
statusObj
);
solutionContent
.
applicationStatusList
=
applicationStatusList
;
solutionContent
.
applicationStatus
=
ab
.
ApplicationStatus
;
needsolutioninfo
.
solutionContent
=
JSON
.
stringify
(
solutionContent
);
if
(
uapp_id
==
"18"
)
{
statusObj
=
{
"OfficialFileURL"
:
ab
.
OfficialFileURL
||
""
,
"ApplicationStatus"
:
ab
.
ApplicationStatus
,
"ApplicationStatusName"
:
this
.
icpApplicationStatusReference
[
ab
.
ApplicationStatus
],
"created_at"
:
new
Date
(),
//2021-3-18 addNew
"CertificateNumber"
:
ab
.
CertificateNumber
||
""
,
//证书编号
"CertificateStartTime"
:
ab
.
CertificateStartTime
||
""
,
//证书有效期 开始时间
"CertificateEndTime"
:
ab
.
CertificateEndTime
||
""
//证书有效期 结束时间
};
}
else
{
statusObj
=
{
"OfficialFileURL"
:
ab
.
OfficialFileURL
||
""
,
"ApplicationStatus"
:
ab
.
ApplicationStatus
,
"ApplicationStatusName"
:
this
.
icpApplicationStatusReference
[
ab
.
ApplicationStatus
],
"created_at"
:
new
Date
()
};
}
applicationStatusList
.
push
(
statusObj
);
solutionContent
.
applicationStatusList
=
applicationStatusList
;
solutionContent
.
applicationStatus
=
ab
.
ApplicationStatus
;
needsolutioninfo
.
solutionContent
=
JSON
.
stringify
(
solutionContent
);
return
await
this
.
needsolutionDao
.
db
.
transaction
(
async
function
(
t
)
{
await
self
.
needsolutionDao
.
update
(
needsolutioninfo
,
t
);
statusObj
[
"BizId"
]
=
needsolutioninfo
.
channelSolutionNo
;
statusObj
[
"solutionNo"
]
=
needsolutioninfo
.
solutionNo
;
statusObj
[
"material"
]
=
solutionContent
;
statusObj
[
"uapp_id"
]
=
uapp_id
;
statusObj
[
'channelOrderNo'
]
=
channelOrderNo
;
return
system
.
getResultSuccess
(
statusObj
);
})
return
await
this
.
needsolutionDao
.
db
.
transaction
(
async
function
(
t
)
{
await
self
.
needsolutionDao
.
update
(
needsolutioninfo
,
t
);
statusObj
[
"BizId"
]
=
needsolutioninfo
.
channelSolutionNo
;
statusObj
[
"solutionNo"
]
=
needsolutioninfo
.
solutionNo
;
statusObj
[
"material"
]
=
solutionContent
;
statusObj
[
"uapp_id"
]
=
uapp_id
;
statusObj
[
'channelOrderNo'
]
=
channelOrderNo
;
return
system
.
getResultSuccess
(
statusObj
);
})
}
catch
(
e
)
{
const
stackStr
=
e
.
stack
?
e
.
stack
:
JSON
.
stringify
(
e
);
this
.
execClientNew
.
execLogs
(
"acceptIcpPartnerNotification-reqError:"
,
pobj
,
"center-order-acceptIcpPartnerNotification"
,
null
,
stackStr
);
return
system
.
getResultFail
(
-
200
,
"acceptIcpPartnerNotification操作异常"
);
}
}
/*
...
...
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