Commit 40ffc754 by sxy

fix: 排序顺序

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