Commit bd8923e7 by sxy

feat: 筛选范围补充

parent ce4c87d3
......@@ -19,11 +19,11 @@ class BizOptCtl extends CtlBase {
val.customer_name = val.business_info.person;
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.schemeStatus = val["scheme.status"];
result.push(val);
}
rs.results.rows = result;
console.log(result[0]);
}
return system.getResult(rs);
}
......@@ -40,8 +40,11 @@ class BizOptCtl extends CtlBase {
if (!pobj.bizId) {
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 {
await this.service.closeBiz({ bizId: pobj.bizId });
await this.service.closeBiz({ bizId: pobj.bizId, close_reason: pobj.close_reason });
return system.getResultSuccess();
} catch (err) {
return system.getResult(null, err.message)
......
const system = require("../../../system");
const Dao = require("../../dao.base");
const url = require("url");
class BizoptDao extends Dao {
constructor() {
super(Dao.getModelName(BizoptDao));
}
extraWhere(qobj, qw, qc) {
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]
}
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;
}
async findBizAndSheme(id) {
......
......@@ -77,7 +77,8 @@ class BizoptService extends ServiceBase {
return this.db.transaction(async (t) => {
await this.dao.updateByWhere({
business_status: system.BUSSTATUS.CLOSED
business_status: system.BUSSTATUS.CLOSED,
close_reason: pobj.close_reason
}, {
id: pobj.bizId
}, t);
......@@ -87,7 +88,7 @@ class BizoptService extends ServiceBase {
status: system.BUSSTATUS.CLOSED
});
if (schemeResult) {
await this.dao.updateByWhere({
await this.schemeDao.updateByWhere({
status: system.SCHEMESTATUS.CLOSED
}, {
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