|
|
@@ -1,6 +1,7 @@
|
|
|
package com.ruoyi.web.v2.v1.service.impl;
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.ruoyi.app.DTO.AncimalDTO;
|
|
|
@@ -20,6 +21,7 @@ import com.ruoyi.web.v2.v1.utils.PaginationUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
import java.text.DecimalFormat;
|
|
|
import java.time.ZoneId;
|
|
|
@@ -241,18 +243,34 @@ public class JsDrugCheckServiceImpl extends ServiceImpl<JsDrugCheckMapper, JsDru
|
|
|
harmlessVo.setCargoOwner(supplier.getSupplierName());
|
|
|
harmlessVo.setCreateTime(Date.from(entranceBatch.getEntranceTime().atZone(ZoneId.systemDefault()).toInstant()));
|
|
|
HarmlessTreatment harmlessTreatment = harmlessTreatmentMapper.selectByEntraceBatchId(entranceBatch.getId());
|
|
|
+ //查询静养登记数据,获取静养登记病死数量
|
|
|
+ List<JsRestInspection> restInspections = restInspectionMapper.selectList(
|
|
|
+ new LambdaQueryWrapper<JsRestInspection>()
|
|
|
+ .like(JsRestInspection::getSeriesNo, entranceBatch.getAnimalCertNo())
|
|
|
+ .groupBy(JsRestInspection::getDealAmount));
|
|
|
if (ObjectUtil.isNotEmpty(harmlessTreatment)) {
|
|
|
harmlessVo.setDealReason(harmlessTreatment.getDealReason());
|
|
|
harmlessVo.setIllnessDeadAmount(harmlessTreatment.getIllnessDeadAmount());
|
|
|
harmlessVo.setIllnessDiseaseAmount(harmlessTreatment.getIllnessDiseaseAmount());
|
|
|
harmlessVo.setRoadDealAmount(harmlessTreatment.getRoadDealAmount());
|
|
|
- harmlessVo.setSnapKillAmount(harmlessTreatment.getSnapKillAmount());
|
|
|
+ //harmlessVo.setSnapKillAmount(harmlessTreatment.getSnapKillAmount());
|
|
|
+ if(!ObjectUtils.isEmpty(restInspections)) {
|
|
|
+ harmlessVo.setDealAmount(restInspections.stream()
|
|
|
+ .filter(item -> item.getDealAmount() != null)
|
|
|
+ .mapToInt(JsRestInspection::getDealAmount).sum());
|
|
|
+ //这里为了前端不做调整,将静养死亡的数量直接设置到急宰数量中(按老的逻辑,页面上显示的是静养死亡数量,实际映射的是急宰数量)
|
|
|
+ harmlessVo.setSnapKillAmount(harmlessVo.getDealAmount());
|
|
|
+ }else {
|
|
|
+ harmlessVo.setSnapKillAmount(0);
|
|
|
+ harmlessVo.setDealAmount(0);
|
|
|
+ }
|
|
|
} else {
|
|
|
harmlessVo.setDealReason("");
|
|
|
harmlessVo.setIllnessDeadAmount(0);
|
|
|
harmlessVo.setIllnessDiseaseAmount(0);
|
|
|
harmlessVo.setRoadDealAmount(0);
|
|
|
harmlessVo.setSnapKillAmount(0);
|
|
|
+ harmlessVo.setDealAmount(0);
|
|
|
}
|
|
|
List<ProduceCheckVo> checkVos = new ArrayList<>();
|
|
|
checkVos = produceCheckMapper.getAll(entranceBatch.getId().intValue());//生产检验
|