Commit 0cdb5c7d by wkliang

need user

parent 1ebb37c4
......@@ -2,28 +2,34 @@ var APIBase = require("../../api.base");
var system = require("../../../system");
var settings = require("../../../../config/settings");
class DiagnosisAPI extends APIBase {
constructor() {
constructor () {
super();
this.diagnosisSve = system.getObject("service.dbneed.diagnosisSve");
this.needSve = system.getObject('service.dbneed.opneedinfoSve')
}
/**
* 接口跳转-POST请求
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
async springBoard (pobj, qobj, req) {
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result;
}
async opActionProcess(pobj, action_type, req) {
async opActionProcess (pobj, action_type, req) {
var opResult = null;
switch (action_type) {
case "manualEvaluation"://提交需求 2020 0807 lin 新增
opResult = await this.diagnosisSve.manualEvaluation(pobj, pobj.actionBody, req);
break;
case 'getNeedList': // 需求列表 20 08 12 liang
opResult = await this.needSve.opNeedList(pobj, pobj.actionBody, req);
break
case 'getNeedDetail': // 需求详情 20 08 12 liang
opResult = await this.needSve.getItemByNeedNo(pobj);
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
......@@ -63,9 +63,22 @@ class NeedinfoService extends ServiceBase {
if (actionBody.ConsultType) {
sobj.search.consult_type = actionBody.consultType;
}
if (actionBody.status) {
// liang 追加筛选条件
if (actionBody.status && statusDic.indexOf(actionBody.status) != -1) {
sobj.search.status = actionBody.status;
}
if (actionBody.needNo) {
sobj.search.needNo = actionBody.needNo
}
if (actionBody.publishName) {
sobj.search.publishName = actionBody.publishName
}
if (actionBody.publishMobile) {
sobj.search.publishMobile = actionBody.publishMobile
}
if (actionBody.updatedAt) {
sobj.search.updated_at = actionBody.updatedAt
}
var r = await this.dao.findAndCountAll(sobj);
return system.getResultSuccess(r);
}
......@@ -99,7 +112,7 @@ class NeedinfoService extends ServiceBase {
sobj.search.publishMobile = actionBody.publishMobile
}
if (actionBody.updatedAt) {
sobj.search.updatedAt = actionBody.updatedAt
sobj.search.updated_at = actionBody.updatedAt
}
var r = await this.dao.findAndCountAll(sobj);
return system.getResultSuccess(r);
......
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