Commit bd8923e7 by sxy

feat: 筛选范围补充

parent ce4c87d3
...@@ -19,11 +19,11 @@ class BizOptCtl extends CtlBase { ...@@ -19,11 +19,11 @@ class BizOptCtl extends CtlBase {
val.customer_name = val.business_info.person; val.customer_name = val.business_info.person;
val.updated_at = moment(val.updated_at).format('YYYY-MM-DD HH:mm:ss'); val.updated_at = moment(val.updated_at).format('YYYY-MM-DD HH:mm:ss');
val.created_at = moment(val.created_at).format('YYYY-MM-DD HH:mm:ss'); val.created_at = moment(val.created_at).format('YYYY-MM-DD HH:mm:ss');
val.schemeStatus = val["scheme.status"];
result.push(val); result.push(val);
} }
rs.results.rows = result; rs.results.rows = result;
console.log(result[0]);
} }
return system.getResult(rs); return system.getResult(rs);
} }
...@@ -40,8 +40,11 @@ class BizOptCtl extends CtlBase { ...@@ -40,8 +40,11 @@ class BizOptCtl extends CtlBase {
if (!pobj.bizId) { if (!pobj.bizId) {
return system.getResult(null, "bizId can not be empty,100290"); return system.getResult(null, "bizId can not be empty,100290");
} }
if (!pobj.close_reason) {
return system.getResult(null, "close_reason can not be empty,100290");
}
try { try {
await this.service.closeBiz({ bizId: pobj.bizId }); await this.service.closeBiz({ bizId: pobj.bizId, close_reason: pobj.close_reason });
return system.getResultSuccess(); return system.getResultSuccess();
} catch (err) { } catch (err) {
return system.getResult(null, err.message) return system.getResult(null, err.message)
......
const system = require("../../../system"); const system = require("../../../system");
const Dao = require("../../dao.base"); const Dao = require("../../dao.base");
const url = require("url");
class BizoptDao extends Dao { class BizoptDao extends Dao {
constructor() { constructor() {
super(Dao.getModelName(BizoptDao)); super(Dao.getModelName(BizoptDao));
} }
extraWhere(qobj, qw, qc) { extraWhere(qobj, qw, qc) {
qc.raw = true; qc.raw = true;
qc.where.business_type = qc.where.business_type || { qc.where.business_type = qc.where.business_type && [system.SERVICECODE.EDI, system.SERVICECODE.ICP].includes(qc.where.business_type) ? qc.where.business_type : {
[this.db.Op.in]: [system.SERVICECODE.EDI, system.SERVICECODE.ICP] [this.db.Op.in]: [system.SERVICECODE.EDI, system.SERVICECODE.ICP]
} }
switch (qobj.bizpath) {
case "/businessManagement/wailt":
qc.where.business_status = qc.where.business_status || {
[this.db.Op.in]: [system.BUSSTATUS.WAITINGSCHEME, system.BUSSTATUS.WAITINGCONFIRM]
}
break
case "businessManagement/all":
break
}
qc.include = [
{
model: this.db.models.scheme,
attributes: ["status"]
}
]
return qw; return qw;
} }
async findBizAndSheme(id) { async findBizAndSheme(id) {
......
...@@ -77,7 +77,8 @@ class BizoptService extends ServiceBase { ...@@ -77,7 +77,8 @@ class BizoptService extends ServiceBase {
return this.db.transaction(async (t) => { return this.db.transaction(async (t) => {
await this.dao.updateByWhere({ await this.dao.updateByWhere({
business_status: system.BUSSTATUS.CLOSED business_status: system.BUSSTATUS.CLOSED,
close_reason: pobj.close_reason
}, { }, {
id: pobj.bizId id: pobj.bizId
}, t); }, t);
...@@ -87,7 +88,7 @@ class BizoptService extends ServiceBase { ...@@ -87,7 +88,7 @@ class BizoptService extends ServiceBase {
status: system.BUSSTATUS.CLOSED status: system.BUSSTATUS.CLOSED
}); });
if (schemeResult) { if (schemeResult) {
await this.dao.updateByWhere({ await this.schemeDao.updateByWhere({
status: system.SCHEMESTATUS.CLOSED status: system.SCHEMESTATUS.CLOSED
}, { }, {
id: schemeResult.id id: schemeResult.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