wwh преди 2 месеца
родител
ревизия
3b378ee332

+ 1 - 0
app-admin/src/main/java/com/ruoyi/web/v2/v1/controller/JsReportController.java

@@ -71,6 +71,7 @@ public class JsReportController {
         } else {
             queryWrapper.between("create_time", startTime + " 00:00:00", endTime + " 23:59:59");
         }
+        queryWrapper.lambda().orderByDesc(JsReport::getId);
         Page<JsReport> page = new Page<>(pageNum, pageSize);
         return success(reportService.page(page,queryWrapper));
     }

+ 7 - 0
app-admin/src/main/java/com/ruoyi/web/v2/v1/model/vo/HarmlessVo.java

@@ -40,4 +40,11 @@ public class HarmlessVo {
     private List<ProduceCheckVo> produceCheckVos;
 
     private Date createTime;
+
+    /**
+     * 静养病死数量
+     */
+    private Integer dealAmount;
+
+
 }

+ 1 - 1
app-admin/src/main/java/com/ruoyi/web/v2/v1/service/impl/JsDistributionServiceImpl.java

@@ -141,7 +141,7 @@ public class JsDistributionServiceImpl extends ServiceImpl<JsDistributionMapper,
             queryWrapper.between("distribution_time", startTime + " 00:00:00", endTime + " 23:59:59");
         }
 
-        queryWrapper.like(StringUtils.isNotEmpty(supplierName), "supplier_id", supplierName);
+        queryWrapper.like(StringUtils.isNotEmpty(supplierName), "supplier_name", supplierName);
         queryWrapper.eq(StringUtils.isNotEmpty(purchaserName), "purchaser_name", purchaserName);
 
         if (StringUtils.isNotEmpty(animalCertNo)) {

+ 19 - 1
app-admin/src/main/java/com/ruoyi/web/v2/v1/service/impl/JsDrugCheckServiceImpl.java

@@ -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());//生产检验