Commit 6aa83998 by 宋毅

tj

parent ca2a44bb
......@@ -31,13 +31,16 @@ class IcAPI extends APIBase {
var opResult = null;
switch (action_type) {
case "submitNeed"://提交需求
opResult = await this.needinfoSve.submitNeed(pobj,pobj.actionBody,req);
opResult = await this.needinfoSve.submitNeed(pobj, pobj.actionBody, req);
break;
case "getItemByNeedNo"://获取需求详情
opResult = await this.needinfoSve.getItemByNeedNo(pobj);
break;
case "getItemByChannelNeedNo"://获取需求详情
opResult = await this.needinfoSve.getItemByChannelNeedNo(pobj);
break;
case "needClose"://需求关闭
opResult = await this.needinfoSve.needClose(pobj,pobj.actionBody,req);
opResult = await this.needinfoSve.needClose(pobj, pobj.actionBody, req);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
......
......@@ -36,5 +36,37 @@ class NeedinfoDao extends Dao {
raw: true
});
}
async getItemByChannelNeedNo(channelNeedNo) {
return await this.model.findOne({
where: {
channelNeedNo: channelNeedNo
},
attributes: [
"id",
"uapp_id",
"needNo",
"channelNeedNo",
"channelUserId",
"followManUserId",
"followManMobile",
"city",
"province",
"publishContent",
"publishName",
"publishMobile",
"notes",
"followContent",
"disposeNotes",
"status",
"typeCode",
"typeName",
"channelTypeCode",
"channelTypeName",
"publisherOnlyCode",
"followManName",
"followManOnlyCode"],
raw: true
});
}
}
module.exports = NeedinfoDao;
......@@ -15,6 +15,13 @@ class NeedinfoService extends ServiceBase {
}
return system.getResultSuccess(item);
}
async getItemByChannelNeedNo(pobj) {
var item = await this.dao.getItemByChannelNeedNo(pobj.actionBody.needNo);
if (!item) {
return system.getResult(null, "需求数据为空,30210");
}
return system.getResultSuccess(item);
}
async needinfo2fq(pobj) {
pobj.actionBody.needNo = await this.getBusUid("n");
pobj.actionBody.uapp_id = pobj.appInfo.id;
......
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