Commit cc8825c7 by linboxuan

opNeed add functions

parent 15ce8f2e
...@@ -30,16 +30,16 @@ class IcAPI extends APIBase { ...@@ -30,16 +30,16 @@ class IcAPI extends APIBase {
async opActionProcess(pobj, action_type, req) { async opActionProcess(pobj, action_type, req) {
var opResult = null; var opResult = null;
switch (action_type) { switch (action_type) {
case "submitNeed"://提交需求 2020 0807 lin 新增 case "opSubmitNeed"://提交需求 2020 0807 lin 新增
opResult = await this.opNeedInfoSve.submitNeed(pobj, pobj.actionBody, req); opResult = await this.opNeedInfoSve.opSubmitNeed(pobj, pobj.actionBody, req);
break; break;
case "needList"://需求列表 case "opNeedList"://需求列表
opResult = await this.opNeedInfoSve.needList(pobj, pobj.actionBody); opResult = await this.opNeedInfoSve.opNeedList(pobj, pobj.actionBody);
break; break;
case "needClose"://关闭需求 case "opNeedClose"://关闭需求
opResult = await this.opNeedInfoSve.needClose(pobj, pobj.actionBody, req); opResult = await this.opNeedInfoSve.opNeedClose(pobj, pobj.actionBody, req);
break; break;
case "getItemByNeedNo"://获取需求详情 case "opGetItemByNeedNo"://获取需求详情
opResult = await this.needinfoSve.getItemByNeedNo(pobj); opResult = await this.needinfoSve.getItemByNeedNo(pobj);
break; break;
default: default:
......
...@@ -20,7 +20,7 @@ class NeedinfoService extends ServiceBase { ...@@ -20,7 +20,7 @@ class NeedinfoService extends ServiceBase {
return system.getResultSuccess(item); return system.getResultSuccess(item);
} }
async submitNeed(pobj, actionBody, req) { async opSubmitNeed(pobj, actionBody, req) {
var needNo = await this.getBusUid("n"); var needNo = await this.getBusUid("n");
if (!actionBody.mobile) { if (!actionBody.mobile) {
return system.getResultFail(-5002, "mobile不能为空"); return system.getResultFail(-5002, "mobile不能为空");
...@@ -47,7 +47,20 @@ class NeedinfoService extends ServiceBase { ...@@ -47,7 +47,20 @@ class NeedinfoService extends ServiceBase {
return system.getResultSuccess(); return system.getResultSuccess();
} }
async needClose(pobj, actionBody, req) { async opNeedList(pobj, actionBody, req) {
// 时间段,分页,排序,需求状态 条件展示未做
var needinfo = await this.dao.model.findAll({
where:{
channelUserId: pobj.userInfo.channel_userid
},
order: [["id", 'desc']],
attributes: ["needNo", "status", "statusName"],
raw: true
});
return system.getResult(needinfo);
}
async opNeedClose(pobj, actionBody, req) {
var needinfo = await this.findOne({ channelNeedNo: actionBody.needNo }); var needinfo = await this.findOne({ channelNeedNo: actionBody.needNo });
if (!needinfo) { if (!needinfo) {
return system.getResultFail(-5004, "需求不存在"); return system.getResultFail(-5004, "需求不存在");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment