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
52724d3c
Commit
52724d3c
authored
Mar 19, 2020
by
王栋源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wdy
parent
843fcb5d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
23 deletions
+59
-23
center-order/app/base/api/impl/action/need.js
+2
-2
center-order/app/base/db/models/dbneed/needinfo.js
+3
-2
center-order/app/base/service/impl/dbneed/needinfoSve.js
+54
-19
No files found.
center-order/app/base/api/impl/action/need.js
View file @
52724d3c
...
@@ -31,13 +31,13 @@ class IcAPI extends APIBase {
...
@@ -31,13 +31,13 @@ class IcAPI extends APIBase {
var
opResult
=
null
;
var
opResult
=
null
;
switch
(
action_type
)
{
switch
(
action_type
)
{
case
"submitNeed"
:
//提交需求
case
"submitNeed"
:
//提交需求
opResult
=
await
this
.
needinfoSve
.
submitNeed
(
pobj
);
opResult
=
await
this
.
needinfoSve
.
submitNeed
(
pobj
,
pobj
.
actionBody
,
req
);
break
;
break
;
case
"getItemByNeedNo"
:
//获取需求详情
case
"getItemByNeedNo"
:
//获取需求详情
opResult
=
await
this
.
needinfoSve
.
getItemByNeedNo
(
pobj
);
opResult
=
await
this
.
needinfoSve
.
getItemByNeedNo
(
pobj
);
break
;
break
;
case
"needClose"
:
//需求关闭
case
"needClose"
:
//需求关闭
opResult
=
await
this
.
needinfoSve
.
needClose
(
pobj
);
opResult
=
await
this
.
needinfoSve
.
needClose
(
pobj
,
pobj
.
actionBody
,
req
);
break
;
break
;
default
:
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
...
...
center-order/app/base/db/models/dbneed/needinfo.js
View file @
52724d3c
...
@@ -20,13 +20,14 @@ module.exports = (db, DataTypes) => {
...
@@ -20,13 +20,14 @@ module.exports = (db, DataTypes) => {
productType_id
:
DataTypes
.
STRING
,
//产品类型Id
productType_id
:
DataTypes
.
STRING
,
//产品类型Id
notes
:
DataTypes
.
STRING
,
//备注
notes
:
DataTypes
.
STRING
,
//备注
disposeNotes
:
DataTypes
.
STRING
,
//处理的备注
disposeNotes
:
DataTypes
.
STRING
,
//处理的备注
statusName
:
DataTypes
.
STRING
,
status
:
{
status
:
{
//wts未推送,yts已推送,ygj已跟进,ycd已成单
//wts未推送,yts已推送,ygj已跟进,ycd已成单
type
:
DataTypes
.
ENUM
,
type
:
DataTypes
.
ENUM
,
values
:
Object
.
keys
(
uiconfig
.
config
.
pdict
.
push_chance_type
),
values
:
Object
.
keys
(
uiconfig
.
config
.
pdict
.
push_chance_type
),
set
:
function
(
val
)
{
set
:
function
(
val
)
{
this
.
setDataValue
(
"
chanceType
"
,
val
);
this
.
setDataValue
(
"
status
"
,
val
);
this
.
setDataValue
(
"
chanceType
Name"
,
uiconfig
.
config
.
pdict
.
push_chance_type
[
val
]);
this
.
setDataValue
(
"
status
Name"
,
uiconfig
.
config
.
pdict
.
push_chance_type
[
val
]);
}
}
},
},
city
:
DataTypes
.
STRING
(
50
),
// 城市
city
:
DataTypes
.
STRING
(
50
),
// 城市
...
...
center-order/app/base/service/impl/dbneed/needinfoSve.js
View file @
52724d3c
...
@@ -6,6 +6,7 @@ class NeedinfoService extends ServiceBase {
...
@@ -6,6 +6,7 @@ class NeedinfoService extends ServiceBase {
constructor
()
{
constructor
()
{
super
(
"dbneed"
,
ServiceBase
.
getDaoName
(
NeedinfoService
));
super
(
"dbneed"
,
ServiceBase
.
getDaoName
(
NeedinfoService
));
this
.
execlient
=
system
.
getObject
(
"util.execClient"
);
this
.
execlient
=
system
.
getObject
(
"util.execClient"
);
this
.
needsolutionSve
=
system
.
getObject
(
"service.dbneed.needsolutionSve"
);
}
}
async
getItemByNeedNo
(
pobj
)
{
async
getItemByNeedNo
(
pobj
)
{
var
item
=
await
this
.
dao
.
getItemByNeedNo
(
pobj
.
actionBody
.
needNo
);
var
item
=
await
this
.
dao
.
getItemByNeedNo
(
pobj
.
actionBody
.
needNo
);
...
@@ -45,46 +46,80 @@ class NeedinfoService extends ServiceBase {
...
@@ -45,46 +46,80 @@ class NeedinfoService extends ServiceBase {
// area
// area
// type
// type
// ext
// ext
async
submitNeed
(
pobj
,
actionBody
)
{
async
submitNeed
(
pobj
,
actionBody
,
req
)
{
var
needNo
=
await
this
.
getBusUid
(
"n"
);
var
needNo
=
await
this
.
getBusUid
(
"n"
);
if
(
actionBody
.
intentionBizId
)
{
if
(
!
actionBody
.
intentionBizId
)
{
return
system
.
getResult
(
null
,
"intentionBizId不能为空"
);
return
system
.
getResult
(
null
,
"intentionBizId不能为空"
);
}
}
if
(
actionBody
.
mobile
)
{
if
(
!
actionBody
.
mobile
)
{
return
system
.
getResult
(
null
,
"mobile不能为空"
);
return
system
.
getResult
(
null
,
"mobile不能为空"
);
}
}
if
(
actionBody
.
type
)
{
if
(
!
actionBody
.
type
)
{
return
system
.
getResult
(
null
,
"type不能为空"
);
return
system
.
getResult
(
null
,
"type不能为空"
);
}
}
var
ninfo
=
await
this
.
findOne
({
channelNeedNo
:
actionBody
.
intentionBizId
});
if
(
ninfo
)
{
return
{
"requestId"
:
req
.
requestId
,
"success"
:
true
,
"errorMsg"
:
"已存在"
,
"errorCode"
:
"ok"
};
}
var
nobj
=
{
var
nobj
=
{
uapp_id
:
pobj
.
appInfo
.
uapp_id
,
uapp_id
:
pobj
.
appInfo
.
uapp_id
,
channelNeedNo
:
actionBody
.
intentionBizId
,
channelNeedNo
:
actionBody
.
intentionBizId
,
needNo
:
needNo
,
needNo
:
needNo
,
channelUserId
:
pobj
.
userInfo
.
channel_userid
,
channelUserId
:
actionBody
.
mobile
,
publishName
:
actionBody
.
userName
,
publishName
:
actionBody
.
userName
,
publishContent
:
actionBody
.
description
,
publishContent
:
actionBody
.
description
,
publishMobile
:
actionBody
.
mobile
,
publishMobile
:
actionBody
.
mobile
,
city
:
actionBody
.
area
,
city
:
actionBody
.
area
,
disposeNotes
:
actionBody
.
ext
,
// disposeNotes: actionBody.ext,
channelTypeCode
:
actionBody
.
type
channelTypeCode
:
actionBody
.
type
,
status
:
"wts"
}
}
return
await
this
.
dao
.
create
(
nobj
);
await
this
.
dao
.
create
(
nobj
);
return
{
"requestId"
:
req
.
requestId
,
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
}
}
async
needClose
(
pobj
)
{
async
needClose
(
pobj
,
actionBody
,
req
)
{
if
(
actionBody
.
intentionBizId
)
{
if
(
!
actionBody
.
intentionBizId
)
{
return
system
.
getResult
(
null
,
"intentionBizId不能为空"
);
return
system
.
getResult
(
null
,
"intentionBizId不能为空"
);
}
}
var
needinfo
=
await
this
.
findOne
({
channelNeedNo
:
actionBody
.
intentionBizId
});
var
needinfo
=
await
this
.
findOne
({
channelNeedNo
:
actionBody
.
intentionBizId
});
needinfo
.
status
=
"ygb"
;
if
(
!
needinfo
)
{
var
self
=
this
;
return
{
return
await
self
.
db
.
transaction
(
async
function
(
t
)
{
"requestId"
:
req
.
requestId
,
await
self
.
update
(
needinfo
,
t
);
"success"
:
false
,
var
needsolutioninfo
=
await
self
.
needsolutionDao
.
findOne
({
channelNeedNo
:
pobj
.
actionBody
.
intentionBizId
},
t
)
"errorMsg"
:
"需求不存在"
,
needsolutioninfo
.
status
=
"yzf"
;
"errorCode"
:
"ok"
await
self
.
needsolutionDao
.
update
(
needsolutioninfo
,
t
);
};
// await
}
})
if
(
needinfo
.
status
==
"ygb"
||
needinfo
.
status
==
"ycd"
)
{
return
{
"requestId"
:
req
.
requestId
,
"success"
:
true
,
"errorMsg"
:
"需求已关闭"
,
"errorCode"
:
"ok"
};
}
else
{
needinfo
.
status
=
"ygb"
;
var
self
=
this
;
await
self
.
update
(
needinfo
.
dataValues
);
await
self
.
needsolutionSve
.
abolishProgrammeByNeed
(
pobj
);
return
{
"requestId"
:
req
.
requestId
,
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
}
}
}
async
flowinfo
(
obj
)
{
async
flowinfo
(
obj
)
{
...
...
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