Commit 80425617 by Sxy

fix: 分配

parent f0480d90
...@@ -131,12 +131,12 @@ class DeliverybillService extends ServiceBase { ...@@ -131,12 +131,12 @@ class DeliverybillService extends ServiceBase {
let { numbers, nickName, userId, opCode, phone, type } = pobj; let { numbers, nickName, userId, opCode, phone, type } = pobj;
switch (type) { switch (type) {
case System.FLOWCODE.DELIVERY: case System.FLOWCODE.DELIVERY:
let datas = await this.dao.findAll({ let bizDatas = await this.dao.findAll({
delivery_code: { delivery_code: {
$in: numbers $in: numbers
} }
}); });
if (datas.length !== numbers.length) { if (bizDatas.length !== numbers.length) {
throw new Error("请检查单号是否正确"); throw new Error("请检查单号是否正确");
} }
await this.dao.updateByWhere({ await this.dao.updateByWhere({
...@@ -151,7 +151,7 @@ class DeliverybillService extends ServiceBase { ...@@ -151,7 +151,7 @@ class DeliverybillService extends ServiceBase {
}); });
// 插入 流转 记录 // 插入 流转 记录
let logs = []; let logs = [];
for (let val of datas) { for (let val of bizDatas) {
logs.push({ logs.push({
demand_code: val.delivery_code, demand_code: val.delivery_code,
operator: { operator: {
...@@ -172,12 +172,12 @@ class DeliverybillService extends ServiceBase { ...@@ -172,12 +172,12 @@ class DeliverybillService extends ServiceBase {
this.operationrecordDao.bulkCreate(logs); this.operationrecordDao.bulkCreate(logs);
break break
case System.FLOWCODE.BIZ: case System.FLOWCODE.BIZ:
let datas = await this.bizoptDao.findAll({ let delDatas = await this.bizoptDao.findAll({
demand_code: { demand_code: {
$in: numbers $in: numbers
} }
}); });
if (datas.length !== datas.length) { if (delDatas.length !== numbers.length) {
throw new Error("请检查单号是否正确"); throw new Error("请检查单号是否正确");
} }
return this.db.transaction(async (t) => { return this.db.transaction(async (t) => {
...@@ -208,7 +208,7 @@ class DeliverybillService extends ServiceBase { ...@@ -208,7 +208,7 @@ class DeliverybillService extends ServiceBase {
}, t); }, t);
// 插入 流转 记录 // 插入 流转 记录
let logs = []; let logs = [];
for (let val of datas) { for (let val of delDatas) {
logs.push({ logs.push({
demand_code: val.demand_code, demand_code: val.demand_code,
operator: { operator: {
......
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