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
0584e4a2
Commit
0584e4a2
authored
Aug 11, 2020
by
王栋源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wdy
parent
1eae4ae6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
21 deletions
+22
-21
center-order/app/base/service/impl/dbneed/needinfoSve.js
+22
-21
No files found.
center-order/app/base/service/impl/dbneed/needinfoSve.js
View file @
0584e4a2
...
...
@@ -88,9 +88,9 @@ class NeedinfoService extends ServiceBase {
channelTypeName
:
actionBody
.
channel_type_name
,
status
:
"wts"
}
if
(
nobj
.
channelTypeCode
==
7
||
nobj
.
channelTypeCode
==
5
)
{
nobj
.
province
=
nobj
.
city
,
nobj
.
city
=
""
;
if
(
nobj
.
channelTypeCode
==
7
||
nobj
.
channelTypeCode
==
5
)
{
nobj
.
province
=
nobj
.
city
,
nobj
.
city
=
""
;
}
await
this
.
dao
.
create
(
nobj
);
return
system
.
getResultSuccess
();
...
...
@@ -131,9 +131,9 @@ class NeedinfoService extends ServiceBase {
channelTypeName
:
actionBody
.
channel_type_name
,
status
:
"wts"
}
if
(
nobj
.
channelTypeCode
==
7
||
nobj
.
channelTypeCode
==
5
)
{
nobj
.
province
=
nobj
.
city
,
nobj
.
city
=
""
;
if
(
nobj
.
channelTypeCode
==
7
||
nobj
.
channelTypeCode
==
5
)
{
nobj
.
province
=
nobj
.
city
,
nobj
.
city
=
""
;
}
await
this
.
dao
.
create
(
nobj
);
return
system
.
getResultSuccess
();
...
...
@@ -162,48 +162,49 @@ class NeedinfoService extends ServiceBase {
}
async
getItemByChannelSolutionNo
(
pobj
){
var
solutionitem
=
await
this
.
needsolutionDao
.
findOne
({
channelSolutionNo
:
pobj
.
actionBody
.
bizId
});
async
getItemByChannelSolutionNo
(
pobj
)
{
var
solutionitem
=
await
this
.
needsolutionDao
.
findOne
({
channelSolutionNo
:
pobj
.
actionBody
.
bizId
});
if
(
!
solutionitem
)
{
return
system
.
getResult
(
null
,
"需求数据为空,30210"
);
}
var
item
=
await
this
.
dao
.
getItemByNeedNo
(
solutionitem
.
needNo
);
item
.
solutionProvince
=
solutionitem
.
solutionContent
.
solution
.
Area
;
if
(
!
item
)
{
return
system
.
getResult
(
null
,
"需求数据为空,30210"
);
}
return
system
.
getResultSuccess
(
item
);
}
async
writeCommunicationLog
(
pobj
,
actionBody
)
{
async
writeCommunicationLog
(
pobj
,
actionBody
)
{
// 查询需求沟通记录
actionBody
.
Note
=
[
"noteTime"
,
moment
().
format
(
"YYYY-MM-DD HH:mm:ss"
),
"note"
,
actionBody
.
Note
];
let
needRes
=
await
this
.
findOne
({
channelNeedNo
:
actionBody
.
BizId
});
actionBody
.
Note
=
[
"noteTime"
,
moment
().
format
(
"YYYY-MM-DD HH:mm:ss"
),
"note"
,
actionBody
.
Note
];
let
needRes
=
await
this
.
findOne
({
channelNeedNo
:
actionBody
.
BizId
});
// 没有需求单直接返回
if
(
!
needRes
)
{
if
(
!
needRes
)
{
return
system
.
getResult
(
"没有这个需求单"
);
}
}
// 有需求单但没有沟通记录 直接set
if
(
!
needRes
.
followContent
)
{
if
(
!
needRes
.
followContent
)
{
var
sql
=
"update n_need_info set followContent=JSON_OBJECT(:followContent) where channelNeedNo=:BizId"
var
paramWhere
=
{
var
paramWhere
=
{
followContent
:
actionBody
.
Note
,
BizId
:
actionBody
.
BizId
};
var
updateRes
=
await
this
.
customUpdate
(
sql
,
paramWhere
);
if
(
updateRes
[
1
])
{
var
updateRes
=
await
this
.
customUpdate
(
sql
,
paramWhere
);
if
(
updateRes
[
1
])
{
return
system
.
getResultSuccess
();
}
return
system
.
getResult
(
"添加记录失败"
);
// 有需求单有沟通记录 json_array_append
// 有需求单有沟通记录 json_array_append
}
else
{
var
sql
=
"update n_need_info set followContent=json_array_append(followContent, '$', JSON_OBJECT(:Note)) where channelNeedNo=:BizId"
// var sql = "update n_need_info set followContent=json_array_append(followContent, '$', "+ "\"" + JSON.stringify(actionBody.Note) + "\""+") where channelNeedNo="+ "\"" +actionBody.BizId +"\"" +" "
var
paramWhere
=
{
var
paramWhere
=
{
Note
:
actionBody
.
Note
,
BizId
:
actionBody
.
BizId
};
var
updateRes
=
await
this
.
customUpdate
(
sql
,
paramWhere
);
if
(
updateRes
[
1
])
{
var
updateRes
=
await
this
.
customUpdate
(
sql
,
paramWhere
);
if
(
updateRes
[
1
])
{
return
system
.
getResultSuccess
();
}
return
system
.
getResult
(
"添加记录失败"
);
...
...
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