wwh 1 ヶ月 前
コミット
42f69fc5cf
21 ファイル変更313 行追加128 行削除
  1. 47 0
      ruoyi-admin/pom.xml
  2. 2 0
      ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java
  3. 11 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/app/EntranceBatchController.java
  4. 27 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/app/HarmlessTreatmentController.java
  5. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/app/HookRegisterController.java
  6. 9 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/app/PigpenController.java
  7. 7 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/app/ProductCategoryController.java
  8. 1 1
      ruoyi-admin/src/main/resources/application-druid.yml
  9. 14 1
      ruoyi-admin/src/main/resources/application.yml
  10. 6 0
      ruoyi-framework/pom.xml
  11. 6 1
      ruoyi-framework/src/main/java/com/ruoyi/framework/config/MyBatisConfig.java
  12. 9 0
      ruoyi-system/src/main/java/com/ruoyi/app/DTO/HarmlessSumDTO.java
  13. 87 70
      ruoyi-system/src/main/java/com/ruoyi/app/domain/HarmlessTreatment.java
  14. 44 34
      ruoyi-system/src/main/java/com/ruoyi/app/domain/Pigpen.java
  15. 6 0
      ruoyi-system/src/main/java/com/ruoyi/app/mapper/EntranceBatchMapper.java
  16. 2 0
      ruoyi-system/src/main/java/com/ruoyi/app/mapper/HarmlessTreatmentMapper.java
  17. 8 8
      ruoyi-system/src/main/java/com/ruoyi/app/service/IHookRegisterService.java
  18. 7 7
      ruoyi-system/src/main/java/com/ruoyi/app/service/impl/HookRegisterServiceImpl.java
  19. 5 1
      ruoyi-system/src/main/resources/mapper/app/EntranceBatchMapper.xml
  20. 12 1
      ruoyi-system/src/main/resources/mapper/app/HarmlessTreatmentMapper.xml
  21. 2 1
      ruoyi-system/src/main/resources/mapper/app/PigpenMapper.xml

+ 47 - 0
ruoyi-admin/pom.xml

@@ -73,6 +73,39 @@
             <artifactId>caffeine</artifactId>
             <version>2.9.3</version>
         </dependency>
+
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.7.11</version>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>3.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-extension</artifactId>
+            <version>3.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+            <version>3.2.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+
+        <dependency>
+            <groupId>com.jcraft</groupId>
+            <artifactId>jsch</artifactId>
+            <version>0.1.54</version>
+        </dependency>
     </dependencies>
 
     <build>
@@ -103,6 +136,20 @@
            </plugin>   
         </plugins>
         <finalName>${project.artifactId}</finalName>
+
+     <!--   <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+            <resource>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*.xml</include>
+                </includes>
+                <filtering>false</filtering>
+            </resource>
+        </resources>-->
+
     </build>
 
 </project>

+ 2 - 0
ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java

@@ -1,6 +1,7 @@
 package com.ruoyi;
 
 import com.ruoyi.web.core.nfid.NFIDServer;
+import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@@ -12,6 +13,7 @@ import org.springframework.context.ApplicationContext;
  * @author ruoyi
  */
 @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
+@MapperScan("com.ruoyi.web.v2.v1.mapper")
 public class RuoYiApplication
 {
     public static void main(String[] args) throws Exception

+ 11 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/app/EntranceBatchController.java

@@ -48,6 +48,17 @@ public class EntranceBatchController extends BaseController
     }
 
     /**
+     * 查询入场批次列表
+     */
+    @PreAuthorize("@ss.hasPermi('app:entranceBatch:page')")
+    @GetMapping("/page")
+    public TableDataInfo page(EntranceBatch entranceBatch)
+    {
+        List<EntranceBatch> list = entranceBatchService.selectEntranceBatchList(entranceBatch);
+        return getDataTable(list);
+    }
+
+    /**
      * 导出入场批次列表
      */
     @PreAuthorize("@ss.hasPermi('app:entranceBatch:export')")

+ 27 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/app/HarmlessTreatmentController.java

