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
f10e68f9
Commit
f10e68f9
authored
Aug 07, 2020
by
linboxuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new opNeed
parent
b33aba45
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
123 additions
and
0 deletions
+123
-0
center-order/app/base/api/impl/action/opNeed.js
+54
-0
center-order/app/base/service/impl/dbneed/opneedinfoSve.js
+69
-0
No files found.
center-order/app/base/api/impl/action/opNeed.js
0 → 100644
View file @
f10e68f9
var
APIBase
=
require
(
"../../api.base"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
class
IcAPI
extends
APIBase
{
constructor
()
{
super
();
this
.
opNeedInfoSve
=
system
.
getObject
(
"service.dbneed.opNeedInfoSve"
);
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async
springBoard
(
pobj
,
qobj
,
req
)
{
if
(
!
pobj
.
actionType
)
{
return
system
.
getResult
(
null
,
"actionType参数不能为空"
);
}
if
(
pobj
.
actionType
==
'getPolicyNeedList'
||
pobj
.
actionType
==
'submitPolicyNeedNotes'
)
{
if
(
!
pobj
.
userInfo
)
{
return
system
.
getResult
(
system
.
noLogin
,
"user no login!"
);
}
if
(
!
pobj
.
appInfo
)
{
return
system
.
getResult
(
system
.
noLogin
,
"app is null!"
);
}
}
var
result
=
await
this
.
opActionProcess
(
pobj
,
pobj
.
actionType
,
req
);
return
result
;
}
async
opActionProcess
(
pobj
,
action_type
,
req
)
{
var
opResult
=
null
;
switch
(
action_type
)
{
case
"submitNeed"
:
//提交需求 2020 0807 lin 新增
opResult
=
await
this
.
opNeedInfoSve
.
submitNeed
(
pobj
,
pobj
.
actionBody
,
req
);
break
;
case
"needList"
:
//需求列表
opResult
=
await
this
.
opNeedInfoSve
.
needList
(
pobj
,
pobj
.
actionBody
);
break
;
case
"needClose"
:
//关闭需求
opResult
=
await
this
.
opNeedInfoSve
.
needClose
(
pobj
,
pobj
.
actionBody
,
req
);
break
;
case
"getItemByNeedNo"
:
//获取需求详情
opResult
=
await
this
.
needinfoSve
.
getItemByNeedNo
(
pobj
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
}
return
opResult
;
}
}
module
.
exports
=
IcAPI
;
\ No newline at end of file
center-order/app/base/service/impl/dbneed/opneedinfoSve.js
0 → 100644
View file @
f10e68f9
const
uuidv4
=
require
(
'uuid/v4'
);
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
var
moment
=
require
(
'moment'
)
class
NeedinfoService
extends
ServiceBase
{
constructor
()
{
super
(
"dbneed"
,
ServiceBase
.
getDaoName
(
NeedinfoService
));
this
.
execlient
=
system
.
getObject
(
"util.execClient"
);
this
.
needsolutionSve
=
system
.
getObject
(
"service.dbneed.needsolutionSve"
);
this
.
needsolutionDao
=
system
.
getObject
(
"db.dbneed.needsolutionDao"
);
this
.
needinfoDao
=
system
.
getObject
(
"db.dbneed.needinfoDao"
);
}
async
getItemByNeedNo
(
pobj
)
{
var
item
=
await
this
.
dao
.
getItemByNeedNo
(
pobj
.
actionBody
.
needNo
);
console
.
log
(
system
.
getResultSuccess
(
item
));
if
(
!
item
)
{
return
system
.
getResult
(
null
,
"需求数据为空,30210"
);
}
return
system
.
getResultSuccess
(
item
);
}
async
submitNeed
(
pobj
,
actionBody
,
req
)
{
var
needNo
=
await
this
.
getBusUid
(
"n"
);
if
(
!
actionBody
.
mobile
)
{
return
system
.
getResultFail
(
-
5002
,
"mobile不能为空"
);
}
if
(
!
actionBody
.
type
)
{
return
system
.
getResultFail
(
-
5003
,
"type不能为空"
);
}
var
nobj
=
{
uapp_id
:
pobj
.
appInfo
.
uapp_id
,
channelNeedNo
:
needNo
,
// 2020 0807 lin 修改内容 渠道需求号改为企服通需求号 不再单独获取新的uuid
needNo
:
needNo
,
channelUserId
:
pobj
.
userInfo
.
channel_userid
,
publishName
:
actionBody
.
userName
,
publishContent
:
actionBody
.
description
,
publishMobile
:
actionBody
.
mobile
,
city
:
actionBody
.
area
,
typeCode
:
actionBody
.
type_code
,
typeName
:
actionBody
.
type_name
,
channelTypeCode
:
actionBody
.
channel_type_code
,
channelTypeName
:
actionBody
.
channel_type_name
,
status
:
"wts"
}
await
this
.
dao
.
create
(
nobj
);
return
system
.
getResultSuccess
();
}
async
needClose
(
pobj
,
actionBody
,
req
)
{
var
needinfo
=
await
this
.
findOne
({
channelNeedNo
:
actionBody
.
needNo
});
if
(
!
needinfo
)
{
return
system
.
getResultFail
(
-
5004
,
"需求不存在"
);
}
if
(
needinfo
.
status
==
"ygb"
||
needinfo
.
status
==
"ycd"
)
{
return
system
.
getResultSuccess
();
}
else
{
needinfo
.
status
=
"ygb"
;
var
self
=
this
;
await
self
.
update
(
needinfo
.
dataValues
);
return
system
.
getResultSuccess
();
}
}
}
module
.
exports
=
NeedinfoService
;
// var a=new NeedinfoService();
// var b=a.getItemByChannelSolutionNo({actionBody:{bizId:"1593141330846"}});
\ 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