|
|
@ -66,16 +66,19 @@ class DieService { |
|
|
|
} |
|
|
|
}); |
|
|
|
const p = temp.map(async (item) => { |
|
|
|
console.log(item.coop_id); |
|
|
|
const chickenInfo = await getChickenByCoopIdAndHouseId( |
|
|
|
item.coop_id, |
|
|
|
item.house_id |
|
|
|
); |
|
|
|
console.log(chickenInfo); |
|
|
|
const coopInfo = await getCoopById(item.coop_id); |
|
|
|
item.batch_number = chickenInfo?.batch_number; |
|
|
|
item.coop_name = coopInfo?.coop_name; |
|
|
|
return item; |
|
|
|
}); |
|
|
|
const hasBatch = await Promise.all(p); |
|
|
|
// console.log(hasBatch);
|
|
|
|
// 根据批次号进行筛选
|
|
|
|
const result = hasBatch.filter((item) => { |
|
|
|
if (batch_number == "") { |
|
|
@ -151,8 +154,10 @@ class DieService { |
|
|
|
if (res) { |
|
|
|
// 死淘数量不大于进鸡数量-之前录入的该舍死淘数量
|
|
|
|
const dieInfos = await Die.findAll({ |
|
|
|
coop_id, |
|
|
|
house_id, |
|
|
|
where: { |
|
|
|
coop_id, |
|
|
|
house_id, |
|
|
|
}, |
|
|
|
}); |
|
|
|
const dieArr = dieInfos.map((item) => item.dataValues); |
|
|
|
let dieTotal = 0; |
|
|
|