@@ -2,6 +2,12 @@ package com.ruoyi.web.controller.app;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.ruoyi.app.domain.EntranceBatch;
+import com.ruoyi.app.service.IEntranceBatchService;
+import com.ruoyi.web.v2.v1.entity.JsDivideCircle;
+import com.ruoyi.web.v2.v1.service.IJsDivideCircleService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
@@ -34,6 +40,10 @@ public class HarmlessTreatmentController extends BaseController
 {
     @Autowired
     private IHarmlessTreatmentService harmlessTreatmentService;
+    @Autowired
+    private IJsDivideCircleService divideCircleService;
+    @Autowired
+    private IEntranceBatchService entranceBatchService;
 
     /**
      * 查询无害化处理列表
@@ -78,7 +88,7 @@ public class HarmlessTreatmentController extends BaseController
     {
         //判断全部数量是否超出了入场数量
         if(!harmlessTreatmentService.checkTotalLessThanAmount(harmlessTreatment)){
-            return error("新增无害化处理失败,病死头数、病害头数或急宰头数输入错误");
+            return error("新增无害化处理失败,病死头数、病害头数、途亡头数或急宰头数输入错误");
         }
         harmlessTreatment.setCreateBy(getUsername());
         return toAjax(harmlessTreatmentService.insertHarmlessTreatment(harmlessTreatment));
@@ -94,7 +104,13 @@ public class HarmlessTreatmentController extends BaseController
     {
         //判断全部数量是否超出了入场数量
         if(!harmlessTreatmentService.checkTotalLessThanAmount(harmlessTreatment)){
-            return error("修改无害化处理失败,病死头数、病害头数或急宰头数输入错误");
+            return error("修改无害化处理失败,病死头数、病害头数、途亡头数或急宰头数输入错误");
+        }
+        //判断是否填写分圈
+        EntranceBatch entranceBatch = entranceBatchService.selectEntranceBatchById(harmlessTreatment.getEntranceBatchId());
+        int count = divideCircleService.count(new QueryWrapper<JsDivideCircle>().eq("animal_cert_no", entranceBatch.getAnimalCertNo()));
+        if (count != 0) {
+            return error("已经填写分圈,不可修改无害化处理");
         }
         harmlessTreatment.setUpdateBy(getUsername());
         return toAjax(harmlessTreatmentService.updateHarmlessTreatment(harmlessTreatment));
@@ -108,6 +124,15 @@ public class HarmlessTreatmentController extends BaseController
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)
     {
+        //判断是否填写分圈
+        for (Long id : ids) {
+            HarmlessTreatment harmlessTreatment = harmlessTreatmentService.selectHarmlessTreatmentById(id);
+            EntranceBatch entranceBatch = entranceBatchService.selectEntranceBatchById(harmlessTreatment.getEntranceBatchId());
+            int count = divideCircleService.count(new QueryWrapper<JsDivideCircle>().eq("animal_cert_no", entranceBatch.getAnimalCertNo()));
+            if (count != 0) {
+                return error("已经填写分圈,不可修改无害化处理");
+            }
+        }
         return toAjax(harmlessTreatmentService.deleteHarmlessTreatmentByIds(ids));
     }
 }

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

@@ -19,7 +19,7 @@ import java.util.List;
 
 /**
  * 吊钩注册Controller
- * 
+ *
  * @author coede
  * @date 2025-03-19
  */

+ 9 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/app/PigpenController.java

@@ -100,6 +100,9 @@ public class PigpenController extends BaseController
         {
             return error("修改待宰圈'" + pigpen.getPigpenName() + "'失败,列表中存在重复的待宰圈号");
         }
+        if (pigpen.getIsUse() != 0) {
+            return error("修改待宰圈失败,待宰圈正在使用");
+        }
         pigpen.setUpdateBy(getUsername());
         return toAjax(pigpenService.updatePigpen(pigpen));
     }
@@ -112,6 +115,12 @@ public class PigpenController extends BaseController
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)
     {
+        for (Long id : ids) {
+            Pigpen pigpen = pigpenService.selectPigpenById(id);
+            if (pigpen.getIsUse() != 0) {
+                return error("删除待宰圈失败,待宰圈正在使用");
+            }
+        }
         return toAjax(pigpenService.deletePigpenByIds(ids));
     }
 

+ 7 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/app/ProductCategoryController.java

@@ -48,6 +48,13 @@ public class ProductCategoryController extends BaseController
         return getDataTable(list);
     }
 
+    @GetMapping("/page")
+    public TableDataInfo page(ProductCategory productCategory)
+    {
+        List<ProductCategory> list = productCategoryService.selectProductCategoryList(productCategory);
+        return getDataTable(list);
+    }
+
     /**
      * 导出产品分类列表
      */

+ 1 - 1
ruoyi-admin/src/main/resources/application-druid.yml

