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
9b13ef46
Commit
9b13ef46
authored
Aug 01, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
icp
parent
c8619ab6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
43 deletions
+48
-43
center-order/app/base/db/models/dbneed/needsolution.js
+1
-0
center-order/app/base/service/impl/dbneed/needsolutionSve.js
+1
-1
center-order/app/base/service/impl/qcutils/aliyunqcSve.js
+46
-42
No files found.
center-order/app/base/db/models/dbneed/needsolution.js
View file @
9b13ef46
...
...
@@ -21,6 +21,7 @@ module.exports = (db, DataTypes) => {
},
statusName
:
DataTypes
.
STRING
(
50
),
//状态名称
createUserId
:
DataTypes
.
INTEGER
,
//创建者id
isInvalid
:
DataTypes
.
INTEGER
,
//是否废弃的无效的方案
},
{
paranoid
:
true
,
//假的删除
underscored
:
true
,
...
...
center-order/app/base/service/impl/dbneed/needsolutionSve.js
View file @
9b13ef46
...
...
@@ -413,7 +413,7 @@ class NeedsolutionService extends ServiceBase {
return
system
.
getResultFail
(
-
103
,
"方案状态错误,不能废弃已完成方案"
);
}
}
await
this
.
dao
.
model
.
update
({
status
:
"yzf"
},
{
where
:
{
needNo
:
needinfo
.
needNo
}
});
//方案废弃
await
this
.
dao
.
model
.
update
({
status
:
"yzf"
,
isInvalid
:
1
},
{
where
:
{
needNo
:
needinfo
.
needNo
}
});
//方案废弃
return
system
.
getResultSuccess
();
}
...
...
center-order/app/base/service/impl/qcutils/aliyunqcSve.js
View file @
9b13ef46
...
...
@@ -58,7 +58,7 @@ class AliyunQcService{
}
//获取方案信息
var
ns
=
await
this
.
needsolutionDao
.
model
.
findAll
({
where
:
{
channelSolutionNo
:
ab
.
BizId
},
raw
:
true
where
:
{
channelSolutionNo
:
ab
.
BizId
,
isInvalid
:
0
},
raw
:
true
});
return
system
.
getResultSuccess
(
ns
);
}
...
...
@@ -121,7 +121,7 @@ class AliyunQcService{
ab
.
solutionContent
.
typeCode
=
needinfo
.
typeCode
;
ab
.
solutionContent
.
typeName
=
needinfo
.
typeName
;
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
++
)
{
var
fa
=
ns
[
i
];
...
...
@@ -131,10 +131,10 @@ class AliyunQcService{
if
(
fa
.
status
==
"ybh"
)
{
ab
.
channelSolutionNo
=
fa
.
channelSolutionNo
;
}
if
(
fa
.
status
==
"yzf"
)
{
ab
.
channelSolutionNo
=
""
;
}
}
// if (!ab.solutionContent.solution) {
// return system.getResultFail(-104, "业务方案信息不能为空");
// }
var
solution
=
ab
.
solutionContent
.
solution
;
if
(
!
solution
)
{
return
system
.
getResultFail
(
-
103
,
"方案交付信息有误"
);
...
...
@@ -146,12 +146,6 @@ class AliyunQcService{
}
else
{
return
system
.
getResultFail
(
-
208
,
"需求业务类型有误"
);
}
// ab.solutionContent.applicationStatusList = [{
// "OfficialFileURL": "",
// "ApplicationStatus": "submitIcpProgramme",
// "ApplicationStatusName": "提交方案",
// "created_at": new Date()
// }];
if
(
!
solution
.
CompanyName
)
{
return
system
.
getResultFail
(
-
105
,
"公司名不能为空"
);
}
...
...
@@ -255,7 +249,7 @@ class AliyunQcService{
}
//获取方案信息
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
channelSolutionNo
:
ab
.
BizId
},
raw
:
true
where
:
{
channelSolutionNo
:
ab
.
BizId
,
isInvalid
:
0
},
raw
:
true
});
if
(
!
ns
||
!
ns
.
id
)
{
return
system
.
getResultFail
(
-
300
,
"未知方案"
);
...
...
@@ -277,13 +271,19 @@ class AliyunQcService{
return
system
.
getResultFail
(
-
302
,
"方案流程状态错误,不能执行此操作"
);
}
solutionContent
.
serviceProviderNote
=
ab
.
Note
;
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
=
JSON
.
stringify
(
solutionContent
);
await
this
.
needsolutionDao
.
update
({
id
:
ns
.
id
,
status
:
"yzf"
,
solutionContent
:
solutionContent
});
//方案废弃
await
this
.
needsolutionDao
.
update
({
id
:
ns
.
id
,
status
:
"yzf"
,
isInvalid
:
1
,
solutionContent
:
solutionContent
});
//方案废弃
//获取方案信息
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
channelSolutionNo
:
ab
.
BizId
,
createUserId
:
user
.
id
},
raw
:
true
var
new_
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
id
:
ns
.
id
},
raw
:
true
});
return
system
.
getResultSuccess
(
ns
);
return
system
.
getResultSuccess
(
n
ew_n
s
);
}
//交付商提交材料信息
async
serviceProviderSubmitMaterial
(
pobj
){
...
...
@@ -308,7 +308,7 @@ class AliyunQcService{
if
(
!
user
||
!
user
.
id
)
{
return
system
.
getResultFail
(
-
100
,
"未知用户"
);
}
ab
[
"createUserId"
]
=
user
.
id
;
//
ab["createUserId"] = user.id;
if
(
!
ab
.
BizId
)
{
return
system
.
getResultFail
(
-
101
,
"渠道方案编号不能为空"
);
}
...
...
@@ -317,7 +317,8 @@ class AliyunQcService{
}
//获取方案信息
var
needsolutioninfo
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
channelSolutionNo
:
ab
.
BizId
},
raw
:
true
attributes
:[
"id"
,
"needNo"
,
"solutionContent"
],
where
:
{
channelSolutionNo
:
ab
.
BizId
,
isInvalid
:
0
},
raw
:
true
});
if
(
!
needsolutioninfo
||
!
needsolutioninfo
.
id
)
{
return
system
.
getResultFail
(
-
400
,
"未知方案"
);
...
...
@@ -370,10 +371,10 @@ class AliyunQcService{
var
self
=
this
;
return
await
this
.
needsolutionDao
.
db
.
transaction
(
async
function
(
t
)
{
await
self
.
needsolutionDao
.
update
(
needsolutioninfo
,
t
);
needsolutioninfo
=
await
self
.
needsolutionDao
.
model
.
findOne
({
where
:
{
channelSolutionNo
:
ab
.
BizI
d
},
raw
:
true
var
new_
needsolutioninfo
=
await
self
.
needsolutionDao
.
model
.
findOne
({
where
:
{
id
:
needsolutioninfo
.
i
d
},
raw
:
true
});
return
system
.
getResultSuccess
(
needsolutioninfo
);
return
system
.
getResultSuccess
(
ne
w_ne
edsolutioninfo
);
})
}
...
...
@@ -399,6 +400,7 @@ class AliyunQcService{
return
system
.
getResultFail
(
-
301
,
"未知方案"
);
}
ab
[
"BizId"
]
=
ns
.
channelSolutionNo
;
ab
[
"solutionNo"
]
=
ns
.
solutionNo
;
pobj
.
actionBody
=
ab
;
return
this
.
acceptIcpPartnerNotification
(
pobj
);
}
...
...
@@ -409,16 +411,20 @@ class AliyunQcService{
if
(
!
user
||
!
user
.
id
)
{
return
system
.
getResultFail
(
-
100
,
"未知用户"
);
}
ab
[
"createUserId"
]
=
user
.
id
;
if
(
!
ab
.
BizId
)
{
return
system
.
getResultFail
(
-
101
,
"渠道方案编号不能为空"
);
// 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
,
"通知状态不能为空"
);
}
//获取方案信息
var
needsolutioninfo
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
channelSolutionNo
:
ab
.
BizId
},
raw
:
true
attributes
:[
"id"
,
"status"
,
"solutionContent"
,
"needNo"
,
""
],
where
:
{
solutionNo
:
ab
.
solutionNo
},
raw
:
true
});
if
(
!
needsolutioninfo
||
!
needsolutioninfo
.
id
)
{
return
system
.
getResultFail
(
-
400
,
"未知方案"
);
...
...
@@ -433,10 +439,9 @@ class AliyunQcService{
if
(
solutionContent
.
applicationStatus
&&
solutionContent
.
applicationStatus
>
ab
.
ApplicationStatus
)
{
return
system
.
getResultFail
(
-
403
,
"操作失败,交付流程未按顺序执行"
);
}
// if (solutionContent.ApplicationStatus && solutionContent.ApplicationStatus==ab.ApplicationStatus) {
// return system.getResultFail(-403, "操作失败,该流程状态已提交,不能重复提交");
// }
// if(solutionContent.)
if
(
solutionContent
.
ApplicationStatus
&&
solutionContent
.
ApplicationStatus
==
ab
.
ApplicationStatus
)
{
return
system
.
getResultFail
(
-
405
,
"操作失败,该流程状态已提交,不能重复提交"
);
}
//获取需求信息
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
where
:
{
needNo
:
needsolutioninfo
.
needNo
},
raw
:
true
...
...
@@ -491,7 +496,7 @@ class AliyunQcService{
status
:
"GXB_REFUSE"
,
statusName
:
this
.
icpSolutionStatusReference
.
GXB_REFUSE
,
updated_at
:
new
Date
()
});
solutionContent
.
status
=
"GXB_REFUSE"
;
needsolutioninfo
.
status
=
"y
zf
"
;
needsolutioninfo
.
status
=
"y
wc
"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
GXB_REFUSE
;
}
if
(
ab
.
ApplicationStatus
==
511
)
{
//⼯商部通过
...
...
@@ -515,7 +520,7 @@ class AliyunQcService{
status
:
"GXB_FAIL"
,
statusName
:
this
.
icpSolutionStatusReference
.
GXB_FAIL
,
updated_at
:
new
Date
()
});
solutionContent
.
status
=
"GXB_FAIL"
;
needsolutioninfo
.
status
=
"y
zf
"
;
needsolutioninfo
.
status
=
"y
wc
"
;
solutionContent
.
statusName
=
this
.
icpSolutionStatusReference
.
GXB_FAIL
;
}
solutionContent
.
solutionFlowList
=
solutionFlowList
;
...
...
@@ -532,11 +537,7 @@ class AliyunQcService{
needsolutioninfo
.
solutionContent
=
JSON
.
stringify
(
solutionContent
);
var
self
=
this
;
return
await
this
.
needsolutionDao
.
db
.
transaction
(
async
function
(
t
)
{
delete
needsolutioninfo
[
"statusName"
];
await
self
.
needsolutionDao
.
update
(
needsolutioninfo
,
t
);
needsolutioninfo
=
await
self
.
needsolutionDao
.
model
.
findOne
({
where
:
{
channelSolutionNo
:
ab
.
BizId
},
raw
:
true
});
statusObj
[
"BizId"
]
=
ab
.
BizId
;
return
system
.
getResultSuccess
(
statusObj
);
})
...
...
@@ -553,7 +554,7 @@ class AliyunQcService{
}
//获取方案信息
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
channelSolutionNo
:
ab
.
BizId
},
raw
:
true
where
:
{
channelSolutionNo
:
ab
.
BizId
,
isInvalid
:
0
},
raw
:
true
});
if
(
!
ns
||
!
ns
.
id
)
{
return
system
.
getResultFail
(
-
102
,
"未知方案"
);
...
...
@@ -643,10 +644,11 @@ class AliyunQcService{
};
if
(
ab
.
status
==
"11"
)
{
//⽅案已关闭
updateObj
[
"status"
]
=
"yzf"
;
updateObj
[
"isInvalid"
]
=
1
;
}
await
this
.
needsolutionDao
.
update
(
updateObj
);
//方案状态修改
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
channelSolutionNo
:
ab
.
BizI
d
},
raw
:
true
var
new_
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
id
:
ns
.
i
d
},
raw
:
true
});
return
system
.
getResultSuccess
(
ns
);
}
...
...
@@ -674,7 +676,7 @@ class AliyunQcService{
}
//获取方案信息
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
channelNeedNo
:
ab
.
intentionBizId
,
status
:
"dqr"
},
raw
:
true
where
:
{
channelNeedNo
:
ab
.
intentionBizId
,
isInvalid
:
0
},
raw
:
true
});
if
(
!
ns
)
{
return
system
.
getResultFail
(
-
106
,
"未知方案"
);
...
...
@@ -688,14 +690,16 @@ class AliyunQcService{
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"
]
=
"
ywc
"
;
updateObj
[
"status"
]
=
"
dqr
"
;
}
else
if
(
ab
.
intentionStatus
==
4
)
{
updateObj
[
"status"
]
=
"
ywc
"
;
updateObj
[
"status"
]
=
"
dqr
"
;
}
else
if
(
ab
.
intentionStatus
==
5
)
{
updateObj
[
"status"
]
=
"yzf"
;
updateObj
[
"isInvalid"
]
=
1
;
}
else
{
return
system
.
getResultFail
(
-
107
,
"需求当前状态错误--"
+
ab
.
intentionStatus
);
}
...
...
@@ -715,7 +719,7 @@ class AliyunQcService{
return
system
.
getResultFail
(
-
102
,
"方案业务编号不能为空"
);
}
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
solutionNo
:
ab
.
solutionNo
},
raw
:
true
where
:
{
solutionNo
:
ab
.
solutionNo
,
isInvalid
:
0
},
raw
:
true
});
if
(
!
ns
||
!
ns
.
id
)
{
return
system
.
getResultFail
(
-
103
,
"未知方案"
);
...
...
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