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
95d2f395
Commit
95d2f395
authored
Mar 17, 2022
by
宋毅
Browse files
Options
Browse Files
Download
Plain Diff
增加内容
parents
4d1464d1
8a36d239
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
184 additions
and
92 deletions
+184
-92
Dockerfile
+2
-1
center-order/app/base/api/impl/action/need.js
+3
-0
center-order/app/base/service/impl/dbneed/needinfoSve.js
+2
-0
center-order/app/base/service/impl/dbneed/needinfoSve2.js
+23
-0
center-order/app/base/service/impl/qcutils/baseqcSve.js
+154
-91
No files found.
Dockerfile
View file @
95d2f395
...
@@ -3,7 +3,8 @@ FROM registry.cn-beijing.aliyuncs.com/hantang2/node105:v2
...
@@ -3,7 +3,8 @@ FROM registry.cn-beijing.aliyuncs.com/hantang2/node105:v2
MAINTAINER
jy "jiangyong@gongsibao.com"
MAINTAINER
jy "jiangyong@gongsibao.com"
ADD
center-order /apps/center-order/
ADD
center-order /apps/center-order/
WORKDIR
/apps/center-order/
WORKDIR
/apps/center-order/
RUN
cnpm install
-S
RUN
yum install gcc-c++.x86_64
-y
RUN
npm install
--unsafe-perm
=
true
--allow-root
CMD
["node","/apps/center-order/main.js"]
CMD
["node","/apps/center-order/main.js"]
...
...
center-order/app/base/api/impl/action/need.js
View file @
95d2f395
...
@@ -83,6 +83,9 @@ class IcAPI extends APIBase {
...
@@ -83,6 +83,9 @@ class IcAPI extends APIBase {
case
"queryExpertApplyCommunicationLogs"
:
// 查询需求沟通记录 2020-10-28 laolan
case
"queryExpertApplyCommunicationLogs"
:
// 查询需求沟通记录 2020-10-28 laolan
opResult
=
await
this
.
needinfoSve2
.
queryExpertApplyCommunicationLogs
(
pobj
,
pobj
.
actionBody
,
req
);
opResult
=
await
this
.
needinfoSve2
.
queryExpertApplyCommunicationLogs
(
pobj
,
pobj
.
actionBody
,
req
);
break
;
break
;
case
"queryCommunicationLog"
:
// 查询需求沟通记录
opResult
=
await
this
.
needinfoSve2
.
queryCommunicationLog
(
pobj
,
pobj
.
actionBody
,
req
);
break
;
case
"bulkCreateNeeds"
:
case
"bulkCreateNeeds"
:
opResult
=
await
this
.
needinfoSve
.
bulkCreateNeeds
(
pobj
);
opResult
=
await
this
.
needinfoSve
.
bulkCreateNeeds
(
pobj
);
break
;
break
;
...
...
center-order/app/base/service/impl/dbneed/needinfoSve.js
View file @
95d2f395
...
@@ -74,9 +74,11 @@ class NeedinfoService extends ServiceBase {
...
@@ -74,9 +74,11 @@ class NeedinfoService extends ServiceBase {
if
(
!
actionBody
.
intentionBizId
)
{
if
(
!
actionBody
.
intentionBizId
)
{
return
system
.
getResultFail
(
-
5001
,
"intentionBizId不能为空"
);
return
system
.
getResultFail
(
-
5001
,
"intentionBizId不能为空"
);
}
}
if
(
actionBody
.
appName
!=
'阿里云商机'
)
{
if
(
!
actionBody
.
mobile
)
{
if
(
!
actionBody
.
mobile
)
{
return
system
.
getResultFail
(
-
5002
,
"mobile不能为空"
);
return
system
.
getResultFail
(
-
5002
,
"mobile不能为空"
);
}
}
}
if
(
!
actionBody
.
type
)
{
if
(
!
actionBody
.
type
)
{
return
system
.
getResultFail
(
-
5003
,
"type不能为空"
);
return
system
.
getResultFail
(
-
5003
,
"type不能为空"
);
}
}
...
...
center-order/app/base/service/impl/dbneed/needinfoSve2.js
View file @
95d2f395
...
@@ -100,5 +100,28 @@ class NeedinfoService2 extends ServiceBase {
...
@@ -100,5 +100,28 @@ class NeedinfoService2 extends ServiceBase {
}
}
//2020-10-28 laolan 新增查询需求沟通记录
async
queryCommunicationLog
(
pobj
){
console
.
log
(
'query++pobj'
,
pobj
)
if
(
!
pobj
.
actionBody
.
intentionBizId
)
{
return
system
.
getResult
(
null
,
"actionBody.intentionBizId can not be empty,100493"
);
}
if
(
pobj
.
appInfo
.
uapp_id
==
18
){
if
(
!
pobj
.
actionBody
.
userFeedBack
)
{
return
system
.
getResult
(
null
,
"actionBody.userFeedBack can not be empty,100494"
);
}
}
var
sql
=
"select followContent from n_need_info where channelNeedNo = :channelNeedNo "
;
var
where
=
{
channelNeedNo
:
pobj
.
actionBody
.
intentionBizId
}
var
uappIdInfo
=
await
this
.
customQuery
(
sql
,
where
);
if
(
uappIdInfo
){
uappIdInfo
=
uappIdInfo
[
0
];
return
system
.
getResultSuccess
(
uappIdInfo
);
}
}
}
}
module
.
exports
=
NeedinfoService2
;
module
.
exports
=
NeedinfoService2
;
center-order/app/base/service/impl/qcutils/baseqcSve.js
View file @
95d2f395
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
...
@@ -67,7 +66,7 @@ class BaseQcService {
...
@@ -67,7 +66,7 @@ class BaseQcService {
//获取需求信息
//获取需求信息
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
attributes
:
[
"id"
,
"status"
,
"statusName"
,
"needNo"
,
"uapp_id"
],
//2020-10-29 laolan xinzeng uapp_id
attributes
:
[
"id"
,
"status"
,
"statusName"
,
"needNo"
,
"uapp_id"
],
//2020-10-29 laolan xinzeng uapp_id
where
:
{
channelNeedNo
:
ab
.
intentionBizId
},
raw
:
true
where
:
{
channelNeedNo
:
ab
.
intentionBizId
},
raw
:
true
});
});
var
uappId
=
{};
var
uappId
=
{};
if
(
!
needinfo
||
!
needinfo
.
id
)
{
if
(
!
needinfo
||
!
needinfo
.
id
)
{
...
@@ -81,7 +80,7 @@ class BaseQcService {
...
@@ -81,7 +80,7 @@ class BaseQcService {
}
}
//获取方案信息
//获取方案信息
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
needNo
:
needinfo
.
needNo
,
isInvalid
:
0
},
raw
:
true
where
:
{
needNo
:
needinfo
.
needNo
,
isInvalid
:
0
},
raw
:
true
});
});
if
(
ns
&&
ns
.
id
)
{
if
(
ns
&&
ns
.
id
)
{
...
@@ -102,10 +101,7 @@ class BaseQcService {
...
@@ -102,10 +101,7 @@ class BaseQcService {
};
};
await
self
.
needinfoDao
.
update
(
needObj
,
t
);
//关闭需求
await
self
.
needinfoDao
.
update
(
needObj
,
t
);
//关闭需求
if
(
ns
&&
ns
.
id
)
{
if
(
ns
&&
ns
.
id
)
{
await
self
.
needsolutionDao
.
model
.
update
({
status
:
"yzf"
,
isInvalid
:
1
},
{
await
self
.
needsolutionDao
.
model
.
update
({
status
:
"yzf"
,
isInvalid
:
1
},
{
where
:
{
id
:
ns
.
id
},
transaction
:
t
});
//方案废弃
where
:
{
id
:
ns
.
id
},
transaction
:
t
});
//方案废弃
// return system.getResultSuccess(ns.orderNo);
// return system.getResultSuccess(ns.orderNo);
ns
=
ns
?
ns
:
{};
ns
=
ns
?
ns
:
{};
ns
=
Object
.
assign
(
ns
,
uappId
)
ns
=
Object
.
assign
(
ns
,
uappId
)
...
@@ -123,6 +119,8 @@ class BaseQcService {
...
@@ -123,6 +119,8 @@ class BaseQcService {
}
}
}
}
//提交方案
//提交方案
async
submitIcpProgramme
(
pobj
)
{
async
submitIcpProgramme
(
pobj
)
{
console
.
log
(
"pobj++++"
,
pobj
)
console
.
log
(
"pobj++++"
,
pobj
)
...
@@ -140,7 +138,7 @@ class BaseQcService {
...
@@ -140,7 +138,7 @@ class BaseQcService {
}
}
//获取需求信息
//获取需求信息
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
where
:
{
channelNeedNo
:
ab
.
needNo
},
raw
:
true
where
:
{
channelNeedNo
:
ab
.
needNo
},
raw
:
true
});
});
if
(
!
needinfo
||
!
needinfo
.
id
)
{
if
(
!
needinfo
||
!
needinfo
.
id
)
{
return
system
.
getResultFail
(
-
201
,
"未知需求信息"
);
return
system
.
getResultFail
(
-
201
,
"未知需求信息"
);
...
@@ -162,7 +160,7 @@ class BaseQcService {
...
@@ -162,7 +160,7 @@ class BaseQcService {
ab
.
solutionContent
.
typeCode
=
needinfo
.
typeCode
;
ab
.
solutionContent
.
typeCode
=
needinfo
.
typeCode
;
ab
.
solutionContent
.
typeName
=
needinfo
.
typeName
;
ab
.
solutionContent
.
typeName
=
needinfo
.
typeName
;
var
ns
=
await
this
.
needsolutionDao
.
model
.
findAll
({
var
ns
=
await
this
.
needsolutionDao
.
model
.
findAll
({
where
:
{
channelNeedNo
:
ab
.
needNo
},
raw
:
true
,
order
:
[[
"id"
,
'asc'
]]
where
:
{
channelNeedNo
:
ab
.
needNo
},
raw
:
true
,
order
:
[[
"id"
,
'asc'
]]
});
});
for
(
var
i
=
0
;
i
<
ns
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
ns
.
length
;
i
++
)
{
var
fa
=
ns
[
i
];
var
fa
=
ns
[
i
];
...
@@ -181,7 +179,7 @@ class BaseQcService {
...
@@ -181,7 +179,7 @@ class BaseQcService {
return
system
.
getResultFail
(
-
103
,
"方案交付信息有误"
);
return
system
.
getResultFail
(
-
103
,
"方案交付信息有误"
);
}
}
//判断属于渠道 18阿里,44百度,52易名
//判断属于渠道 18阿里,44百度,52易名
if
(
needinfo
.
uapp_id
==
44
||
needinfo
.
uapp_id
==
18
)
{
if
(
needinfo
.
uapp_id
==
44
||
needinfo
.
uapp_id
==
18
)
{
if
(
needinfo
.
channelTypeCode
==
"7"
)
{
//edi
if
(
needinfo
.
channelTypeCode
==
"7"
)
{
//edi
ab
.
solutionContent
.
solution
.
IcpType
=
2
;
ab
.
solutionContent
.
solution
.
IcpType
=
2
;
}
else
if
(
needinfo
.
channelTypeCode
==
"5"
)
{
//icp
}
else
if
(
needinfo
.
channelTypeCode
==
"5"
)
{
//icp
...
@@ -190,15 +188,23 @@ class BaseQcService {
...
@@ -190,15 +188,23 @@ class BaseQcService {
return
system
.
getResultFail
(
-
207
,
"需求业务类型有误"
);
return
system
.
getResultFail
(
-
207
,
"需求业务类型有误"
);
}
}
}
}
if
(
needinfo
.
uapp_id
==
52
)
{
if
(
needinfo
.
uapp_id
==
52
)
{
if
(
needinfo
.
channelTypeCode
==
"7"
)
{
//edi
if
(
needinfo
.
channelTypeCode
==
"7"
)
{
//edi
sq
ab
.
solutionContent
.
solution
.
IcpType
=
2
;
ab
.
solutionContent
.
solution
.
IcpType
=
2
;
}
else
if
(
needinfo
.
channelTypeCode
==
"5"
)
{
//icp
}
else
if
(
needinfo
.
channelTypeCode
==
"5"
)
{
//icp
sq
ab
.
solutionContent
.
solution
.
IcpType
=
1
;
ab
.
solutionContent
.
solution
.
IcpType
=
1
;
}
else
if
(
needinfo
.
channelTypeCode
==
"
icpnb"
)
{
//icpnb
}
else
if
(
needinfo
.
channelTypeCode
==
"
ICPNB"
)
{
//ICPNB
ab
.
solutionContent
.
solution
.
IcpType
=
3
;
ab
.
solutionContent
.
solution
.
IcpType
=
3
;
}
else
if
(
needinfo
.
channelTypeCode
==
"
edinb"
)
{
//edinb
}
else
if
(
needinfo
.
channelTypeCode
==
"
EIDNB"
)
{
//EIDNB
ab
.
solutionContent
.
solution
.
IcpType
=
4
;
ab
.
solutionContent
.
solution
.
IcpType
=
4
;
}
else
if
(
needinfo
.
channelTypeCode
==
"ICPXQ"
)
{
//ICPXQ
ab
.
solutionContent
.
solution
.
IcpType
=
5
;
}
else
if
(
needinfo
.
channelTypeCode
==
"EIDXQ"
)
{
//EIDXQ
ab
.
solutionContent
.
solution
.
IcpType
=
6
;
}
else
if
(
needinfo
.
channelTypeCode
==
"ICPWZ"
)
{
//ICPWZ
ab
.
solutionContent
.
solution
.
IcpType
=
7
;
}
else
if
(
needinfo
.
channelTypeCode
==
"EIDWZ"
)
{
//EIDWZ
ab
.
solutionContent
.
solution
.
IcpType
=
8
;
}
else
{
}
else
{
return
system
.
getResultFail
(
-
208
,
"需求业务类型有误-52"
);
return
system
.
getResultFail
(
-
208
,
"需求业务类型有误-52"
);
}
}
...
@@ -217,9 +223,7 @@ class BaseQcService {
...
@@ -217,9 +223,7 @@ class BaseQcService {
}
}
var
solutionFlowList
=
ab
.
solutionContent
.
solutionFlowList
||
[];
var
solutionFlowList
=
ab
.
solutionContent
.
solutionFlowList
||
[];
solutionFlowList
.
push
({
solutionFlowList
.
push
({
status
:
"SOLUTION_SUBMIT"
,
status
:
"SOLUTION_SUBMIT"
,
statusName
:
this
.
icpSolutionStatusReference
.
SOLUTION_SUBMIT
,
updated_at
:
new
Date
()
statusName
:
this
.
icpSolutionStatusReference
.
SOLUTION_SUBMIT
,
updated_at
:
new
Date
()
});
});
ab
.
solutionContent
.
status
=
"SOLUTION_SUBMIT"
;
ab
.
solutionContent
.
status
=
"SOLUTION_SUBMIT"
;
ab
.
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
SOLUTION_SUBMIT
;
ab
.
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
SOLUTION_SUBMIT
;
...
@@ -268,9 +272,9 @@ class BaseQcService {
...
@@ -268,9 +272,9 @@ class BaseQcService {
}
}
await
self
.
needinfoDao
.
update
(
needObj
,
t
);
await
self
.
needinfoDao
.
update
(
needObj
,
t
);
needinfo
=
await
self
.
needinfoDao
.
model
.
findOne
({
needinfo
=
await
self
.
needinfoDao
.
model
.
findOne
({
where
:
{
id
:
needinfo
.
id
},
raw
:
true
where
:
{
id
:
needinfo
.
id
},
raw
:
true
});
});
return
system
.
getResultSuccess
({
needinfo
:
needinfo
,
needsolution
:
od
});
return
system
.
getResultSuccess
({
needinfo
:
needinfo
,
needsolution
:
od
});
}
else
{
}
else
{
return
system
.
getResultFail
(
-
302
,
"提交方案失败"
);
return
system
.
getResultFail
(
-
302
,
"提交方案失败"
);
}
}
...
@@ -286,16 +290,15 @@ class BaseQcService {
...
@@ -286,16 +290,15 @@ class BaseQcService {
return
system
.
getResultFail
(
-
101
,
"订单号不能为空"
);
return
system
.
getResultFail
(
-
101
,
"订单号不能为空"
);
}
}
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
orderNo
:
ab
.
orderNo
},
raw
:
true
where
:
{
orderNo
:
ab
.
orderNo
},
raw
:
true
});
});
if
(
!
ns
||
!
ns
.
id
)
{
if
(
!
ns
||
!
ns
.
id
)
{
return
system
.
getResultFail
(
-
301
,
"未知方案"
);
return
system
.
getResultFail
(
-
301
,
"未知方案"
);
}
}
ab
[
"BizId"
]
=
ns
.
channelSolutionNo
;
ab
[
"BizId"
]
=
ns
.
channelSolutionNo
;
pobj
.
actionBody
=
ab
;
pobj
.
actionBody
=
ab
;
return
await
this
.
submitIcpMaterial
(
pobj
);
return
this
.
submitIcpMaterial
(
pobj
);
}
}
//提交icp材料信息
//提交icp材料信息
async
submitIcpMaterial
(
pobj
)
{
async
submitIcpMaterial
(
pobj
)
{
var
ab
=
pobj
.
actionBody
;
var
ab
=
pobj
.
actionBody
;
...
@@ -314,7 +317,7 @@ class BaseQcService {
...
@@ -314,7 +317,7 @@ class BaseQcService {
//获取方案信息
//获取方案信息
var
needsolutioninfo
=
await
this
.
needsolutionDao
.
model
.
findOne
({
var
needsolutioninfo
=
await
this
.
needsolutionDao
.
model
.
findOne
({
attributes
:
[
"id"
,
"needNo"
,
"orderNo"
,
"solutionContent"
],
attributes
:
[
"id"
,
"needNo"
,
"orderNo"
,
"solutionContent"
],
where
:
{
channelSolutionNo
:
ab
.
BizId
,
isInvalid
:
0
},
raw
:
true
where
:
{
channelSolutionNo
:
ab
.
BizId
,
isInvalid
:
0
},
raw
:
true
});
});
console
.
log
(
'needsolutioninfo+++'
,
needsolutioninfo
)
console
.
log
(
'needsolutioninfo+++'
,
needsolutioninfo
)
if
(
!
needsolutioninfo
||
!
needsolutioninfo
.
id
)
{
if
(
!
needsolutioninfo
||
!
needsolutioninfo
.
id
)
{
...
@@ -340,6 +343,30 @@ class BaseQcService {
...
@@ -340,6 +343,30 @@ class BaseQcService {
break
;
break
;
}
}
}
}
//----
// var orderInfo = await this.orderinfoDao.model.findOne({
// attributes: ["uapp_id"],
// where: {orderNo: needsolutioninfo.orderNo}, raw: true
// })
// if(orderInfo){
// var uappId = orderInfo.uapp_id
// }
// if(uappId == "18"){//ali
// if (solutionContent.status != "USER_UPLOADED") {
// return system.getResultFail(-403, "用户未上传材料,不能执行此操作");
// }
// }
//获取需求信息
// var needinfo = await this.needinfoDao.model.findOne({
// where: { needNo: needsolutioninfo.needNo }, raw: true
// });
// if (!needinfo || !needinfo.id) {
// return system.getResultFail(-201, "未知需求信息");
// }
// // if (needinfo.status == "ycd" || needinfo.status == "ygb") {
// if (needinfo.status == "ygb") {
// return system.getResultFail(-202, "该方案需求状态为" + needinfo.statusName + ",不能执行此操作");
// }
var
material
=
ab
.
material
;
var
material
=
ab
.
material
;
if
(
!
material
.
Domain
)
{
if
(
!
material
.
Domain
)
{
return
system
.
getResultFail
(
-
101
,
"备案域名不能为空"
);
return
system
.
getResultFail
(
-
101
,
"备案域名不能为空"
);
...
@@ -360,9 +387,7 @@ class BaseQcService {
...
@@ -360,9 +387,7 @@ class BaseQcService {
solutionContent
.
material
=
ab
.
material
;
solutionContent
.
material
=
ab
.
material
;
var
solutionFlowList
=
solutionContent
.
solutionFlowList
||
[];
var
solutionFlowList
=
solutionContent
.
solutionFlowList
||
[];
solutionFlowList
.
push
({
solutionFlowList
.
push
({
status
:
"MATERIAL_UNCONFIRM"
,
status
:
"MATERIAL_UNCONFIRM"
,
statusName
:
this
.
icpSolutionStatusReference
.
MATERIAL_UNCONFIRM
,
updated_at
:
new
Date
()
statusName
:
this
.
icpSolutionStatusReference
.
MATERIAL_UNCONFIRM
,
updated_at
:
new
Date
()
});
});
solutionContent
.
status
=
"MATERIAL_UNCONFIRM"
;
solutionContent
.
status
=
"MATERIAL_UNCONFIRM"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
MATERIAL_UNCONFIRM
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
MATERIAL_UNCONFIRM
;
...
@@ -371,11 +396,11 @@ class BaseQcService {
...
@@ -371,11 +396,11 @@ class BaseQcService {
return
await
this
.
needsolutionDao
.
db
.
transaction
(
async
function
(
t
)
{
return
await
this
.
needsolutionDao
.
db
.
transaction
(
async
function
(
t
)
{
await
self
.
needsolutionDao
.
update
(
needsolutioninfo
,
t
);
await
self
.
needsolutionDao
.
update
(
needsolutioninfo
,
t
);
var
new_needsolutioninfo
=
await
self
.
needsolutionDao
.
model
.
findOne
({
var
new_needsolutioninfo
=
await
self
.
needsolutionDao
.
model
.
findOne
({
where
:
{
id
:
needsolutioninfo
.
id
},
raw
:
true
where
:
{
id
:
needsolutioninfo
.
id
},
raw
:
true
});
});
//2020-10-27 laolan start
//2020-10-27 laolan start
var
orderInfo
=
await
self
.
orderinfoDao
.
model
.
findOne
({
var
orderInfo
=
await
self
.
orderinfoDao
.
model
.
findOne
({
where
:
{
orderNo
:
ab
.
orderNo
},
raw
:
true
where
:
{
orderNo
:
ab
.
orderNo
},
raw
:
true
})
})
if
(
orderInfo
)
{
if
(
orderInfo
)
{
var
uappIds
=
orderInfo
.
uapp_id
;
var
uappIds
=
orderInfo
.
uapp_id
;
...
@@ -389,16 +414,9 @@ class BaseQcService {
...
@@ -389,16 +414,9 @@ class BaseQcService {
})
})
}
}
//交付商通知状态变更
//交付商通知状态变更
async
serviceProviderNotification
(
pobj
)
{
async
serviceProviderNotification
(
pobj
)
{
let
ab
=
pobj
.
actionBody
;
var
ab
=
pobj
.
actionBody
;
if
(
!
pobj
.
userInfo
||
!
pobj
.
userInfo
.
id
)
{
return
system
.
getResultFail
(
-
100
,
"未知用户"
);
}
if
(
!
ab
.
ApplicationStatus
)
{
return
system
.
getResultFail
(
-
102
,
"通知状态不能为空"
);
}
if
(
!
ab
.
orderNo
)
{
if
(
!
ab
.
orderNo
)
{
return
system
.
getResultFail
(
-
101
,
"订单号不能为空"
);
return
system
.
getResultFail
(
-
101
,
"订单号不能为空"
);
}
}
...
@@ -420,29 +438,49 @@ class BaseQcService {
...
@@ -420,29 +438,49 @@ class BaseQcService {
if
(
ab
.
certificateEndTime
)
{
if
(
ab
.
certificateEndTime
)
{
ab
[
"CertificateEndTime"
]
=
ab
.
certificateEndTime
;
ab
[
"CertificateEndTime"
]
=
ab
.
certificateEndTime
;
}
}
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
orderNo
:
ab
.
orderNo
},
raw
:
true
});
if
(
!
ns
||
!
ns
.
id
)
{
return
system
.
getResultFail
(
-
301
,
"未知方案"
);
}
ab
[
"BizId"
]
=
ns
.
channelSolutionNo
;
ab
[
"solutionNo"
]
=
ns
.
solutionNo
;
pobj
.
actionBody
=
ab
;
pobj
.
actionBody
=
ab
;
return
this
.
acceptIcpPartnerNotification
(
pobj
);
return
this
.
acceptIcpPartnerNotification
(
pobj
);
}
}
//服务商通知状态变更
//服务商通知状态变更
async
acceptIcpPartnerNotification
(
pobj
)
{
async
acceptIcpPartnerNotification
(
pobj
)
{
let
self
=
this
;
console
.
log
(
'服务商通知状态变更pobj++++'
,
pobj
)
let
ab
=
pobj
.
actionBody
;
var
ab
=
pobj
.
actionBody
;
let
needSolutionWhere
=
{};
var
user
=
pobj
.
userInfo
;
if
(
ab
.
solutionNo
)
{
needSolutionWhere
=
{
solutionNo
:
ab
.
solutionNo
};
if
(
!
user
||
!
user
.
id
)
{
}
else
if
(
ab
.
orderNo
)
{
return
system
.
getResultFail
(
-
100
,
"未知用户"
);
needSolutionWhere
=
{
orderNo
:
ab
.
orderNo
};
}
// ab["createUserId"] = user.id;
// if (!ab.BizId) {
// return system.getResultFail(-101, "渠道方案编号不能为空");
// }
if
(
!
ab
.
solutionNo
)
{
return
system
.
getResultFail
(
-
101
,
"方案编号不能为空"
);
}
if
(
!
ab
.
ApplicationStatus
)
{
return
system
.
getResultFail
(
-
102
,
"通知状态不能为空"
);
}
}
//获取方案信息
//获取方案信息
let
needsolutioninfo
=
await
this
.
needsolutionDao
.
model
.
findOne
({
var
needsolutioninfo
=
await
this
.
needsolutionDao
.
model
.
findOne
({
attributes
:
[
"id"
,
"status"
,
"solutionContent"
,
"needNo"
,
"channelNeedNo"
],
attributes
:
[
"id"
,
"status"
,
"solutionContent"
,
"needNo"
,
"channelNeedNo"
],
where
:
needSolutionWhere
,
raw
:
true
where
:
{
solutionNo
:
ab
.
solutionNo
}
,
raw
:
true
});
});
if
(
!
needsolutioninfo
||
!
needsolutioninfo
.
id
)
{
if
(
!
needsolutioninfo
||
!
needsolutioninfo
.
id
)
{
return
system
.
getResultFail
(
-
400
,
"未知方案"
);
return
system
.
getResultFail
(
-
400
,
"未知方案"
);
}
}
let
solutionContent
=
needsolutioninfo
.
solutionContent
;
// if (!needsolutioninfo.needNo) {
// return system.getResultFail(-401, "方案需求信息有误");
// }
var
solutionContent
=
needsolutioninfo
.
solutionContent
;
if
(
!
solutionContent
)
{
if
(
!
solutionContent
)
{
return
system
.
getResultFail
(
-
402
,
"方案交付信息有误"
);
return
system
.
getResultFail
(
-
402
,
"方案交付信息有误"
);
}
}
...
@@ -452,19 +490,43 @@ class BaseQcService {
...
@@ -452,19 +490,43 @@ class BaseQcService {
if
(
solutionContent
.
ApplicationStatus
&&
solutionContent
.
ApplicationStatus
==
ab
.
ApplicationStatus
)
{
if
(
solutionContent
.
ApplicationStatus
&&
solutionContent
.
ApplicationStatus
==
ab
.
ApplicationStatus
)
{
return
system
.
getResultFail
(
-
405
,
"操作失败,该流程状态已提交,不能重复提交"
);
return
system
.
getResultFail
(
-
405
,
"操作失败,该流程状态已提交,不能重复提交"
);
}
}
let
solutionFlowList
=
solutionContent
.
solutionFlowList
||
[];
//获取需求信息
let
orderInfo
=
await
this
.
orderinfoDao
.
model
.
findOne
({
// var needinfo = await this.needinfoDao.model.findOne({
attributes
:
[
"uapp_id"
,
"channelOrderNo"
],
// where: { needNo: needsolutioninfo.needNo }, raw: true
where
:
{
orderNo
:
ab
.
orderNo
},
raw
:
true
// });
// if (!needinfo || !needinfo.id) {
// return system.getResultFail(-201, "未知需求信息");
// }
// // if (needinfo.status == "ycd" || needinfo.status == "ygb") {
// if (needinfo.status == "ygb") {
// return system.getResultFail(-202, "serviceProviderSubmitMateria" + needinfo.statusName + ",不能执行此操作");
// }
var
solutionFlowList
=
solutionContent
.
solutionFlowList
||
[];
var
orderuappId
=
await
this
.
orderinfoDao
.
model
.
findOne
({
attributes
:
[
"uapp_id"
],
where
:
{
orderNo
:
ab
.
orderNo
},
raw
:
true
})
})
if
(
!
orderInfo
||
!
orderInfo
.
channelOrderNo
)
{
console
.
log
(
"orderuappId+++"
,
orderuappId
)
return
system
.
getResultFail
(
-
406
,
"未知订单"
);
if
(
orderuappId
)
{
var
uappId
=
orderuappId
.
uapp_id
;
}
if
(
uappId
!=
'50'
)
{
// if (!needsolutioninfo.channelNeedNo) {
// return system.getResultFail(-401, "方案需求信息有误");
// }
// //获取需求信息
// var needinfo = await this.needinfoDao.model.findOne({
// where: { channelNeedNo: needsolutioninfo.channelNeedNo }, raw: true
// });
// if (!needinfo || !needinfo.id) {
// return system.getResultFail(-201, "未知需求信息");
// }
// if (needinfo.status == "ygb") {
// return system.getResultFail(-202, "serviceProviderSubmitMateria" + needinfo.statusName + ",不能执行此操作");
// }
}
}
let
uapp_id
=
orderInfo
.
uapp_id
;
let
channelOrderNo
=
orderInfo
.
channelOrderNo
if
(
ab
.
ApplicationStatus
==
507
)
{
//完成账户注册
if
(
ab
.
ApplicationStatus
==
507
)
{
//完成账户注册
if
(
uapp
_i
d
==
'18'
)
{
if
(
uapp
I
d
==
'18'
)
{
if
(
solutionContent
.
status
!=
"USER_CONFIRMED"
)
{
if
(
solutionContent
.
status
!=
"USER_CONFIRMED"
)
{
return
system
.
getResultFail
(
-
508
,
"交付流程错误,用户确认递交⽂件后才能执行此操作"
);
return
system
.
getResultFail
(
-
508
,
"交付流程错误,用户确认递交⽂件后才能执行此操作"
);
}
}
...
@@ -472,9 +534,7 @@ class BaseQcService {
...
@@ -472,9 +534,7 @@ class BaseQcService {
solutionContent
.
ApplicationStatus
=
507
;
solutionContent
.
ApplicationStatus
=
507
;
solutionFlowList
.
push
({
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"ACCOUNT_REGISTERED"
,
status
:
"ACCOUNT_REGISTERED"
,
statusName
:
this
.
icpSolutionStatusReference
.
ACCOUNT_REGISTERED
,
updated_at
:
new
Date
()
statusName
:
this
.
icpSolutionStatusReference
.
ACCOUNT_REGISTERED
,
updated_at
:
new
Date
()
});
});
solutionContent
.
status
=
"ACCOUNT_REGISTERED"
;
solutionContent
.
status
=
"ACCOUNT_REGISTERED"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
ACCOUNT_REGISTERED
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
ACCOUNT_REGISTERED
;
...
@@ -485,9 +545,7 @@ class BaseQcService {
...
@@ -485,9 +545,7 @@ class BaseQcService {
}
}
solutionFlowList
.
push
({
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"MATERIAL_SUBMITTED"
,
status
:
"MATERIAL_SUBMITTED"
,
statusName
:
this
.
icpSolutionStatusReference
.
MATERIAL_SUBMITTED
,
updated_at
:
new
Date
()
statusName
:
this
.
icpSolutionStatusReference
.
MATERIAL_SUBMITTED
,
updated_at
:
new
Date
()
});
});
solutionContent
.
status
=
"MATERIAL_SUBMITTED"
;
solutionContent
.
status
=
"MATERIAL_SUBMITTED"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
MATERIAL_SUBMITTED
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
MATERIAL_SUBMITTED
;
...
@@ -519,20 +577,18 @@ class BaseQcService {
...
@@ -519,20 +577,18 @@ class BaseQcService {
if
(
solutionContent
.
status
!=
"GXB_ACCEPT"
)
{
if
(
solutionContent
.
status
!=
"GXB_ACCEPT"
)
{
return
system
.
getResultFail
(
-
511
,
"交付流程错误,⼯信部已受理后才能执行此操作"
);
return
system
.
getResultFail
(
-
511
,
"交付流程错误,⼯信部已受理后才能执行此操作"
);
}
}
if
(
uapp_id
==
"18"
)
{
if
(
uappId
==
"18"
)
{
solutionFlowList
.
push
({
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"GXB_SUCCESS"
,
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"GXB_SUCCESS"
,
statusName
:
this
.
icpSolutionStatusReference
.
GXB_SUCCESS
,
updated_at
:
new
Date
(),
statusName
:
this
.
icpSolutionStatusReference
.
GXB_SUCCESS
,
updated_at
:
new
Date
(),
CertificateNumber
:
ab
.
CertificateNumber
,
CertificateNumber
:
ab
.
CertificateNumber
,
CertificateStartTime
:
ab
.
CertificateStartTime
,
CertificateStartTime
:
ab
.
CertificateStartTime
,
CertificateEndTime
:
ab
.
CertificateEndTime
CertificateEndTime
:
ab
.
CertificateEndTime
});
});
}
else
{
}
else
{
solutionFlowList
.
push
({
solutionFlowList
.
push
({
file
:
ab
.
OfficialFileURL
||
""
,
file
:
ab
.
OfficialFileURL
||
""
,
status
:
"GXB_SUCCESS"
,
status
:
"GXB_SUCCESS"
,
statusName
:
this
.
icpSolutionStatusReference
.
GXB_SUCCESS
,
updated_at
:
new
Date
()
statusName
:
this
.
icpSolutionStatusReference
.
GXB_SUCCESS
,
updated_at
:
new
Date
()
});
});
}
}
needsolutioninfo
.
status
=
"ywc"
;
needsolutioninfo
.
status
=
"ywc"
;
...
@@ -551,25 +607,21 @@ class BaseQcService {
...
@@ -551,25 +607,21 @@ class BaseQcService {
needsolutioninfo
.
status
=
"ywc"
;
needsolutioninfo
.
status
=
"ywc"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
GXB_FAIL
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
GXB_FAIL
;
}
}
solutionContent
.
solutionFlowList
=
solutionFlowList
;
solutionContent
.
solutionFlowList
=
solutionFlowList
;
//返回状态
var
applicationStatusList
=
solutionContent
.
applicationStatusList
||
[];
let
statusObj
=
{};
if
(
uappId
==
"18"
){
let
applicationStatusList
=
solutionContent
.
applicationStatusList
||
[];
var
statusObj
=
{
if
(
uapp_id
==
"18"
)
{
statusObj
=
{
"OfficialFileURL"
:
ab
.
OfficialFileURL
||
""
,
"OfficialFileURL"
:
ab
.
OfficialFileURL
||
""
,
"ApplicationStatus"
:
ab
.
ApplicationStatus
,
"ApplicationStatus"
:
ab
.
ApplicationStatus
,
"ApplicationStatusName"
:
this
.
icpApplicationStatusReference
[
ab
.
ApplicationStatus
],
"ApplicationStatusName"
:
this
.
icpApplicationStatusReference
[
ab
.
ApplicationStatus
],
"created_at"
:
new
Date
(),
"created_at"
:
new
Date
(),
//2021-3-18 addNew
//2021-3-18 addNew
"CertificateNumber"
:
ab
.
CertificateNumber
||
""
,
//证书编号
"CertificateNumber"
:
ab
.
CertificateNumber
||
""
,
//证书编号
"CertificateStartTime"
:
ab
.
CertificateStartTime
||
""
,
//证书有效期 开始时间
"CertificateStartTime"
:
ab
.
CertificateStartTime
||
""
,
//证书有效期 开始时间
"CertificateEndTime"
:
ab
.
CertificateEndTime
||
""
//证书有效期 结束时间
"CertificateEndTime"
:
ab
.
CertificateEndTime
||
""
//证书有效期 结束时间
};
};
}
else
{
}
else
{
statusObj
=
{
var
statusObj
=
{
"OfficialFileURL"
:
ab
.
OfficialFileURL
||
""
,
"OfficialFileURL"
:
ab
.
OfficialFileURL
||
""
,
"ApplicationStatus"
:
ab
.
ApplicationStatus
,
"ApplicationStatus"
:
ab
.
ApplicationStatus
,
"ApplicationStatusName"
:
this
.
icpApplicationStatusReference
[
ab
.
ApplicationStatus
],
"ApplicationStatusName"
:
this
.
icpApplicationStatusReference
[
ab
.
ApplicationStatus
],
...
@@ -581,13 +633,24 @@ class BaseQcService {
...
@@ -581,13 +633,24 @@ class BaseQcService {
solutionContent
.
applicationStatus
=
ab
.
ApplicationStatus
;
solutionContent
.
applicationStatus
=
ab
.
ApplicationStatus
;
needsolutioninfo
.
solutionContent
=
JSON
.
stringify
(
solutionContent
);
needsolutioninfo
.
solutionContent
=
JSON
.
stringify
(
solutionContent
);
console
.
log
(
"ab.orderNo+++"
,
ab
.
orderNo
)
var
self
=
this
;
var
orderInfo
=
await
self
.
orderinfoDao
.
model
.
findOne
({
attributes
:
[
"channelOrderNo"
],
where
:
{
orderNo
:
ab
.
orderNo
},
raw
:
true
})
console
.
log
(
"orderInfo+++"
,
orderInfo
)
if
(
orderInfo
)
{
var
channelOrderNo
=
orderInfo
.
channelOrderNo
}
return
await
this
.
needsolutionDao
.
db
.
transaction
(
async
function
(
t
)
{
return
await
this
.
needsolutionDao
.
db
.
transaction
(
async
function
(
t
)
{
await
self
.
needsolutionDao
.
update
(
needsolutioninfo
,
t
);
await
self
.
needsolutionDao
.
update
(
needsolutioninfo
,
t
);
statusObj
[
"BizId"
]
=
needsolutioninfo
.
channelSolutionNo
;
statusObj
[
"BizId"
]
=
ab
.
BizId
;
statusObj
[
"solutionNo"
]
=
needsolutioninfo
.
solutionNo
;
//2020-10-27 laolan start
statusObj
[
"material"
]
=
solutionContent
;
statusObj
[
'uapp_id'
]
=
uappId
;
statusObj
[
"uapp_id"
]
=
uapp_id
;
statusObj
[
'channelOrderNo'
]
=
channelOrderNo
;
statusObj
[
'channelOrderNo'
]
=
channelOrderNo
;
console
.
log
(
'statusObj++'
,
statusObj
)
//2020-10-27 laolan start
return
system
.
getResultSuccess
(
statusObj
);
return
system
.
getResultSuccess
(
statusObj
);
})
})
}
}
...
@@ -610,7 +673,6 @@ class BaseQcService {
...
@@ -610,7 +673,6 @@ class BaseQcService {
var
timStr
=
moment
().
format
(
"YYYYMMDDHHmm"
);
var
timStr
=
moment
().
format
(
"YYYYMMDDHHmm"
);
return
prefix
+
timStr
+
uidStr
;
return
prefix
+
timStr
+
uidStr
;
}
}
/*
/*
len:返回长度
len:返回长度
radix:参与计算的长度,最大为62
radix:参与计算的长度,最大为62
...
@@ -635,6 +697,6 @@ class BaseQcService {
...
@@ -635,6 +697,6 @@ class BaseQcService {
return
uuid
.
join
(
''
);
return
uuid
.
join
(
''
);
}
}
}
}
module
.
exports
=
BaseQcService
;
module
.
exports
=
BaseQcService
;
\ No newline at end of file
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