@@ -6,7 +6,7 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://localhost:3306/huimv-tuzai?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                url: jdbc:mysql://122.112.224.199:3306/huimv-jiangshang?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: root
                 password: hm123456
             # 从库数据源

+ 14 - 1
ruoyi-admin/src/main/resources/application.yml

@@ -76,7 +76,7 @@ spring:
     # 数据库索引
     database: 10
     # 密码
-    password: hm123456
+#    password: 123456
     # 连接超时时间
     timeout: 10s
     lettuce:
@@ -108,6 +108,7 @@ mybatis:
   # 加载全局的配置文件
   configLocation: classpath:mybatis/mybatis-config.xml
 
+
 # PageHelper分页插件
 pagehelper:
   helperDialect: mysql
@@ -129,3 +130,15 @@ xss:
   excludes: /system/notice
   # 匹配链接
   urlPatterns: /system/*,/monitor/*,/tool/*
+
+
+mybatis-plus:
+  mapper-locations: classpath*:mapper/*.xml
+
+img:
+  url: https://img.ifarmcloud.com/images/
+  basePath: /home/huimv/img/
+  ip: 119.3.44.183
+  user:  huimv
+  password: "!hm123@1"
+  port: 22

+ 6 - 0
ruoyi-framework/pom.xml

@@ -58,6 +58,12 @@
             <groupId>com.ruoyi</groupId>
             <artifactId>ruoyi-system</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-extension</artifactId>
+            <version>3.5.3.1</version>
+            <scope>compile</scope>
+        </dependency>
 
     </dependencies>
 

+ 6 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/config/MyBatisConfig.java

@@ -6,6 +6,8 @@ import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
 import javax.sql.DataSource;
+
+import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
 import org.apache.ibatis.io.VFS;
 import org.apache.ibatis.session.SqlSessionFactory;
 import org.mybatis.spring.SqlSessionFactoryBean;
@@ -122,11 +124,14 @@ public class MyBatisConfig
         typeAliasesPackage = setTypeAliasesPackage(typeAliasesPackage);
         VFS.addImplClass(SpringBootVFS.class);
 
-        final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
+        //final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
+        // SqlSessionFactoryBean 替换为 ⬇ MybatisSqlSessionFactoryBean
+        final MybatisSqlSessionFactoryBean sessionFactory = new MybatisSqlSessionFactoryBean();
         sessionFactory.setDataSource(dataSource);
         sessionFactory.setTypeAliasesPackage(typeAliasesPackage);
         sessionFactory.setMapperLocations(resolveMapperLocations(StringUtils.split(mapperLocations, ",")));
         sessionFactory.setConfigLocation(new DefaultResourceLoader().getResource(configLocation));
         return sessionFactory.getObject();
     }
+
 }

+ 9 - 0
ruoyi-system/src/main/java/com/ruoyi/app/DTO/HarmlessSumDTO.java

@@ -5,9 +5,18 @@ import java.math.BigDecimal;
 public class HarmlessSumDTO {
     private Long illnessDeadAmountSum;
     private Long illnessDiseaseAmountSum;
+    private Long roadDealAmountSum;
     private Long snapKillAmountSum;
     private BigDecimal unqualifiedWeightSum;
 
+    public Long getRoadDealAmountSum() {
+        return roadDealAmountSum;
+    }
+
+    public void setRoadDealAmountSum(Long roadDealAmountSum) {
+        this.roadDealAmountSum = roadDealAmountSum;
+    }
+
     public Long getIllnessDeadAmountSum() {
         return illnessDeadAmountSum;
     }

+ 87 - 70
ruoyi-system/src/main/java/com/ruoyi/app/domain/HarmlessTreatment.java

@@ -1,6 +1,7 @@
 package com.ruoyi.app.domain;
 
 import java.math.BigDecimal;
+
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
@@ -10,181 +11,197 @@ import javax.validation.constraints.*;
 
 /**
  * 无害化处理对象 harmless_treatment
- * 
+ *
  * @author coede
  * @date 2025-03-19
  */
