Przeglądaj źródła

v3项目-问题修复0906

wwh 2 miesięcy temu
rodzic
commit
5714887f74

+ 1 - 1
app-admin/pom.xml

@@ -10,7 +10,7 @@
     <modelVersion>4.0.0</modelVersion>
     <packaging>jar</packaging>
     <artifactId>app-admin</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
+    <version>0.0.2-SNAPSHOT</version>
     <description>
         web服务入口
     </description>

+ 2 - 1
app-admin/src/main/java/com/ruoyi/web/controller/app/EntranceBatchController.java

@@ -54,7 +54,8 @@ public class EntranceBatchController extends BaseController
     @GetMapping("/page")
     public TableDataInfo page(EntranceBatch entranceBatch)
     {
-        List<EntranceBatch> list = entranceBatchService.selectEntranceBatchList1(entranceBatch);
+        //List<EntranceBatch> list = entranceBatchService.selectEntranceBatchList1(entranceBatch);
+        List<EntranceBatch> list = entranceBatchService.selectEntranceBatchList2(entranceBatch);
         return getDataTable(list);
     }
 

+ 1 - 1
app-common/pom.xml

@@ -10,7 +10,7 @@
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>app-common</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
+    <version>0.0.2-SNAPSHOT</version>
     <description>
         common通用工具
     </description>

+ 2 - 2
app-framework/pom.xml

@@ -10,7 +10,7 @@
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>app-framework</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
+    <version>0.0.2-SNAPSHOT</version>
     <description>
         framework框架核心
     </description>
@@ -57,7 +57,7 @@
         <dependency>
             <groupId>com.ruoyi</groupId>
             <artifactId>app-system</artifactId>
-            <version>0.0.1-SNAPSHOT</version>
+            <version>0.0.2-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>com.baomidou</groupId>

+ 2 - 2
app-system/pom.xml

@@ -10,7 +10,7 @@
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>app-system</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
+    <version>0.0.2-SNAPSHOT</version>
     <description>
         system系统模块
     </description>
@@ -21,7 +21,7 @@
         <dependency>
             <groupId>com.ruoyi</groupId>
             <artifactId>app-common</artifactId>
-            <version>0.0.1-SNAPSHOT</version>
+            <version>0.0.2-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.projectlombok</groupId>

+ 16 - 0
app-system/src/main/java/com/ruoyi/app/mapper/DivideCircleMapper.java

@@ -0,0 +1,16 @@
+package com.ruoyi.app.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.app.model.DivideCircle;
+
+/**
+ * <p>
+ * v2.0分圈登记 Mapper 接口
+ * </p>
+ *
+ * @author author
+ * @since 2025-05-22
+ */
+public interface DivideCircleMapper extends BaseMapper<DivideCircle> {
+
+}

+ 73 - 0
app-system/src/main/java/com/ruoyi/app/model/DivideCircle.java

@@ -0,0 +1,73 @@
+package com.ruoyi.app.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * v2.0分圈登记
+ * </p>
+ *
+ * @author author
+ * @since 2025-05-22
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("js_divide_circle")
+public class DivideCircle implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    //@ApiModelProperty(value = "分圈日期")
+    private String divideTime;
+
+    //@ApiModelProperty(value = "待宰圈号")
+    private String pigpenName;
+
+    //@ApiModelProperty(value = "待宰圈号id")
+    private Integer pigpenId;
+
+    //@ApiModelProperty(value = "供应商id")
+    private Integer supplierId;
+
+    //@ApiModelProperty(value = "供应商")
+    private String supplierName;
+
+    //@ApiModelProperty(value = "检疫证号")
+    private String animalCertNo;
+
+    //ApiModelProperty(value = "动物品种")
+    private String variety;
+
+    //ApiModelProperty(value = "数量")
+    private Integer amount;
+
+    //ApiModelProperty(value = "静养巡查id")
+    private String restInspectionId;
+
+    //ApiModelProperty(value = "消毒情况:已消毒/未消毒")
+    private Integer disinfect;
+
+    //ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    //ApiModelProperty(value = "批次id")
+    private Integer entranceBatchId;
+
+    //ApiModelProperty(value = "批次序列号")
+    private String seriesNo;
+
+    //ApiModelProperty(value = "是否闭环标记:opened表示未闭环,closed表示已闭环")
+    private String statusFlag;
+}

+ 5 - 0
app-system/src/main/java/com/ruoyi/app/service/IEntranceBatchService.java

