Kaynağa Gözat

对接牦牛资产档案

wwh 1 ay önce
ebeveyn
işleme
6fb473b6e5
17 değiştirilmiş dosya ile 162 ekleme ve 14 silme
  1. 3 0
      baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/controller/BizYakAssetController.java
  2. 7 2
      baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/domain/dto/OpenFarmEnclosureDto.java
  3. 7 2
      baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/domain/dto/OpenFarmingBatchDto.java
  4. 7 2
      baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/domain/dto/OpenFarmingPlanDto.java
  5. 17 2
      baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/domain/dto/YakAssetBundleDto.java
  6. 28 2
      baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/domain/vo/LivestockFinanceSyncResultVo.java
  7. 10 1
      baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/domain/vo/YakAssetSyncResultVo.java
  8. 12 1
      baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/service/PastureSyncService.java
  9. 5 0
      baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/service/impl/BizYakAssetServiceImpl.java
  10. 5 0
      baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/support/ThirdPartyFarmEnclosureClient.java
  11. 9 0
      baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/support/ThirdPartyFarmEnclosureClientImpl.java
  12. 5 0
      baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/support/ThirdPartyFarmingBatchClient.java
  13. 3 0
      baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/support/ThirdPartyFarmingBatchClientImpl.java
  14. 5 0
      baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/support/ThirdPartyFarmingPlanClient.java
  15. 3 0
      baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/support/ThirdPartyFarmingPlanClientImpl.java
  16. 6 1
      baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/support/ThirdPartyYakClient.java
  17. 30 1
      baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/support/YakEntryOpenApiMapper.java

+ 3 - 0
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/controller/BizYakAssetController.java

@@ -65,6 +65,9 @@ public class BizYakAssetController extends BaseController
65 65
         return success(bizYakAssetService.selectDetailById(id));
66 66
     }
67 67
 
68
+    /**
69
+     * 触发牧业金融生物资产全量同步:养殖场 → 圈舍 → 生产计划 → 批次 → 入栏建档。
70
+     */
68 71
     @PreAuthorize("@ss.hasPermi('dataModel:yakAsset:sync')")
69 72
     @Log(title = "牦牛资产档案", businessType = BusinessType.OTHER)
70 73
     @PostMapping("/sync")

+ 7 - 2
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/domain/dto/OpenFarmEnclosureDto.java

@@ -1,12 +1,17 @@
1 1
 package com.ruoyi.web.modules.industryservice.domain.dto;
2 2
 
3 3
 /**
4
- * 第三方「查询养殖圈舍列表」单条记录。
5
- * GET /open-api/v1/farming/enclosures
4
+ * 第三方「查询养殖圈舍列表」单条记录 DTO。
5
+ * <p>
6
+ * 对应 OpenAPI Schema {@code OpenFarmEnclosureVo};
7
+ * 接口 {@code GET /open-api/v1/farming/enclosures},落库 {@code biz_farm_enclosure}。
8
+ * </p>
6 9
  */
7 10
 public class OpenFarmEnclosureDto
