Commit 86b0aecb by linboxuan

Merge branch 'center-order' of http://gitlab.gongsibao.com/jiangyong/zhichan into center-order

parents 550f434f 992eee3b
......@@ -18,7 +18,8 @@ class diagnosisneedbusService extends ServiceBase {
'publish_name',
'publish_mobile',
'status',
'status_name'
'status_name',
'updated_at'
],
order: [["updated_at", 'desc']]
}
......@@ -26,18 +27,27 @@ class diagnosisneedbusService extends ServiceBase {
if (data.diagnosisNo) {
where.diagnosis_no = { [this.db.Op.like]: `%${data.diagnosisNo}%` }
}
if (data.diagnosisTypeName) {
where.diagnosis_type_name = { [this.db.Op.like]: `%${data.diagnosisTypeName}%` }
}
if (data.publishMobile) {
where.publish_mobile = { [this.db.Op.like]: `%${data.publishMobile}%` }
}
if (data.status) {
where.status = data.status
}
if (data.publishName) {
where.publish_name = { [this.db.Op.like]: `%${data.publishName}%` }
}
if (data.updatedAt) {
where.updated_at = { [this.db.Op.between]: data.updatedAt }
if (data.stdate && data.endate) {
where.updated_at = { [this.db.Op.between]: [data.stdate, data.endate]}
}
if (data.corporateType) {
where.corporate_type = data.corporateType
}
if (data.diagnosis_mode) {
where.diagnosis_mode = data.diagnosis_mode
}
if (Object.keys(where).length > 0) {
query.where = where
}
......@@ -52,6 +62,9 @@ class diagnosisneedbusService extends ServiceBase {
async getDetail (pobj, id) {
try {
let res = await this.dao.findById(id)
if (res) {
res.auth_result_name = res.diagnosis_result == 'tg' ? '已认证' : '未认证'
}
return System.getResultSuccess(res)
} catch (error) {
return System.getResultFail(-1, error.message)
......
......@@ -4,14 +4,14 @@ const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
var moment = require('moment')
class NeedinfoService extends ServiceBase {
constructor() {
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) {
async getItemByNeedNo (pobj) {
var item = await this.dao.getItemByNeedNo(pobj.actionBody.needNo);
console.log(system.getResultSuccess(item));
if (!item) {
......@@ -20,7 +20,7 @@ class NeedinfoService extends ServiceBase {
return system.getResultSuccess(item);
}
async opSubmitNeed(pobj, actionBody, req) {
async opSubmitNeed (pobj, actionBody, req) {
var needNo = await this.getBusUid("n");
if (!actionBody.mobile) {
return system.getResultFail(-5002, "mobile不能为空");
......@@ -47,7 +47,7 @@ class NeedinfoService extends ServiceBase {
return system.getResultSuccess(r);
}
async opNeedList(pobj, actionBody, req) {
async opNeedList (pobj, actionBody, req) {
// 时间段,分页,排序,需求状态 条件展示未做
console.log(pobj);
console.log(pobj.actionBody);
......@@ -76,15 +76,15 @@ class NeedinfoService extends ServiceBase {
if (actionBody.publishMobile) {
sobj.search.publishMobile = actionBody.publishMobile
}
if (actionBody.updatedAt) {
sobj.search.updated_at = actionBody.updatedAt
if (actionBody.stdate && actionBody.endate) {
sobj.search.updated_at = { [this.db.Op.between]: [actionBody.stdate, actionBody.endate] }
}
var r = await this.dao.findAndCountAll(sobj);
return system.getResultSuccess(r);
}
async opNeedListBak(pobj, actionBody, req) {
let statusDic = ['wts','yts','ygj','ygb','ycd']
async opNeedListBak (pobj, actionBody, req) {
let statusDic = ['wts', 'yts', 'ygj', 'ygb', 'ycd']
var sobj = {
search: {
},
......@@ -111,14 +111,14 @@ class NeedinfoService extends ServiceBase {
if (actionBody.publishMobile) {
sobj.search.publishMobile = actionBody.publishMobile
}
if (actionBody.updatedAt) {
sobj.search.updated_at = actionBody.updatedAt
if (actionBody.stdate && actionBody.endate) {
sobj.search.updated_at = { [this.db.Op.between]: [actionBody.stdate, actionBody.endate] }
}
var r = await this.dao.findAndCountAll(sobj);
return system.getResultSuccess(r);
}
async opNeedClose(pobj, actionBody, req) {
async opNeedClose (pobj, actionBody, req) {
var needinfo = await this.findOne({ channelNeedNo: actionBody.needNo });
if (!needinfo) {
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