@@ -31,6 +31,11 @@ public interface IEntranceBatchService
     public List<EntranceBatch> selectEntranceBatchList1(EntranceBatch entranceBatch);
 
     /**
+     * 完工报告逻辑修正
+     */
+    public List<EntranceBatch> selectEntranceBatchList2(EntranceBatch entranceBatch);
+
+    /**
      * 校验检疫证号是否唯一
      *
      * @param entranceBatch 入场批次

+ 35 - 4
app-system/src/main/java/com/ruoyi/app/service/impl/EntranceBatchServiceImpl.java

@@ -1,20 +1,24 @@
 package com.ruoyi.app.service.impl;
 
+import java.time.ZoneId;
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
+import java.util.stream.Collectors;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.ruoyi.app.DTO.JsReportDto;
-import com.ruoyi.app.mapper.DistributeBatchMapper;
-import com.ruoyi.app.mapper.EntranceInspectionMapper;
-import com.ruoyi.app.mapper.HarmlessTreatmentMapper;
+import com.ruoyi.app.mapper.*;
+import com.ruoyi.app.model.DivideCircle;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.ruoyi.app.mapper.EntranceBatchMapper;
 import com.ruoyi.app.model.EntranceBatch;
 import com.ruoyi.app.service.IEntranceBatchService;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.ObjectUtils;
 
 /**
  * 入场批次Service业务层处理
@@ -36,6 +40,9 @@ public class EntranceBatchServiceImpl implements IEntranceBatchService {
     @Autowired
     private HarmlessTreatmentMapper harmlessTreatmentMapper;
 
+    @Autowired
+    private DivideCircleMapper divideCircleMapper;
+
 
     /**
      * 查询入场批次
@@ -68,6 +75,30 @@ public class EntranceBatchServiceImpl implements IEntranceBatchService {
 
     }
 
+    @Override
+    public List<EntranceBatch> selectEntranceBatchList2(EntranceBatch entranceBatch) {
+        List<EntranceBatch> list;
+        if(!ObjectUtils.isEmpty(entranceBatch.getEntranceTime())) {
+            //限定数据的日期范围
+            entranceBatch.setCreateTime(Date.from(entranceBatch.getEntranceTime().atZone(ZoneId.systemDefault()).toInstant()));
+            //检索出猪圈状态为开放的所有批次
+            List<DivideCircle> closedList = divideCircleMapper.selectList(new LambdaQueryWrapper<DivideCircle>().eq(DivideCircle::getStatusFlag, "closed"));
+            //过滤掉所有状态是closed的批次(保留状态是opened的批次以及还未分圈的批次)
+//            list = entranceBatchMapper.selectEntranceBatchList1(entranceBatch).stream().filter(item1 -> openList.stream()
+//                    .anyMatch(item2 -> item2.getAnimalCertNo().equals(item1.getAnimalCertNo())))
+//                    .collect(Collectors.toList());
+            list = entranceBatchMapper.selectEntranceBatchList1(entranceBatch).stream()
+                    .filter(item1 -> closedList.stream()
+                            .noneMatch(item2 -> item2.getAnimalCertNo().equals(item1.getAnimalCertNo())))
+                    .collect(Collectors.toList());
+        }else {
+            //如果输入参数不带时间,就按普通分页查询进行处理
+            list = entranceBatchMapper.selectEntranceBatchList1(entranceBatch);
+        }
+        return list;
+
+    }
+
     /**
      * 校验检疫证号是否唯一
      *

+ 3 - 3
pom.xml

@@ -197,21 +197,21 @@
             <dependency>
                 <groupId>com.ruoyi</groupId>
                 <artifactId>app-framework</artifactId>
-                <version>0.0.1-SNAPSHOT</version>
+                <version>0.0.2-SNAPSHOT</version>
             </dependency>
 
             <!-- 系统模块-->
             <dependency>
                 <groupId>com.ruoyi</groupId>
                 <artifactId>app-system</artifactId>
-                <version>0.0.1-SNAPSHOT</version>
+                <version>0.0.2-SNAPSHOT</version>
             </dependency>
 
             <!-- 通用工具-->
             <dependency>
                 <groupId>com.ruoyi</groupId>
                 <artifactId>app-common</artifactId>
-                <version>0.0.1-SNAPSHOT</version>
+                <version>0.0.2-SNAPSHOT</version>
             </dependency>
 
         </dependencies>