Commit 40ffc754 by sxy

fix: 排序顺序

parent 4acfb3ae
......@@ -5,6 +5,9 @@ class BizoptDao extends Dao {
constructor() {
super(Dao.getModelName(BizoptDao));
}
orderBy() {
return [["updated_at", "DESC"]];
}
extraWhere(qobj, qw, qc) {
qc.raw = true;
qc.where.business_type = qc.where.business_type && [system.SERVICECODE.EDI, system.SERVICECODE.ICP].includes(qc.where.business_type) ? qc.where.business_type : {
......
......@@ -5,6 +5,9 @@ class DeliverDao extends Dao {
constructor() {
super(Dao.getModelName(DeliverDao));
}
orderBy() {
return [["updated_at", "DESC"]];
}
extraWhere(qobj, qw, qc) {
qc.raw = true;
qc.where.product_code = qc.where.product_code && [system.SERVICECODE.EDI, system.SERVICECODE.ICP].includes(qc.where.product_code) ? qc.where.product_code : {
......@@ -15,7 +18,7 @@ class DeliverDao extends Dao {
case "/deliveryManagement/wait":
qc.where.delivery_status = qc.where.delivery_status || {
[this.db.Op.in]: [system.SERVERSESTATUS.RECEIVED, system.SERVERSESTATUS.COLLECTING,
system.SERVERSESTATUS.SUBMITING, system.SERVERSESTATUS.DISPOSEING
system.SERVERSESTATUS.SUBMITING, system.SERVERSESTATUS.DISPOSEING, system.SERVERSESTATUS.POSTING
]
}
break
......
......@@ -85,7 +85,7 @@ class BizoptService extends ServiceBase {
flow_type: system.FLOWCODE.BIZ,
flow_id: pobj.bizId,
status_code: system.BUSSTATUS.CLOSED
}, t);
});
if (schemeResult) {
await this.schemeDao.updateByWhere({
scheme_status: system.SCHEMESTATUS.CLOSED
......@@ -96,7 +96,7 @@ class BizoptService extends ServiceBase {
flow_type: system.FLOWCODE.SCHEME,
flow_id: schemeResult.id,
status_code: system.SCHEMESTATUS.CLOSED
}, t);
});
}
return "success"
})
......
......@@ -59,7 +59,7 @@ class DeliverService extends ServiceBase {
flow_type: system.FLOWCODE.DELIVERY,
flow_id: pobj.deliver_id,
status_code: system.SERVERSESTATUS.SUBMITING
}, t);
});
}
return "SUCCESS"
......@@ -151,32 +151,44 @@ class DeliverService extends ServiceBase {
}
async addMail(pobj) {
/**
* 判断状态
* 保存 邮寄信息
* 更改流转状态
*/
let result = await this.dao.findInfo(pobj);
if (!result) {
throw new Error("交付单不可查看");
}
if (result.qualification) {
if (!result.qualification) {
throw new Error("请先上传资质信息");
}
if (result.delivery_status !== system.SERVERSESTATUS.DISPOSEING) {
throw new Error("该状态下不可填写邮寄信息");
}
const { material: { proposerInfo } } = result;
const { material } = result;
let { proposerInfo } = material
proposerInfo.recipientInfo = pobj.recipientInfo;
return this.db.transaction(async (t) => {
await this.materialDao.updateByWhere({
proposerInfo
}, {
id: material.id
}, t)
}, t);
});
/**
* 保存 邮寄信息
* 更改流转状态
*/
await this.dao.updateByWhere({
delivery_status: system.SERVERSESTATUS.POSTING,
}, {
id: pobj.id
}, t);
this.statuslogDao.create({
flow_type: system.FLOWCODE.DELIVERY,
flow_id: pobj.id,
status_code: system.SERVERSESTATUS.POSTING
});
return "success"
});
}
}
......
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