-public class HarmlessTreatment extends BaseEntity
-{
+public class HarmlessTreatment extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** ID */
+    /**
+     * ID
+     */
     private Long id;
 
-    /** 入场批次 */
+    /**
+     * 入场批次
+     */
     @Excel(name = "入场批次")
     private Long entranceBatchId;
 
-    /** 病死数 */
+    /**
+     * 病死数
+     */
     @Excel(name = "病死数")
     private Integer illnessDeadAmount;
 
-    /** 病害数量 */
+    /**
+     * 病害数量
+     */
     @Excel(name = "病害数量")
     private Integer illnessDiseaseAmount;
 
-    /** 急宰数量 */
+    @Min(value = 0, message = "途亡数量输入超出设定范围限制(0~999)")
+    @Max(value = 999, message = "途亡数量输入超出设定范围限制(0~999)")
+    public Integer getRoadDealAmount() {
+        return roadDealAmount;
+    }
+
+    public void setRoadDealAmount(Integer roadDealAmount) {
+        this.roadDealAmount = roadDealAmount;
+    }
+
+    /**
+     * 病害数量
+     */
+    @Excel(name = "途亡数量")
+    private Integer roadDealAmount;
+
+    /**
+     * 急宰数量
+     */
     @Excel(name = "急宰数量")
     private Integer snapKillAmount;
 
-    /** 不合格产品数量 */
+    /**
+     * 不合格产品数量
+     */
     @Excel(name = "不合格产品数量")
     private BigDecimal unqualifiedWeight;
 
-    /** 无害化生猪详情 */
+    /**
+     * 无害化生猪详情
+     */
     @Excel(name = "无害化生猪详情")
     private String illnessPigsDetail;
 
-    /** 处理原因 */
+    /**
+     * 处理原因
+     */
     @Excel(name = "处理原因")
     private String dealReason;
 
-    /** 处理方式 */
+    /**
+     * 处理方式
+     */
     @Excel(name = "处理方式")
     private String dealWay;
 
-    /** 删除标志 */
+    /**
+     * 删除标志
+     */
     private String delFlag;
 
-    public void setId(Long id) 
-    {
+    public void setId(Long id) {
         this.id = id;
     }
 
-    public Long getId() 
-    {
+    public Long getId() {
         return id;
     }
 
-    public void setEntranceBatchId(Long entranceBatchId) 
-    {
+    public void setEntranceBatchId(Long entranceBatchId) {
         this.entranceBatchId = entranceBatchId;
     }
 
     @NotNull(message = "不存在入场信息")
-    public Long getEntranceBatchId() 
-    {
+    public Long getEntranceBatchId() {
         return entranceBatchId;
     }
 
-    public void setIllnessDeadAmount(Integer illnessDeadAmount) 
-    {
+    public void setIllnessDeadAmount(Integer illnessDeadAmount) {
         this.illnessDeadAmount = illnessDeadAmount;
     }
 
     @Min(value = 0, message = "病死头数输入超出设定范围限制(0~999)")
     @Max(value = 999, message = "病死头数输入超出设定范围限制(0~999)")
-    public Integer getIllnessDeadAmount() 
-    {
+    public Integer getIllnessDeadAmount() {
         return illnessDeadAmount;
     }
 
-    public void setIllnessDiseaseAmount(Integer illnessDiseaseAmount) 
-    {
+    public void setIllnessDiseaseAmount(Integer illnessDiseaseAmount) {
         this.illnessDiseaseAmount = illnessDiseaseAmount;
     }
 
     @Min(value = 0, message = "病害头数输入超出设定范围限制(0~999)")
     @Max(value = 999, message = "病害头数输入超出设定范围限制(0~999)")
-    public Integer getIllnessDiseaseAmount() 
-    {
+    public Integer getIllnessDiseaseAmount() {
         return illnessDiseaseAmount;
     }
 
-    public void setSnapKillAmount(Integer snapKillAmount) 
-    {
+    public void setSnapKillAmount(Integer snapKillAmount) {
         this.snapKillAmount = snapKillAmount;
     }
 
     @Min(value = 0, message = "急宰头数输入超出设定范围限制(0~999)")
     @Max(value = 999, message = "急宰头数输入超出设定范围限制(0~999)")
-    public Integer getSnapKillAmount() 
-    {
+    public Integer getSnapKillAmount() {
         return snapKillAmount;
     }
 
-    public void setUnqualifiedWeight(BigDecimal unqualifiedWeight) 
-    {
+    public void setUnqualifiedWeight(BigDecimal unqualifiedWeight) {
         this.unqualifiedWeight = unqualifiedWeight;
     }
 
     @DecimalMin(value = "0", inclusive = true, message = "不合格产品重量输入超出设定范围限制(0~99999.99)")
     @DecimalMax(value = "99999.99", inclusive = true, message = "不合格产品重量输入超出设定范围限制(0.01~99999.99)")
     @Digits(integer = 5, fraction = 2, message = "不合格产品重量输入的整数部分不能超过5位,小数部分不能超过2位")
-    public BigDecimal getUnqualifiedWeight() 
-    {
+    public BigDecimal getUnqualifiedWeight() {
         return unqualifiedWeight;
     }
 
-    public void setIllnessPigsDetail(String illnessPigsDetail) 
-    {
+    public void setIllnessPigsDetail(String illnessPigsDetail) {
         this.illnessPigsDetail = illnessPigsDetail;
     }
 
     @Size(min = 0, max = 3000, message = "无害化处理生猪详情输入超出最大长度限制(3000位)")
-    public String getIllnessPigsDetail() 
-    {
+    public String getIllnessPigsDetail() {
         return illnessPigsDetail;
     }
 
-    public void setDealReason(String dealReason) 
-    {
+    public void setDealReason(String dealReason) {
         this.dealReason = dealReason;
     }
 
-    public String getDealReason() 
-    {
+    public String getDealReason() {
         return dealReason;
     }
 
-    public void setDealWay(String dealWay) 
-    {
+    public void setDealWay(String dealWay) {
         this.dealWay = dealWay;
     }
 
-    public String getDealWay() 
-    {
+    public String getDealWay() {
         return dealWay;
     }
 
-    public void setDelFlag(String delFlag) 
-    {
+    public void setDelFlag(String delFlag) {
         this.delFlag = delFlag;
     }
 
-    public String getDelFlag() 
-    {
+    public String getDelFlag() {
         return delFlag;
     }
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("entranceBatchId", getEntranceBatchId())
-            .append("illnessDeadAmount", getIllnessDeadAmount())
-            .append("illnessDiseaseAmount", getIllnessDiseaseAmount())
-            .append("snapKillAmount", getSnapKillAmount())
-            .append("unqualifiedWeight", getUnqualifiedWeight())
-            .append("illnessPigsDetail", getIllnessPigsDetail())
-            .append("dealReason", getDealReason())
-            .append("dealWay", getDealWay())
-            .append("createTime", getCreateTime())
-            .append("createBy", getCreateBy())
-            .append("updateTime", getUpdateTime())
-            .append("updateBy", getUpdateBy())
-            .append("delFlag", getDelFlag())
-
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("entranceBatchId", getEntranceBatchId())
+                .append("illnessDeadAmount", getIllnessDeadAmount())
+                .append("illnessDiseaseAmount", getIllnessDiseaseAmount())
+                .append("roadDealAmount", getRoadDealAmount())
+                .append("snapKillAmount", getSnapKillAmount())
+                .append("unqualifiedWeight", getUnqualifiedWeight())
+                .append("illnessPigsDetail", getIllnessPigsDetail())
+                .append("dealReason", getDealReason())
+                .append("dealWay", getDealWay())
+                .append("createTime", getCreateTime())
+                .append("createBy", getCreateBy())
+                .append("updateTime", getUpdateTime())
+                .append("updateBy", getUpdateBy())
+                .append("delFlag", getDelFlag())
+
+                .toString();
     }
 }

+ 44 - 34
ruoyi-system/src/main/java/com/ruoyi/app/domain/Pigpen.java

@@ -9,85 +9,95 @@ import javax.validation.constraints.*;
 
 /**
  * 待宰圈对象 pigpen
- * 
+ *
  * @author coede
  * @date 2025-03-19
  */
-public class Pigpen extends BaseEntity
-{
+public class Pigpen extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** ID */
+    /**
+     * ID
+     */
     private Long id;
 
-    /** 
-待宰圈号 */
+    /**
+     * 待宰圈号
+     */
     @Excel(name = " 待宰圈号")
     private String pigpenName;
 
-    /** 最大容量 */
+    /**
+     * 最大容量
+     */
     @Excel(name = "最大容量")
     private Integer maxCapacity;
 
-    /** 删除标志 */
+    /**
+     * 删除标志
+     */
     private String delFlag;
 
-    public void setId(Long id) 
-    {
+
+    public Integer getIsUse() {
+        return isUse;
+    }
+
+    public void setIsUse(Integer isUse) {
+        this.isUse = isUse;
+    }
+
+    private Integer isUse;
+
+    public void setId(Long id) {
         this.id = id;
     }
 
-    public Long getId() 
-    {
+    public Long getId() {
         return id;
     }
 
-    public void setPigpenName(String pigpenName) 
-    {
+    public void setPigpenName(String pigpenName) {
         this.pigpenName = pigpenName;
     }
 
     @NotBlank(message = "待宰圈号不能为空")
     @Size(min = 1, max = 3, message = "待宰圈号输入超出最大长度限制(3位)")
     @Pattern(regexp = "^\\d+$", message = "待宰圈号必须全部是数字")
-    public String getPigpenName() 
-    {
+    public String getPigpenName() {
         return pigpenName;
     }
 
-    public void setMaxCapacity(Integer maxCapacity) 
-    {
+    public void setMaxCapacity(Integer maxCapacity) {
         this.maxCapacity = maxCapacity;
     }
 
     @Min(value = 1, message = "最大容量输入超出设定范围限制(1~999)")
     @Max(value = 999, message = "最大容量输入超出设定范围限制(1~999)")
-    public Integer getMaxCapacity() 
-    {
+    public Integer getMaxCapacity() {
         return maxCapacity;
     }
 
-    public void setDelFlag(String delFlag) 
-    {
+    public void setDelFlag(String delFlag) {
         this.delFlag = delFlag;
     }
 
-    public String getDelFlag() 
-    {
+    public String getDelFlag() {
         return delFlag;
     }
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("pigpenName", getPigpenName())
-            .append("maxCapacity", getMaxCapacity())
-            .append("createTime", getCreateTime())
-            .append("createBy", getCreateBy())
-            .append("updateTime", getUpdateTime())
-            .append("updateBy", getUpdateBy())
-            .append("delFlag", getDelFlag())
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("pigpenName", getPigpenName())
+                .append("maxCapacity", getMaxCapacity())
+                .append("createTime", getCreateTime())
+                .append("createBy", getCreateBy())
+                .append("updateTime", getUpdateTime())
+                .append("updateBy", getUpdateBy())
+                .append("isUse", getIsUse())
+                .append("delFlag", getDelFlag())
+                .toString();
     }
 }

+ 6 - 0
ruoyi-system/src/main/java/com/ruoyi/app/mapper/EntranceBatchMapper.java

@@ -210,4 +210,10 @@ public interface EntranceBatchMapper
      */
     public int countBatchBySupplier(Long supplierId);
 
+    /**
+     *根据检疫证号查找入场批次
+     *
+     */
+    public EntranceBatch selectByAnimalNo(String anNo);
+
 }

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/app/mapper/HarmlessTreatmentMapper.java

@@ -69,4 +69,6 @@ public interface HarmlessTreatmentMapper
      * @return 结果
      */
     public HarmlessSumDTO selectHarmlessSumByTime(TimeRangeParam timeRangeParam);
+
+    public HarmlessTreatment selectByEntraceBatchId(Long id);
 }

+ 8 - 8
ruoyi-system/src/main/java/com/ruoyi/app/service/IHookRegisterService.java

@@ -7,15 +7,15 @@ import java.util.List;
 
 /**
  * 吊钩注册Service接口
- * 
+ *
  * @author coede
  * @date 2025-03-19
  */
-public interface IHookRegisterService 
+public interface IHookRegisterService
 {
     /**
      * 查询吊钩注册
-     * 
+     *
      * @param id 吊钩注册主键
      * @return 吊钩注册
      */
@@ -31,7 +31,7 @@ public interface IHookRegisterService
 
     /**
      * 查询吊钩注册列表
-     * 
+     *
      * @param req 吊钩注册
      * @return 吊钩注册集合
      */
@@ -55,7 +55,7 @@ public interface IHookRegisterService
 
     /**
      * 新增吊钩注册
-     * 
+     *
      * @param hookRegister 吊钩注册
      * @return 结果
      */
@@ -63,7 +63,7 @@ public interface IHookRegisterService
 
     /**
      * 修改吊钩注册
-     * 
+     *
      * @param hookRegister 吊钩注册
      * @return 结果
      */
@@ -71,7 +71,7 @@ public interface IHookRegisterService
 
     /**
      * 批量删除吊钩注册
-     * 
+     *
      * @param ids 需要删除的吊钩注册主键集合
      * @return 结果
      */
@@ -79,7 +79,7 @@ public interface IHookRegisterService
 
     /**
      * 删除吊钩注册信息
-     * 
+     *
      * @param id 吊钩注册主键
      * @return 结果
      */

+ 7 - 7
ruoyi-system/src/main/java/com/ruoyi/app/service/impl/HookRegisterServiceImpl.java

@@ -22,7 +22,7 @@ import java.util.List;
 
 /**
  * 吊钩注册Service业务层处理
- * 
+ *
  * @author coede
  * @date 2025-03-19
  */
@@ -46,7 +46,7 @@ public class HookRegisterServiceImpl implements IHookRegisterService
 
     /**
      * 查询吊钩注册
-     * 
+     *
      * @param id 吊钩注册主键
      * @return 吊钩注册
      */
@@ -83,7 +83,7 @@ public class HookRegisterServiceImpl implements IHookRegisterService
 
     /**
      * 查询吊钩注册列表
-     * 
+     *
      * @param req 吊钩注册
      * @return 吊钩注册
      */
@@ -131,7 +131,7 @@ public class HookRegisterServiceImpl implements IHookRegisterService
 
     /**
      * 新增吊钩注册
-     * 
+     *
      * @param hookRegister 吊钩注册
      * @return 结果
      */
@@ -149,7 +149,7 @@ public class HookRegisterServiceImpl implements IHookRegisterService
 
     /**
      * 修改吊钩注册
-     * 
+     *
      * @param hookRegister 吊钩注册
      * @return 结果
      */
@@ -175,7 +175,7 @@ public class HookRegisterServiceImpl implements IHookRegisterService
 
     /**
      * 批量删除吊钩注册
-     * 
+     *
      * @param ids 需要删除的吊钩注册主键
      * @return 结果
      */
@@ -199,7 +199,7 @@ public class HookRegisterServiceImpl implements IHookRegisterService
 
     /**
      * 删除吊钩注册信息
-     * 
+     *
      * @param id 吊钩注册主键
      * @return 结果
      */

+ 5 - 1
ruoyi-system/src/main/resources/mapper/app/EntranceBatchMapper.xml

@@ -174,7 +174,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>
             a.del_flag = '0'
             <if test="supplierId != null "> and a.supplier_id = #{supplierId}</if>
-            <if test="entranceTime != null "> and a.entrance_time = #{entranceTime}</if>
+            <if test="entranceTime != null "> and a.entrance_time >= #{entranceTime}</if>
             <if test="animalCertNo != null  and animalCertNo != ''"> and a.animal_cert_no like concat('%', #{animalCertNo}, '%')</if>
         </where>
         order by a.entrance_time desc,a.id desc
@@ -604,4 +604,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select count(1) from entrance_batch
         where supplier_id = #{supplierId} and del_flag = '0'
     </select>
+
+    <select id="selectByAnimalNo" parameterType="string" resultType="com.ruoyi.app.domain.EntranceBatch">
+        select * from entrance_batch where animal_cert_no=#{anNo}
+    </select>
 </mapper>

+ 12 - 1
ruoyi-system/src/main/resources/mapper/app/HarmlessTreatmentMapper.xml

@@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="entranceBatchId"    column="entrance_batch_id"    />
         <result property="illnessDeadAmount"    column="illness_dead_amount"    />
         <result property="illnessDiseaseAmount"    column="illness_disease_amount"    />
+        <result property="roadDealAmount"    column="road_deal_amount"    />
         <result property="snapKillAmount"    column="snap_kill_amount"    />
         <result property="unqualifiedWeight"    column="unqualified_weight"    />
         <result property="illnessPigsDetail"    column="illness_pigs_detail"    />
@@ -25,11 +26,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="illnessDeadAmountSum"    column="illness_dead_amount_sum"    />
         <result property="illnessDiseaseAmountSum"    column="illness_disease_amount_sum"    />
         <result property="unqualifiedWeightSum"    column="unqualified_weight_sum"    />
+        <result property="roadDealAmountSum"    column="road_deal_amount_sum"    />
         <result property="snapKillAmountSum"    column="snap_kill_amount_sum"    />
     </resultMap>
 
     <sql id="selectHarmlessTreatmentVo">
-        select id, entrance_batch_id, illness_dead_amount, illness_disease_amount, snap_kill_amount, unqualified_weight, illness_pigs_detail, deal_reason, deal_way, create_time, create_by, update_time, update_by, del_flag from harmless_treatment
+        select id, entrance_batch_id, illness_dead_amount, illness_disease_amount,road_deal_amount, snap_kill_amount, unqualified_weight, illness_pigs_detail, deal_reason, deal_way, create_time, create_by, update_time, update_by, del_flag from harmless_treatment
     </sql>
 
     <select id="selectHarmlessTreatmentList" parameterType="HarmlessTreatment" resultMap="HarmlessTreatmentResult">
@@ -39,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="entranceBatchId != null "> and entrance_batch_id = #{entranceBatchId}</if>
             <if test="illnessDeadAmount != null "> and illness_dead_amount = #{illnessDeadAmount}</if>
             <if test="illnessDiseaseAmount != null "> and illness_disease_amount = #{illnessDiseaseAmount}</if>
+            <if test="roadDealAmount != null "> and road_deal_amount = #{roadDealAmountAmount}</if>
             <if test="snapKillAmount != null "> and snap_kill_amount = #{snapKillAmount}</if>
             <if test="unqualifiedWeight != null "> and unqualified_weight = #{unqualifiedWeight}</if>
             <if test="illnessPigsDetail != null  and illnessPigsDetail != ''"> and illness_pigs_detail = #{illnessPigsDetail}</if>
@@ -58,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="entranceBatchId != null">entrance_batch_id,</if>
             <if test="illnessDeadAmount != null">illness_dead_amount,</if>
             <if test="illnessDiseaseAmount != null">illness_disease_amount,</if>
+            <if test="roadDealAmount != null">road_deal_amount,</if>
             <if test="snapKillAmount != null">snap_kill_amount,</if>
             <if test="unqualifiedWeight != null">unqualified_weight,</if>
             <if test="illnessPigsDetail != null">illness_pigs_detail,</if>
@@ -71,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="entranceBatchId != null">#{entranceBatchId},</if>
             <if test="illnessDeadAmount != null">#{illnessDeadAmount},</if>
             <if test="illnessDiseaseAmount != null">#{illnessDiseaseAmount},</if>
+            <if test="roadDealAmount != null">#{roadDealAmount},</if>
             <if test="snapKillAmount != null">#{snapKillAmount},</if>
             <if test="unqualifiedWeight != null">#{unqualifiedWeight},</if>
             <if test="illnessPigsDetail != null">#{illnessPigsDetail},</if>
@@ -88,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="entranceBatchId != null">entrance_batch_id = #{entranceBatchId},</if>
             <if test="illnessDeadAmount != null">illness_dead_amount = #{illnessDeadAmount},</if>
             <if test="illnessDiseaseAmount != null">illness_disease_amount = #{illnessDiseaseAmount},</if>
+            <if test="roadDealAmount != null">road_deal_amount = #{roadDealAmount},</if>
             <if test="snapKillAmount != null">snap_kill_amount = #{snapKillAmount},</if>
             <if test="unqualifiedWeight != null">unqualified_weight = #{unqualifiedWeight},</if>
             <if test="illnessPigsDetail != null">illness_pigs_detail = #{illnessPigsDetail},</if>
@@ -113,6 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <!--根据时间范围获取死淘数量-->
     <select id="selectHarmlessSumByTime" parameterType="com.ruoyi.app.domain.request.TimeRangeParam" resultMap="HarmlessSumDTOResult">
         select IFNULL(sum(illness_dead_amount),0) as illness_dead_amount_sum,IFNULL(sum(illness_disease_amount),0) as illness_disease_amount_sum,
+        IFNULL(sum(road_deal_amount),0) as road_deal_amount_sum,
         IFNULL(sum(snap_kill_amount),0) as snap_kill_amount_sum,IFNULL(sum(unqualified_weight),0) as unqualified_weight_sum
         from harmless_treatment as a
         left join entrance_batch as b on b.id = a.entrance_batch_id
@@ -122,4 +129,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="endTime != null "> and b.entrance_time <![CDATA[ <= ]]> #{endTime}</if>
         </where>
     </select>
+
+    <select id="selectByEntraceBatchId" parameterType="Long" resultType="com.ruoyi.app.domain.HarmlessTreatment">
+        select * from harmless_treatment where entrance_batch_id=#{id}
+    </select>
 </mapper>

+ 2 - 1
ruoyi-system/src/main/resources/mapper/app/PigpenMapper.xml

@@ -13,10 +13,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateTime"    column="update_time"    />
         <result property="updateBy"    column="update_by"    />
         <result property="delFlag"    column="del_flag"    />
+        <result property="isUse"    column="is_use"    />
     </resultMap>
 
     <sql id="selectPigpenVo">
-        select id, pigpen_name, max_capacity, create_time, create_by, update_time, update_by, del_flag from pigpen
+        select id, pigpen_name, max_capacity, create_time, create_by, update_time, update_by, del_flag,is_use from pigpen
     </sql>
 
     <select id="selectPigpenList" parameterType="Pigpen" resultMap="PigpenResult">