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