8 11
 {
12
+    /** 第三方圈舍编号,落库 external_id */
9 13
     private Long id;
14
+    /** 第三方养殖场 ID,落库 farm_external_id 并解析 pasture_id */
10 15
     private Long farmId;
11 16
     private String farmName;
12 17
     private String enclosureName;

+ 7 - 2
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/domain/dto/OpenFarmingBatchDto.java

@@ -1,12 +1,17 @@
1 1
 package com.ruoyi.web.modules.industryservice.domain.dto;
2 2
 
3 3
 /**
4
- * 第三方「查询养殖批次列表」单条记录。
5
- * GET /open-api/v1/farming/batches
4
+ * 第三方「查询养殖批次列表」单条记录 DTO。
5
+ * <p>
6
+ * 接口 {@code GET /open-api/v1/farming/batches},落库 {@code biz_farming_batch}。
7
+ * {@code batchNo} 与入栏建档 {@code entryCycle} 对应。
8
+ * </p>
6 9
  */
7 10
 public class OpenFarmingBatchDto
8 11
 {
12
+    /** 第三方批次主键 */
9 13
     private Long id;
14
+    /** 批次编号,业务唯一标识 */
10 15
     private String batchNo;
11 16
     private String batchName;
12 17
     private Long farmId;

+ 7 - 2
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/domain/dto/OpenFarmingPlanDto.java

@@ -1,12 +1,17 @@
1 1
 package com.ruoyi.web.modules.industryservice.domain.dto;
2 2
 
3 3
 /**
4
- * 第三方「查询养殖生产计划列表」单条记录。
5
- * GET /open-api/v1/farming/plans
4
+ * 第三方「查询养殖生产计划列表」单条记录 DTO。
5
+ * <p>
6
+ * 对应 {@code OpenFarmingPlanVo};
7
+ * 接口 {@code GET /open-api/v1/farming/plans},落库 {@code biz_farming_plan}。
8
+ * </p>
6 9
  */
7 10
 public class OpenFarmingPlanDto
8 11
 {
12
+    /** 第三方计划编号 */
9 13
     private Long id;
14
+    /** 所属养殖场 ID */
10 15
     private Long farmId;
11 16
     private Long regionId;
12 17
     private String regionName;

+ 17 - 2
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/domain/dto/YakAssetBundleDto.java

@@ -8,21 +8,36 @@ import com.ruoyi.web.modules.industryservice.domain.BizYakPhysioSeries;
8 8
 import com.ruoyi.web.modules.industryservice.domain.BizYakReproductionRecord;
9 9
 
10 10
 /**
11
- * 第三方同步单头牦牛数据包。
11
+ * 第三方同步「单头牦牛」数据包。
12
+ * <p>
13
+ * 由 {@link com.ruoyi.web.modules.industryservice.support.YakEntryOpenApiMapper} 从入栏建档 OpenAPI 构建,
14
+ * 经 {@link com.ruoyi.web.modules.industryservice.service.YakAssetBundleSyncTxService#persistBundle} 落库。
15
+ * </p>
16
+ *
17
+ * <h3>子表 null 语义</h3>
18
+ * <p>
19
+ * 各 List 字段为 {@code null} 表示本次同步<strong>不覆盖</strong>对应子表;
20
+ * 非 null(含空列表)则先删后插。当前入栏建档接口仅填充 {@link #asset}。
21
+ * </p>
12 22
  */
13 23
 public class YakAssetBundleDto
14 24
 {
25
+    /** 牦牛主表字段(biz_yak_asset) */
15 26
     private BizYakAsset asset;
16 27
 
28
+    /** 第三方养殖场 ID(farmId 字符串),用于解析 pasture_id */
17 29
     private String thirdPartyPastureCode;
18 30
 
19
-    /** null 表示本次同步不覆盖该子表 */
31
+    /** 生理时序;null=不同步 */
20 32
     private List<BizYakPhysioSeries> physioSeries;
21 33
 
34
+    /** 生长记录;null=不同步 */
22 35
     private List<BizYakGrowthRecord> growthRecords;
23 36
 
37
+    /** 繁殖记录;null=不同步 */
24 38
     private List<BizYakReproductionRecord> reproductionRecords;
25 39
 
40
+    /** 饲喂记录;null=不同步 */
26 41
     private List<BizYakFeedingRecord> feedingRecords;
27 42
 
28 43
     public BizYakAsset getAsset()

+ 28 - 2
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/domain/vo/LivestockFinanceSyncResultVo.java

@@ -4,20 +4,44 @@ import java.util.Date;
4 4
 import com.fasterxml.jackson.annotation.JsonFormat;
5 5
 
6 6
 /**
7
- * 牧业金融生物资产全量同步结果(含基础数据 + 入栏建档)。
7
+ * 牧业金融生物资产<strong>全量同步</strong>结果 VO。
8
+ * <p>
9
+ * 由 {@link com.ruoyi.web.modules.industryservice.service.LivestockFinanceMasterSyncService#syncAll()} 返回,
10
+ * 包含五个步骤各自的新增/更新/失败统计。
11
+ * </p>
12
+ *
13
+ * <h3>字段说明</h3>
14
+ * <ul>
15
+ *   <li>{@code pasture} — 养殖场同步(biz_pasture)</li>
16
+ *   <li>{@code enclosure} — 圈舍同步(biz_farm_enclosure)</li>
17
+ *   <li>{@code plan} — 生产计划同步(biz_farming_plan)</li>
18
+ *   <li>{@code batch} — 批次同步(biz_farming_batch)</li>
19
+ *   <li>{@code yakAsset} — 入栏建档同步(biz_yak_asset)</li>
20
+ * </ul>
21
+ *
22
+ * <p>
23
+ * 顶层 {@link #getInsertCount()} 等 getter 为<strong>兼容旧前端</strong>,
24
+ * 取值自 {@code yakAsset} 步骤,便于列表页继续展示「新增/更新/失败头数」。
25
+ * </p>
8 26
  */
9 27
 public class LivestockFinanceSyncResultVo
10 28
 {
29
+    /** 步骤1:养殖场 */
11 30
     private YakAssetSyncResultVo pasture;
12 31
 
32
+    /** 步骤2:养殖圈舍 */
13 33
     private YakAssetSyncResultVo enclosure;
14 34
 
35
+    /** 步骤3:养殖生产计划 */
15 36
     private YakAssetSyncResultVo plan;
16 37
 
38
+    /** 步骤4:养殖批次 */
17 39
     private YakAssetSyncResultVo batch;
18 40
 
41
+    /** 步骤5:入栏建档(牦牛生物资产) */
19 42
     private YakAssetSyncResultVo yakAsset;
20 43
 
44
+    /** 全量同步开始时间 */
21 45
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
22 46
     private Date syncTime;
23 47
 
@@ -34,17 +58,19 @@ public class LivestockFinanceSyncResultVo
34 58
     public Date getSyncTime() { return syncTime; }
35 59
     public void setSyncTime(Date syncTime) { this.syncTime = syncTime; }
36 60
 
37
-    /** 兼容旧前端:汇总入栏建档同步条数 */
61
+    /** 兼容旧前端:入栏建档新增条数 */
38 62
     public int getInsertCount()
39 63
     {
40 64
         return yakAsset != null ? yakAsset.getInsertCount() : 0;
41 65
     }
42 66
 
67
+    /** 兼容旧前端:入栏建档更新条数 */
43 68
     public int getUpdateCount()
44 69
     {
45 70
         return yakAsset != null ? yakAsset.getUpdateCount() : 0;
46 71
     }
47 72
 
73
+    /** 兼容旧前端:入栏建档失败条数 */
48 74
     public int getFailCount()
49 75
     {
50 76
         return yakAsset != null ? yakAsset.getFailCount() : 0;

+ 10 - 1
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/domain/vo/YakAssetSyncResultVo.java

@@ -6,18 +6,27 @@ import java.util.List;
6 6
 import com.fasterxml.jackson.annotation.JsonFormat;
7 7
 
8 8
 /**
9
- * 第三方同步结果摘要。
9
+ * 第三方同步结果摘要(单步骤通用)。
10
+ * <p>
11
+ * 用于养殖场、圈舍、计划、批次、入栏建档等任一步骤的统计;
12
+ * 全量同步时嵌套在 {@link LivestockFinanceSyncResultVo} 各字段中。
13
+ * </p>
10 14
  */
11 15
 public class YakAssetSyncResultVo
12 16
 {
17
+    /** 本次同步新增条数 */
13 18
     private int insertCount;
14 19
 
20
+    /** 本次同步更新条数 */
15 21
     private int updateCount;
16 22
 
23
+    /** 本次同步失败条数(单条事务回滚,不影响已成功记录) */
17 24
     private int failCount;
18 25
 
26
+    /** 失败明细,格式:{@code 标识: 错误原因} */
19 27
     private List<String> failMessages = new ArrayList<>();
20 28
 
29
+    /** 本步骤同步完成时间 */
21 30
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
22 31
     private Date syncTime;
23 32
 

+ 12 - 1
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/service/PastureSyncService.java

@@ -14,7 +14,15 @@ import com.ruoyi.web.modules.industryservice.support.PastureSyncRules;
14 14
 import com.ruoyi.web.modules.industryservice.support.ThirdPartyFarmClient;
15 15
 
16 16
 /**
17
- * 第三方养殖场同步编排。
17
+ * 第三方<strong>养殖场</strong>同步编排。
18
+ * <p>
19
+ * 接口:{@code GET /open-api/v1/farming/farms} → 落库 {@code biz_pasture}。
20
+ * 既可由牧场管理页 {@code POST /dataModel/pasture/sync} 单独触发,
21
+ * 也是 {@link LivestockFinanceMasterSyncService} 全量同步的<strong>第一步</strong>。
22
+ * </p>
23
+ * <p>
24
+ * 牦牛/圈舍/批次等数据的 {@code pasture_id} 解析均依赖本步骤先写入养殖场台账。
25
+ * </p>
18 26
  */
19 27
 @Service
20 28
 public class PastureSyncService
@@ -27,6 +35,9 @@ public class PastureSyncService
27 35
     @Autowired
28 36
     private PastureSyncTxService pastureSyncTxService;
29 37
 
38
+    /**
39
+     * 从第三方拉取全量养殖场并 upsert。
40
+     */
30 41
     public YakAssetSyncResultVo syncFromThirdParty()
31 42
     {
32 43
         if (!syncing.compareAndSet(false, true))

+ 5 - 0
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/service/impl/BizYakAssetServiceImpl.java

@@ -113,6 +113,11 @@ public class BizYakAssetServiceImpl implements IBizYakAssetService
113 113
         return chart;
114 114
     }
115 115
 
116
+    /**
117
+     * 牧业金融生物资产全量同步(含基础数据 + 入栏建档)。
118
+     *
119
+     * @see LivestockFinanceMasterSyncService#syncAll()
120
+     */
116 121
     @Override
117 122
     public LivestockFinanceSyncResultVo syncFromThirdParty()
118 123
     {

+ 5 - 0
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/support/ThirdPartyFarmEnclosureClient.java

@@ -3,7 +3,12 @@ package com.ruoyi.web.modules.industryservice.support;
3 3
 import java.util.List;
4 4
 import com.ruoyi.web.modules.industryservice.domain.dto.OpenFarmEnclosureDto;
5 5
 
6
+/**
7
+ * 第三方养殖圈舍 HTTP 客户端。
8
+ * <p>接口:{@code GET /open-api/v1/farming/enclosures}</p>
9
+ */
6 10
 public interface ThirdPartyFarmEnclosureClient
7 11
 {
12
+    /** 分页拉取全量圈舍列表 */
8 13
     List<OpenFarmEnclosureDto> fetchAll();
9 14
 }

+ 9 - 0
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/support/ThirdPartyFarmEnclosureClientImpl.java

@@ -10,11 +10,20 @@ import com.ruoyi.web.modules.industryservice.domain.dto.OpenApiPageResult;
10 10
 import com.ruoyi.web.modules.industryservice.domain.dto.OpenApiResponse;
11 11
 import com.ruoyi.web.modules.industryservice.domain.dto.OpenFarmEnclosureDto;
12 12
 
13
+/**
14
+ * 第三方养殖圈舍客户端实现。
15
+ * <p>
16
+ * {@code mode=http} 时调用 {@link ThirdPartyFarmingPageFetcher} 分页拉取;
17
+ * {@code mode=stub} 时读取 {@value #STUB_RESOURCE}。
18
+ * </p>
19
+ */
13 20
 @Component
14 21
 public class ThirdPartyFarmEnclosureClientImpl implements ThirdPartyFarmEnclosureClient
15 22
 {
23
+    /** Stub 样例:classpath:thirdparty/stub-farm-enclosures.json */
16 24
     private static final String STUB_RESOURCE = "thirdparty/stub-farm-enclosures.json";
17 25
 
26
+    /** 查询养殖圈舍列表(Apifox 开放接口) */
18 27
     private static final String LIST_PATH = "/open-api/v1/farming/enclosures";
19 28
 
20 29
     private final ObjectMapper objectMapper = ThirdPartyFarmingHttpSupport.createObjectMapper();

+ 5 - 0
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/support/ThirdPartyFarmingBatchClient.java

@@ -3,7 +3,12 @@ package com.ruoyi.web.modules.industryservice.support;
3 3
 import java.util.List;
4 4
 import com.ruoyi.web.modules.industryservice.domain.dto.OpenFarmingBatchDto;
5 5
 
6
+/**
7
+ * 第三方养殖批次 HTTP 客户端。
8
+ * <p>接口:{@code GET /open-api/v1/farming/batches}</p>
9
+ */
6 10
 public interface ThirdPartyFarmingBatchClient
7 11
 {
12
+    /** 分页拉取全量批次列表 */
8 13
     List<OpenFarmingBatchDto> fetchAll();
9 14
 }

+ 3 - 0
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/support/ThirdPartyFarmingBatchClientImpl.java

@@ -10,6 +10,9 @@ import com.ruoyi.web.modules.industryservice.domain.dto.OpenApiPageResult;
10 10
 import com.ruoyi.web.modules.industryservice.domain.dto.OpenApiResponse;
11 11
 import com.ruoyi.web.modules.industryservice.domain.dto.OpenFarmingBatchDto;
12 12
 
13
+/**
14
+ * 第三方养殖批次客户端实现。
15
+ */
13 16
 @Component
14 17
 public class ThirdPartyFarmingBatchClientImpl implements ThirdPartyFarmingBatchClient
15 18
 {

+ 5 - 0
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/support/ThirdPartyFarmingPlanClient.java

@@ -3,7 +3,12 @@ package com.ruoyi.web.modules.industryservice.support;
3 3
 import java.util.List;
4 4
 import com.ruoyi.web.modules.industryservice.domain.dto.OpenFarmingPlanDto;
5 5
 
6
+/**
7
+ * 第三方养殖生产计划 HTTP 客户端。
8
+ * <p>接口:{@code GET /open-api/v1/farming/plans}</p>
9
+ */
6 10
 public interface ThirdPartyFarmingPlanClient
7 11
 {
12
+    /** 分页拉取全量生产计划列表 */
8 13
     List<OpenFarmingPlanDto> fetchAll();
9 14
 }

+ 3 - 0
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/support/ThirdPartyFarmingPlanClientImpl.java

@@ -10,6 +10,9 @@ import com.ruoyi.web.modules.industryservice.domain.dto.OpenApiPageResult;
10 10
 import com.ruoyi.web.modules.industryservice.domain.dto.OpenApiResponse;
11 11
 import com.ruoyi.web.modules.industryservice.domain.dto.OpenFarmingPlanDto;
12 12
 
13
+/**
14
+ * 第三方养殖生产计划客户端实现。
15
+ */
13 16
 @Component
14 17
 public class ThirdPartyFarmingPlanClientImpl implements ThirdPartyFarmingPlanClient
15 18
 {

+ 6 - 1
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/support/ThirdPartyYakClient.java

@@ -4,9 +4,14 @@ import java.util.List;
4 4
 import com.ruoyi.web.modules.industryservice.domain.dto.YakAssetBundleDto;
5 5
 
6 6
 /**
7
- * 第三方牦牛档案数据拉取。
7
+ * 第三方牦牛入栏建档 HTTP 客户端。
8
+ * <p>
9
+ * 接口:{@code GET /open-api/v1/farming/entry-filings},
10
+ * 拉取后由 {@link YakEntryOpenApiMapper} 转为 {@link YakAssetBundleDto} 列表。
11
+ * </p>
8 12
  */
9 13
 public interface ThirdPartyYakClient
10 14
 {
15
+    /** 分页拉取全量入栏建档并映射为同步数据包 */
11 16
     List<YakAssetBundleDto> fetchAll();
12 17
 }

+ 30 - 1
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/support/YakEntryOpenApiMapper.java

@@ -15,7 +15,27 @@ import com.ruoyi.web.modules.industryservice.domain.dto.OpenYakEntryDto;
15 15
 import com.ruoyi.web.modules.industryservice.domain.dto.YakAssetBundleDto;
16 16
 
17 17
 /**
18
- * 将第三方入栏建档 OpenAPI 记录映射为本地同步数据包。
18
+ * 将第三方入栏建档 OpenAPI 记录映射为本地同步数据包 {@link YakAssetBundleDto}。
19
+ * <p>
20
+ * 接口:{@code GET /open-api/v1/farming/entry-filings},单条 Schema 为 {@link OpenYakEntryDto}。
21
+ * </p>
22
+ *
23
+ * <h3>主表字段映射(OpenYakEntryDto → BizYakAsset)</h3>
24
+ * <ul>
25
+ *   <li>cattleId / id → externalId</li>
26
+ *   <li>earTagNumber(优先)/ cattleNo → yakNo</li>
27
+ *   <li>farmId → thirdPartyPastureCode(字符串,供 pasture_id 解析)</li>
28
+ *   <li>farmName → pastureName</li>
29
+ *   <li>entryCycle(优先)/ batchId → batchNo</li>
30
+ *   <li>farmEnclosureName → penLocation</li>
31
+ *   <li>farmLocation → location</li>
32
+ *   <li>cattleSex → gender(规范为 公/母)</li>
33
+ *   <li>cattleSource → source</li>
34
+ *   <li>weight → entryWeightKg</li>
35
+ *   <li>entryTime / birthDate → entryDate / birthDate</li>
36
+ *   <li>fatherNumber / motherNumber → fatherYakNo / motherYakNo</li>
37
+ *   <li>remark → statusChangeReason</li>
38
+ * </ul>
19 39
  */
20 40
 public final class YakEntryOpenApiMapper
21 41
 {
@@ -27,6 +47,12 @@ public final class YakEntryOpenApiMapper
27 47
     {
28 48
     }
29 49
 
50
+    /**
51
+     * 单条入栏建档 → 同步数据包。
52
+     *
53
+     * @param dto 开放接口 records 中单条
54
+     * @return 含主表 asset 及 thirdPartyPastureCode;子表列表均为 null
55
+     */
30 56
     public static YakAssetBundleDto toBundle(OpenYakEntryDto dto)
31 57
     {
32 58
         if (dto == null)
@@ -38,6 +64,7 @@ public final class YakEntryOpenApiMapper
38 64
         {
39 65
             throw new ServiceException("牦牛编号不能为空");
40 66
         }
67
+        // external_id:优先 cattleId,其次档案 id
41 68
         Long externalId = dto.getCattleId() != null ? dto.getCattleId() : dto.getId();
42 69
         if (externalId == null)
43 70
         {
@@ -70,6 +97,7 @@ public final class YakEntryOpenApiMapper
70 97
         return bundle;
71 98
     }
72 99
 
100
+    /** 耳标号优先,其次牛只编号 */
73 101
     private static String resolveYakNo(OpenYakEntryDto dto)
74 102
     {
75 103
         if (StringUtils.isNotEmpty(dto.getEarTagNumber()))
@@ -83,6 +111,7 @@ public final class YakEntryOpenApiMapper
83 111
         return null;
84 112
     }
85 113
 
114
+    /** 入栏周期优先,其次 batchId 转字符串 */
86 115
     private static String resolveBatchNo(OpenYakEntryDto dto)
87 116
     {
88 117
         if (StringUtils.isNotEmpty(dto.getEntryCycle()))