wwh 1 vecka sedan
förälder
incheckning
829a5973d0

+ 26 - 0
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/research/controller/ResearchOpenApiController.java

@@ -19,6 +19,7 @@ import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchCommonPr
19 19
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchDisposableIncomeVo;
20 20
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchFamilyRanchVo;
21 21
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchFarmerHouseholdVo;
22
+import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchLargeLivestockFarmerVo;
22 23
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchLivestockProductOutputVo;
23 24
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchPastureVo;
24 25
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchYakAssetVo;
@@ -293,4 +294,29 @@ public class ResearchOpenApiController
293 294
             return ResearchOpenApiSupport.error(code, ex.getMessage());
294 295
         }
295 296
     }
297
+
298
+    /**
299
+     * 养殖大户数据列表。
300
+     */
301
+    @GetMapping("/large-livestock-farmers")
302
+    public OpenApiResponse<OpenApiPageResult<ResearchLargeLivestockFarmerVo>> listLargeLivestockFarmers(
303
+            @RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
304
+            @RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
305
+            @RequestParam(value = "statYear", required = false) Integer statYear,
306
+            @RequestParam(value = "statMonth", required = false) Integer statMonth,
307
+            @RequestParam(value = "townName", required = false) String townName,
308
+            @RequestParam(value = "villageName", required = false) String villageName,
309
+            @RequestParam(value = "enterpriseName", required = false) String enterpriseName)
310
+    {
311
+        try
312
+        {
313
+            return ResearchOpenApiSupport.success(researchOpenApiService.listLargeLivestockFarmers(
314
+                    pageNum, pageSize, statYear, statMonth, townName, villageName, enterpriseName));
315
+        }
316
+        catch (ServiceException ex)
317
+        {
318
+            int code = ex.getCode() != null ? ex.getCode() : 500;
319
+            return ResearchOpenApiSupport.error(code, ex.getMessage());
320
+        }
321
+    }
296 322
 }

+ 464 - 0
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/research/domain/vo/ResearchLargeLivestockFarmerVo.java

@@ -0,0 +1,464 @@
1
+package com.ruoyi.web.modules.industryservice.research.domain.vo;
2
+
3
+import java.math.BigDecimal;
4
+
5
+/**
6
+ * 科研开放接口 — 养殖大户填报记录(脱敏法人姓名;不含部门 ID / 备注)。
7
+ */
8
+public class ResearchLargeLivestockFarmerVo
9
+{
10
+    /** 养殖大户记录 ID */
11
+    private Long farmerId;
12
+
13
+    /** 所属年份 */
14
+    private Integer statYear;
15
+
16
+    /** 所属月份(1~12) */
17
+    private Integer statMonth;
18
+
19
+    /** 所属乡镇名称 */
20
+    private String townName;
21
+
22
+    /** 所属村名称 */
23
+    private String villageName;
24
+
25
+    /** 企业名称 */
26
+    private String enterpriseName;
27
+
28
+    /** 法定代表人(脱敏) */
29
+    private String legalRepresentative;
30
+
31
+    /** 企业类型 */
32
+    private String enterpriseType;
33
+
34
+    /** 注册资本(万元) */
35
+    private BigDecimal registeredCapital;
36
+
37
+    /** 成立时间(yyyy-MM-dd) */
38
+    private String establishDate;
39
+
40
+    /** 从事畜牧业生产经营劳力人员 */
41
+    private Integer livestockLaborCount;
42
+
43
+    /** 年底牲畜存栏小计(牛+羊) */
44
+    private Integer stockSubtotal;
45
+
46
+    /** 牛年底存栏 */
47
+    private Integer cattleYearEndStock;
48
+
49
+    /** 牛能繁母畜 */
50
+    private Integer cattleBreedingFemaleStock;
51
+
52
+    /** 羊年底存栏 */
53
+    private Integer sheepYearEndStock;
54
+
55
+    /** 羊能繁母畜 */
56
+    private Integer sheepBreedingFemaleStock;
57
+
58
+    /** 牛出栏 */
59
+    private Integer cattleOutbound;
60
+
61
+    /** 羊出栏 */
62
+    private Integer sheepOutbound;
63
+
64
+    /** 草场面积小计(亩) */
65
+    private BigDecimal grasslandAreaSubtotal;
66
+
67
+    /** 草畜平衡面积(亩) */
68
+    private BigDecimal grassBalanceArea;
69
+
70
+    /** 流转经营草地面积(亩) */
71
+    private BigDecimal transferGrassArea;
72
+
73
+    /** 核定年末草畜平衡载畜量(绵羊单位) */
74
+    private BigDecimal approvedCarryingCapacity;
75
+
76
+    /** 年底牲畜存栏(绵羊单位) */
77
+    private BigDecimal yearEndStockSheepUnit;
78
+
79
+    /** 是否草畜平衡户(是/否) */
80
+    private String isGrassBalanced;
81
+
82
+    /** 年度经营总收入(万元) */
83
+    private BigDecimal income;
84
+
85
+    /** 年度经营总支出(万元) */
86
+    private BigDecimal expense;
87
+
88
+    /** 利润(万元)= 收入 - 支出 */
89
+    private BigDecimal profit;
90
+
91
+    /** 养殖大户补助资金年份 */
92
+    private Integer subsidyYear;
93
+
94
+    /** 是否享受补助(是/否) */
95
+    private String hasSubsidy;
96
+
97
+    /** 补贴资金(万元) */
98
+    private BigDecimal subsidyAmount;
99
+
100
+    /** 是否有注册商标(是/否) */
101
+    private String hasTrademark;
102
+
103
+    /** 是否通过农产品质量认证(是/否) */
104
+    private String hasQualityCert;
105
+
106
+    /** 产品销售渠道 */
107
+    private String salesChannel;
108
+
109
+    /** 带动人数 */
110
+    private Integer drivenPopulation;
111
+
112
+    /** 发放工资(万元) */
113
+    private BigDecimal wagePaid;
114
+
115
+    public Long getFarmerId()
116
+    {
117
+        return farmerId;
118
+    }
119
+
120
+    public void setFarmerId(Long farmerId)
121
+    {
122
+        this.farmerId = farmerId;
123
+    }
124
+
125
+    public Integer getStatYear()
126
+    {
127
+        return statYear;
128
+    }
129
+
130
+    public void setStatYear(Integer statYear)
131
+    {
132
+        this.statYear = statYear;
133
+    }
134
+
135
+    public Integer getStatMonth()
136
+    {
137
+        return statMonth;
138
+    }
139
+
140
+    public void setStatMonth(Integer statMonth)
141
+    {
142
+        this.statMonth = statMonth;
143
+    }
144
+
145
+    public String getTownName()
146
+    {
147
+        return townName;
148
+    }
149
+
150
+    public void setTownName(String townName)
151
+    {
152
+        this.townName = townName;
153
+    }
154
+
155
+    public String getVillageName()
156
+    {
157
+        return villageName;
158
+    }
159
+
160
+    public void setVillageName(String villageName)
161
+    {
162
+        this.villageName = villageName;
163
+    }
164
+
165
+    public String getEnterpriseName()
166
+    {
167
+        return enterpriseName;
168
+    }
169
+
170
+    public void setEnterpriseName(String enterpriseName)
171
+    {
172
+        this.enterpriseName = enterpriseName;
173
+    }
174
+
175
+    public String getLegalRepresentative()
176
+    {
177
+        return legalRepresentative;
178
+    }
179
+
180
+    public void setLegalRepresentative(String legalRepresentative)
181
+    {
182
+        this.legalRepresentative = legalRepresentative;
183
+    }
184
+
185
+    public String getEnterpriseType()
186
+    {
187
+        return enterpriseType;
188
+    }
189
+
190
+    public void setEnterpriseType(String enterpriseType)
191
+    {
192
+        this.enterpriseType = enterpriseType;
193
+    }
194
+
195
+    public BigDecimal getRegisteredCapital()
196
+    {
197
+        return registeredCapital;
198
+    }
199
+
200
+    public void setRegisteredCapital(BigDecimal registeredCapital)
201
+    {
202
+        this.registeredCapital = registeredCapital;
203
+    }
204
+
205
+    public String getEstablishDate()
206
+    {
207
+        return establishDate;
208
+    }
209
+
210
+    public void setEstablishDate(String establishDate)
211
+    {
212
+        this.establishDate = establishDate;
213
+    }
214
+
215
+    public Integer getLivestockLaborCount()
216
+    {
217
+        return livestockLaborCount;
218
+    }
219
+
220
+    public void setLivestockLaborCount(Integer livestockLaborCount)
221
+    {
222
+        this.livestockLaborCount = livestockLaborCount;
223
+    }
224
+
225
+    public Integer getStockSubtotal()
226
+    {
227
+        return stockSubtotal;
228
+    }
229
+
230
+    public void setStockSubtotal(Integer stockSubtotal)
231
+    {
232
+        this.stockSubtotal = stockSubtotal;
233
+    }
234
+
235
+    public Integer getCattleYearEndStock()
236
+    {
237
+        return cattleYearEndStock;
238
+    }
239
+
240
+    public void setCattleYearEndStock(Integer cattleYearEndStock)
241
+    {
242
+        this.cattleYearEndStock = cattleYearEndStock;
243
+    }
244
+
245
+    public Integer getCattleBreedingFemaleStock()
246
+    {
247
+        return cattleBreedingFemaleStock;
248
+    }
249
+
250
+    public void setCattleBreedingFemaleStock(Integer cattleBreedingFemaleStock)
251
+    {
252
+        this.cattleBreedingFemaleStock = cattleBreedingFemaleStock;
253
+    }
254
+
255
+    public Integer getSheepYearEndStock()
256
+    {
257
+        return sheepYearEndStock;
258
+    }
259
+
260
+    public void setSheepYearEndStock(Integer sheepYearEndStock)
261
+    {
262
+        this.sheepYearEndStock = sheepYearEndStock;
263
+    }
264
+
265
+    public Integer getSheepBreedingFemaleStock()
266
+    {
267
+        return sheepBreedingFemaleStock;
268
+    }
269
+
270
+    public void setSheepBreedingFemaleStock(Integer sheepBreedingFemaleStock)
271
+    {
272
+        this.sheepBreedingFemaleStock = sheepBreedingFemaleStock;
273
+    }
274
+
275
+    public Integer getCattleOutbound()
276
+    {
277
+        return cattleOutbound;
278
+    }
279
+
280
+    public void setCattleOutbound(Integer cattleOutbound)
281
+    {
282
+        this.cattleOutbound = cattleOutbound;
283
+    }
284
+
285
+    public Integer getSheepOutbound()
286
+    {
287
+        return sheepOutbound;
288
+    }
289
+
290
+    public void setSheepOutbound(Integer sheepOutbound)
291
+    {
292
+        this.sheepOutbound = sheepOutbound;
293
+    }
294
+
295
+    public BigDecimal getGrasslandAreaSubtotal()
296
+    {
297
+        return grasslandAreaSubtotal;
298
+    }
299
+
300
+    public void setGrasslandAreaSubtotal(BigDecimal grasslandAreaSubtotal)
301
+    {
302
+        this.grasslandAreaSubtotal = grasslandAreaSubtotal;
303
+    }
304
+
305
+    public BigDecimal getGrassBalanceArea()
306
+    {
307
+        return grassBalanceArea;
308
+    }
309
+
310
+    public void setGrassBalanceArea(BigDecimal grassBalanceArea)
311
+    {
312
+        this.grassBalanceArea = grassBalanceArea;
313
+    }
314
+
315
+    public BigDecimal getTransferGrassArea()
316
+    {
317
+        return transferGrassArea;
318
+    }
319
+
320
+    public void setTransferGrassArea(BigDecimal transferGrassArea)
321
+    {
322
+        this.transferGrassArea = transferGrassArea;
323
+    }
324
+
325
+    public BigDecimal getApprovedCarryingCapacity()
326
+    {
327
+        return approvedCarryingCapacity;
328
+    }
329
+
330
+    public void setApprovedCarryingCapacity(BigDecimal approvedCarryingCapacity)
331
+    {
332
+        this.approvedCarryingCapacity = approvedCarryingCapacity;
333
+    }
334
+
335
+    public BigDecimal getYearEndStockSheepUnit()
336
+    {
337
+        return yearEndStockSheepUnit;
338
+    }
339
+
340
+    public void setYearEndStockSheepUnit(BigDecimal yearEndStockSheepUnit)
341
+    {
342
+        this.yearEndStockSheepUnit = yearEndStockSheepUnit;
343
+    }
344
+
345
+    public String getIsGrassBalanced()
346
+    {
347
+        return isGrassBalanced;
348
+    }
349
+
350
+    public void setIsGrassBalanced(String isGrassBalanced)
351
+    {
352
+        this.isGrassBalanced = isGrassBalanced;
353
+    }
354
+
355
+    public BigDecimal getIncome()
356
+    {
357
+        return income;
358
+    }
359
+
360
+    public void setIncome(BigDecimal income)
361
+    {
362
+        this.income = income;
363
+    }
364
+
365
+    public BigDecimal getExpense()
366
+    {
367
+        return expense;
368
+    }
369
+
370
+    public void setExpense(BigDecimal expense)
371
+    {
372
+        this.expense = expense;
373
+    }
374
+
375
+    public BigDecimal getProfit()
376
+    {
377
+        return profit;
378
+    }
379
+
380
+    public void setProfit(BigDecimal profit)
381
+    {
382
+        this.profit = profit;
383
+    }
384
+
385
+    public Integer getSubsidyYear()
386
+    {
387
+        return subsidyYear;
388
+    }
389
+
390
+    public void setSubsidyYear(Integer subsidyYear)
391
+    {
392
+        this.subsidyYear = subsidyYear;
393
+    }
394
+
395
+    public String getHasSubsidy()
396
+    {
397
+        return hasSubsidy;
398
+    }
399
+
400
+    public void setHasSubsidy(String hasSubsidy)
401
+    {
402
+        this.hasSubsidy = hasSubsidy;
403
+    }
404
+
405
+    public BigDecimal getSubsidyAmount()
406
+    {
407
+        return subsidyAmount;
408
+    }
409
+
410
+    public void setSubsidyAmount(BigDecimal subsidyAmount)
411
+    {
412
+        this.subsidyAmount = subsidyAmount;
413
+    }
414
+
415
+    public String getHasTrademark()
416
+    {
417
+        return hasTrademark;
418
+    }
419
+
420
+    public void setHasTrademark(String hasTrademark)
421
+    {
422
+        this.hasTrademark = hasTrademark;
423
+    }
424
+
425
+    public String getHasQualityCert()
426
+    {
427
+        return hasQualityCert;
428
+    }
429
+
430
+    public void setHasQualityCert(String hasQualityCert)
431
+    {
432
+        this.hasQualityCert = hasQualityCert;
433
+    }
434
+
435
+    public String getSalesChannel()
436
+    {
437
+        return salesChannel;
438
+    }
439
+
440
+    public void setSalesChannel(String salesChannel)
441
+    {
442
+        this.salesChannel = salesChannel;
443
+    }
444
+
445
+    public Integer getDrivenPopulation()
446
+    {
447
+        return drivenPopulation;
448
+    }
449
+
450
+    public void setDrivenPopulation(Integer drivenPopulation)
451
+    {
452
+        this.drivenPopulation = drivenPopulation;
453
+    }
454
+
455
+    public BigDecimal getWagePaid()
456
+    {
457
+        return wagePaid;
458
+    }
459
+
460
+    public void setWagePaid(BigDecimal wagePaid)
461
+    {
462
+        this.wagePaid = wagePaid;
463
+    }
464
+}

+ 11 - 0
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/research/service/IResearchOpenApiService.java

@@ -7,6 +7,7 @@ import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchCommonPr
7 7
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchDisposableIncomeVo;
8 8
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchFamilyRanchVo;
9 9
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchFarmerHouseholdVo;
10
+import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchLargeLivestockFarmerVo;
10 11
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchLivestockProductOutputVo;
11 12
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchPastureVo;
12 13
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchYakAssetVo;
@@ -97,4 +98,14 @@ public interface IResearchOpenApiService
97 98
      */
98 99
     OpenApiPageResult<ResearchCommonProsperityProjectVo> listCommonProsperityProjects(int pageNum, int pageSize,
99 100
             String projectName, Integer projectType, Integer implYear);
101
+
102
+    /**
103
+     * 养殖大户填报列表。
104
+     *
105
+     * @param townName 所属乡镇名称模糊匹配
106
+     * @param villageName 所属村名称模糊匹配
107
+     * @param enterpriseName 企业名称模糊匹配
108
+     */
109
+    OpenApiPageResult<ResearchLargeLivestockFarmerVo> listLargeLivestockFarmers(int pageNum, int pageSize,
110
+            Integer statYear, Integer statMonth, String townName, String villageName, String enterpriseName);
100 111
 }

+ 37 - 0
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/research/service/impl/ResearchOpenApiServiceImpl.java

@@ -12,6 +12,7 @@ import com.ruoyi.web.modules.industryservice.domain.BizCooperativeDevelopment;
12 12
 import com.ruoyi.web.modules.industryservice.domain.BizDisposableIncome;
13 13
 import com.ruoyi.web.modules.industryservice.domain.BizFamilyRanch;
14 14
 import com.ruoyi.web.modules.industryservice.domain.BizFarmerHousehold;
15
+import com.ruoyi.web.modules.industryservice.domain.BizLargeLivestockFarmer;
15 16
 import com.ruoyi.web.modules.industryservice.domain.BizLivestockProductOutput;
16 17
 import com.ruoyi.web.modules.industryservice.domain.BizPasture;
17 18
 import com.ruoyi.web.modules.industryservice.domain.BizYakAsset;
@@ -22,6 +23,7 @@ import com.ruoyi.web.modules.industryservice.mapper.BizCooperativeDevelopmentMap
22 23
 import com.ruoyi.web.modules.industryservice.mapper.BizDisposableIncomeMapper;
23 24
 import com.ruoyi.web.modules.industryservice.mapper.BizFamilyRanchMapper;
24 25
 import com.ruoyi.web.modules.industryservice.mapper.BizFarmerHouseholdMapper;
26
+import com.ruoyi.web.modules.industryservice.mapper.BizLargeLivestockFarmerMapper;
25 27
 import com.ruoyi.web.modules.industryservice.mapper.BizLivestockProductOutputMapper;
26 28
 import com.ruoyi.web.modules.industryservice.mapper.BizYakHerdInventoryMapper;
27 29
 import com.ruoyi.web.modules.industryservice.mapper.BizYakOutboundReportMapper;
@@ -32,6 +34,7 @@ import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchCommonPr
32 34
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchDisposableIncomeVo;
33 35
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchFamilyRanchVo;
34 36
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchFarmerHouseholdVo;
37
+import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchLargeLivestockFarmerVo;
35 38
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchLivestockProductOutputVo;
36 39
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchPastureVo;
37 40
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchYakAssetVo;
@@ -84,6 +87,9 @@ public class ResearchOpenApiServiceImpl implements IResearchOpenApiService
84 87
     @Autowired
85 88
     private BizCommonProsperityProjectMapper bizCommonProsperityProjectMapper;
86 89
 
90
+    @Autowired
91
+    private BizLargeLivestockFarmerMapper bizLargeLivestockFarmerMapper;
92
+
87 93
     @Override
88 94
     public ResearchTokenVo authenticate(String appKey, String appSecret)
89 95
     {
@@ -333,6 +339,37 @@ public class ResearchOpenApiServiceImpl implements IResearchOpenApiService
333 339
                 rows.stream().map(ResearchOpenApiSupport::toCommonProsperityProjectVo).collect(Collectors.toList()));
334 340
     }
335 341
 
342
+    @Override
343
+    public OpenApiPageResult<ResearchLargeLivestockFarmerVo> listLargeLivestockFarmers(int pageNum, int pageSize,
344
+            Integer statYear, Integer statMonth, String townName, String villageName, String enterpriseName)
345
+    {
346
+        tokenService.assertEnabled();
347
+        int safePageNum = normalizePageNum(pageNum);
348
+        int safePageSize = normalizePageSize(pageSize);
349
+        BizLargeLivestockFarmer query = new BizLargeLivestockFarmer();
350
+        query.setStatYear(statYear);
351
+        query.setStatMonth(statMonth);
352
+        if (StringUtils.isNotEmpty(townName))
353
+        {
354
+            query.setTownName(townName.trim());
355
+        }
356
+        if (StringUtils.isNotEmpty(villageName))
357
+        {
358
+            query.setVillageName(villageName.trim());
359
+        }
360
+        if (StringUtils.isNotEmpty(enterpriseName))
361
+        {
362
+            query.setEnterpriseName(enterpriseName.trim());
363
+        }
364
+        // 开放接口无登录上下文,清空 dataScope,避免走填报部门权限
365
+        query.getParams().put("dataScope", "");
366
+        PageHelper.startPage(safePageNum, safePageSize);
367
+        List<BizLargeLivestockFarmer> rows = bizLargeLivestockFarmerMapper.selectBizLargeLivestockFarmerList(query);
368
+        PageInfo<BizLargeLivestockFarmer> page = new PageInfo<>(rows);
369
+        return toPageResult(safePageNum, safePageSize, page.getTotal(),
370
+                rows.stream().map(ResearchOpenApiSupport::toLargeLivestockFarmerVo).collect(Collectors.toList()));
371
+    }
372
+
336 373
     private int normalizePageNum(int pageNum)
337 374
     {
338 375
         return pageNum > 0 ? pageNum : 1;

+ 47 - 0
baqing-admin/src/main/java/com/ruoyi/web/modules/industryservice/research/support/ResearchOpenApiSupport.java

@@ -6,6 +6,7 @@ import com.ruoyi.web.modules.industryservice.domain.BizCooperativeDevelopment;
6 6
 import com.ruoyi.web.modules.industryservice.domain.BizDisposableIncome;
7 7
 import com.ruoyi.web.modules.industryservice.domain.BizFamilyRanch;
8 8
 import com.ruoyi.web.modules.industryservice.domain.BizFarmerHousehold;
9
+import com.ruoyi.web.modules.industryservice.domain.BizLargeLivestockFarmer;
9 10
 import com.ruoyi.web.modules.industryservice.domain.BizLivestockProductOutput;
10 11
 import com.ruoyi.web.modules.industryservice.domain.BizPasture;
11 12
 import com.ruoyi.web.modules.industryservice.domain.BizYakAsset;
@@ -17,6 +18,7 @@ import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchCommonPr
17 18
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchDisposableIncomeVo;
18 19
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchFamilyRanchVo;
19 20
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchFarmerHouseholdVo;
21
+import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchLargeLivestockFarmerVo;
20 22
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchLivestockProductOutputVo;
21 23
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchPastureVo;
22 24
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchYakAssetVo;
@@ -351,4 +353,49 @@ public final class ResearchOpenApiSupport
351 353
         vo.setOpImageCount(row.getOpImageCount());
352 354
         return vo;
353 355
     }
356
+
357
+    public static ResearchLargeLivestockFarmerVo toLargeLivestockFarmerVo(BizLargeLivestockFarmer row)
358
+    {
359
+        if (row == null)
360
+        {
361
+            return null;
362
+        }
363
+        ResearchLargeLivestockFarmerVo vo = new ResearchLargeLivestockFarmerVo();
364
+        vo.setFarmerId(row.getId());
365
+        vo.setStatYear(row.getStatYear());
366
+        vo.setStatMonth(row.getStatMonth());
367
+        vo.setTownName(row.getTownName());
368
+        vo.setVillageName(row.getVillageName());
369
+        vo.setEnterpriseName(row.getEnterpriseName());
370
+        vo.setLegalRepresentative(ResearchOpenApiMasking.maskPersonName(row.getLegalRepresentative()));
371
+        vo.setEnterpriseType(row.getEnterpriseType());
372
+        vo.setRegisteredCapital(row.getRegisteredCapital());
373
+        vo.setEstablishDate(row.getEstablishDate());
374
+        vo.setLivestockLaborCount(row.getLivestockLaborCount());
375
+        vo.setStockSubtotal(row.getStockSubtotal());
376
+        vo.setCattleYearEndStock(row.getCattleYearEndStock());
377
+        vo.setCattleBreedingFemaleStock(row.getCattleBreedingFemaleStock());
378
+        vo.setSheepYearEndStock(row.getSheepYearEndStock());
379
+        vo.setSheepBreedingFemaleStock(row.getSheepBreedingFemaleStock());
380
+        vo.setCattleOutbound(row.getCattleOutbound());
381
+        vo.setSheepOutbound(row.getSheepOutbound());
382
+        vo.setGrasslandAreaSubtotal(row.getGrasslandAreaSubtotal());
383
+        vo.setGrassBalanceArea(row.getGrassBalanceArea());
384
+        vo.setTransferGrassArea(row.getTransferGrassArea());
385
+        vo.setApprovedCarryingCapacity(row.getApprovedCarryingCapacity());
386
+        vo.setYearEndStockSheepUnit(row.getYearEndStockSheepUnit());
387
+        vo.setIsGrassBalanced(row.getIsGrassBalanced());
388
+        vo.setIncome(row.getIncome());
389
+        vo.setExpense(row.getExpense());
390
+        vo.setProfit(row.getProfit());
391
+        vo.setSubsidyYear(row.getSubsidyYear());
392
+        vo.setHasSubsidy(row.getHasSubsidy());
393
+        vo.setSubsidyAmount(row.getSubsidyAmount());
394
+        vo.setHasTrademark(row.getHasTrademark());
395
+        vo.setHasQualityCert(row.getHasQualityCert());
396
+        vo.setSalesChannel(row.getSalesChannel());
397
+        vo.setDrivenPopulation(row.getDrivenPopulation());
398
+        vo.setWagePaid(row.getWagePaid());
399
+        return vo;
400
+    }
354 401
 }

+ 2 - 0
baqing-admin/src/main/resources/mapper/industryservice/BizLargeLivestockFarmerMapper.xml

@@ -93,6 +93,8 @@
93 93
             <if test="statMonth != null">and r.stat_month = #{statMonth}</if>
94 94
             <if test="townDeptId != null">and r.town_dept_id = #{townDeptId}</if>
95 95
             <if test="villageDeptId != null">and r.village_dept_id = #{villageDeptId}</if>
96
+            <if test="townName != null and townName != ''">and r.town_name like concat('%', #{townName}, '%')</if>
97
+            <if test="villageName != null and villageName != ''">and r.village_name like concat('%', #{villageName}, '%')</if>
96 98
             <if test="enterpriseName != null and enterpriseName != ''">and r.enterprise_name like concat('%', #{enterpriseName}, '%')</if>
97 99
             ${params.dataScope}
98 100
         </where>

+ 31 - 0
baqing-admin/src/test/java/com/ruoyi/web/modules/industryservice/research/controller/ResearchOpenApiControllerApiTest.java

@@ -26,6 +26,7 @@ import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchCommonPr
26 26
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchDisposableIncomeVo;
27 27
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchFamilyRanchVo;
28 28
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchFarmerHouseholdVo;
29
+import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchLargeLivestockFarmerVo;
29 30
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchLivestockProductOutputVo;
30 31
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchPastureVo;
31 32
 import com.ruoyi.web.modules.industryservice.research.domain.vo.ResearchYakHerdInventoryVo;
@@ -311,4 +312,34 @@ class ResearchOpenApiControllerApiTest
311 312
                 .andExpect(jsonPath("$.data.records[0].projectName").value("和美乡村示范项目"))
312 313
                 .andExpect(jsonPath("$.data.records[0].implYear").value(2025));
313 314
     }
315
+
316
+    @Test
317
+    @DisplayName("GET /large-livestock-farmers 成功")
318
+    void listLargeLivestockFarmers() throws Exception
319
+    {
320
+        ResearchLargeLivestockFarmerVo row = new ResearchLargeLivestockFarmerVo();
321
+        row.setFarmerId(1L);
322
+        row.setStatYear(2026);
323
+        row.setStatMonth(5);
324
+        row.setTownName("雅安镇");
325
+        row.setVillageName("荣嘎村");
326
+        row.setEnterpriseName("测试养殖大户");
327
+        OpenApiPageResult<ResearchLargeLivestockFarmerVo> page = new OpenApiPageResult<>();
328
+        page.setPageNum(1);
329
+        page.setPageSize(20);
330
+        page.setTotal(1L);
331
+        page.setRecords(Collections.singletonList(row));
332
+        when(researchOpenApiService.listLargeLivestockFarmers(
333
+                anyInt(), anyInt(), any(), any(), any(), any(), any())).thenReturn(page);
334
+
335
+        mockMvc.perform(get("/open-api/v1/research/large-livestock-farmers")
336
+                .param("statYear", "2026")
337
+                .param("statMonth", "5")
338
+                .param("townName", "雅安")
339
+                .param("villageName", "荣嘎")
340
+                .param("enterpriseName", "测试"))
341
+                .andExpect(status().isOk())
342
+                .andExpect(jsonPath("$.code").value(200))
343
+                .andExpect(jsonPath("$.data.records[0].enterpriseName").value("测试养殖大户"));
344
+    }
314 345
 }

+ 17 - 0
doc/产业数据模型及服务/科研开放数据接口/科研开放数据接口功能需求.md

@@ -36,6 +36,7 @@
36 36
 | 可支配收入数据列表 | 分页返回县级年度可支配收入填报 |
37 37
 | 农牧户数据列表 | 分页返回村级农牧户填报 |
38 38
 | 共同富裕项目列表 | 分页返回共同富裕项目 |
39
+| 养殖大户数据列表 | 分页返回养殖大户填报;法人姓名脱敏 |
39 40
 
40 41
 **本期不实现:**
41 42
 
@@ -234,6 +235,20 @@ sequenceDiagram
234 235
 
235 236
 **不返回**:本地文件路径、创建人、备注等内部字段。
236 237
 
238
+### 6.12 养殖大户数据列表
239
+
240
+| 项 | 说明 |
241
+| --- | --- |
242
+| 方法 | GET |
243
+| 路径 | `/large-livestock-farmers` |
244
+| 鉴权 | Bearer Token |
245
+| 分页 | 同 §6.2 |
246
+| 筛选 | `statYear`、`statMonth`、`townName`(乡镇模糊)、`villageName`(村模糊)、`enterpriseName`(企业名称模糊) |
247
+
248
+**返回字段**:`farmerId`、年月、乡镇村、企业信息、存出栏、草场、经营收支、补助与认证等;`legalRepresentative` 脱敏。
249
+
250
+**不返回**:部门 ID、创建人、备注等内部字段。
251
+
237 252
 ---
238 253
 
239 254
 ## 7. 脱敏规则摘要
@@ -279,6 +294,7 @@ sequenceDiagram
279 294
 | 可支配收入数据填报 | 数据源 `biz_disposable_income` |
280 295
 | 农牧户数据填报 | 数据源 `biz_farmer_household` |
281 296
 | 共同富裕项目管理 | 数据源 `biz_common_prosperity_project` |
297
+| 养殖大户数据填报 | 数据源 `biz_large_livestock_farmer` |
282 298
 | 若依权限体系 | **无**关联;开放接口走独立 Token |
283 299
 
284 300
 ---
@@ -298,5 +314,6 @@ sequenceDiagram
298 314
 | 可支配收入列表 | §6.9 |
299 315
 | 农牧户列表 | §6.10 |
300 316
 | 共同富裕项目列表 | §6.11 |
317
+| 养殖大户列表 | §6.12 |
301 318
 | 脱敏合规 | §7 |
302 319
 | 本期不实现 | §3 |

+ 22 - 2
doc/产业数据模型及服务/科研开放数据接口/科研开放数据接口技术方案.md

@@ -9,7 +9,7 @@
9 9
 | 项 | 说明 |
10 10
 | --- | --- |
11 11
 | **后端** | RuoYi **v3.9.2**(**springboot2** 分支):JDK 8、Spring MVC、MyBatis |
12
-| **数据库** | 只读查询既有表 `biz_pasture`、`biz_yak_asset`、`biz_yak_herd_inventory`、`biz_yak_outbound_report`、`biz_cooperative_development`、`biz_livestock_product_output`、`biz_family_ranch`、`biz_disposable_income`、`biz_farmer_household`、`biz_common_prosperity_project` |
12
+| **数据库** | 只读查询既有表 `biz_pasture`、`biz_yak_asset`、`biz_yak_herd_inventory`、`biz_yak_outbound_report`、`biz_cooperative_development`、`biz_livestock_product_output`、`biz_family_ranch`、`biz_disposable_income`、`biz_farmer_household`、`biz_common_prosperity_project`、`biz_large_livestock_farmer` |
13 13
 | **鉴权** | 独立 JWT + Servlet Filter;`@Anonymous` 绕过若依登录,Filter 校验 Bearer Token |
14 14
 | **响应** | `OpenApiResponse<T>` + `OpenApiPageResult<T>`(与第三方 farming OpenAPI 同结构) |
15 15
 
@@ -234,6 +234,19 @@ Authorization: Bearer <accessToken>
234 234
 
235 235
 实现说明:直接查 `BizCommonProsperityProjectMapper.selectBizCommonProsperityProjectList`。
236 236
 
237
+### 3.12 养殖大户数据列表
238
+
239
+```
240
+GET /open-api/v1/research/large-livestock-farmers?pageNum=1&pageSize=20&statYear=2026&statMonth=5&townName=&villageName=&enterpriseName=
241
+Authorization: Bearer <accessToken>
242
+```
243
+
244
+**查询参数:** `statYear` / `statMonth`(精确);`townName` / `villageName` / `enterpriseName`(模糊);分页同前。
245
+
246
+**`records[]` 元素(ResearchLargeLivestockFarmerVo):** 养殖大户业务字段;`legalRepresentative` 脱敏;**不含**部门 ID、操作人、备注。
247
+
248
+实现说明:直接查 `BizLargeLivestockFarmerMapper`(清空 `params.dataScope`)。
249
+
237 250
 ---
238 251
 
239 252
 ## 4. 鉴权流程
@@ -263,8 +276,9 @@ Token 申请:`appKey`/`appSecret` 与配置项精确匹配后签发 JWT(HS51
263 276
 | 可支配收入列表 | `BizDisposableIncomeMapper.selectBizDisposableIncomeList` | `biz_disposable_income` | 年份精确 |
264 277
 | 农牧户列表 | `BizFarmerHouseholdMapper.selectBizFarmerHouseholdList` | `biz_farmer_household` | 年/月精确;乡镇/村名模糊;清空 `params.dataScope` |
265 278
 | 共同富裕项目列表 | `BizCommonProsperityProjectMapper.selectBizCommonProsperityProjectList` | `biz_common_prosperity_project` | 项目名模糊;类型/实施年限精确 |
279
+| 养殖大户列表 | `BizLargeLivestockFarmerMapper.selectBizLargeLivestockFarmerList` | `biz_large_livestock_farmer` | 年/月精确;乡镇/村/企业名模糊;清空 `params.dataScope` |
266 280
 
267
-实体 → VO:`ResearchOpenApiSupport.toPastureVo` / `toYakAssetVo` / `toYakHerdInventoryVo` / `toYakOutboundReportVo` / `toCooperativeDevelopmentVo` / `toLivestockProductOutputVo` / `toFamilyRanchVo` / `toDisposableIncomeVo` / `toFarmerHouseholdVo` / `toCommonProsperityProjectVo`。
281
+实体 → VO:`ResearchOpenApiSupport.toPastureVo` / `toYakAssetVo` / `toYakHerdInventoryVo` / `toYakOutboundReportVo` / `toCooperativeDevelopmentVo` / `toLivestockProductOutputVo` / `toFamilyRanchVo` / `toDisposableIncomeVo` / `toFarmerHouseholdVo` / `toCommonProsperityProjectVo` / `toLargeLivestockFarmerVo`
268 282
 
269 283
 ---
270 284
 
@@ -341,6 +355,10 @@ curl "http://localhost:8010/open-api/v1/research/farmer-households?pageNum=1&pag
341 355
 # 11. 共同富裕项目
342 356
 curl "http://localhost:8010/open-api/v1/research/common-prosperity-projects?pageNum=1&pageSize=10&projectName=和美&implYear=2025" \
343 357
   -H "Authorization: Bearer <accessToken>"
358
+
359
+# 12. 养殖大户
360
+curl "http://localhost:8010/open-api/v1/research/large-livestock-farmers?pageNum=1&pageSize=10&statYear=2026&enterpriseName=养殖" \
361
+  -H "Authorization: Bearer <accessToken>"
344 362
 ```
345 363
 
346 364
 ---
@@ -370,6 +388,7 @@ curl "http://localhost:8010/open-api/v1/research/common-prosperity-projects?page
370 388
 | §6.9 可支配收入 | **§3.9**、**§5** BizDisposableIncome |
371 389
 | §6.10 农牧户 | **§3.10**、**§5** BizFarmerHousehold |
372 390
 | §6.11 共同富裕项目 | **§3.11**、**§5** BizCommonProsperityProject |
391
+| §6.12 养殖大户 | **§3.12**、**§5** BizLargeLivestockFarmer |
373 392
 | §7 脱敏 | **§6** Masking |
374 393
 | §3 不实现机构区分 | 单一 app-key/secret,JWT 无 clientId |
375 394
 
@@ -379,6 +398,7 @@ curl "http://localhost:8010/open-api/v1/research/common-prosperity-projects?page
379 398
 
380 399
 | 版本 | 日期 | 说明 |
381 400
 | --- | --- | --- |
401
+| 1.9 | 2026-07-22 | 新增养殖大户开放列表(年/月/乡镇村/企业名模糊+分页;法人脱敏) |
382 402
 | 1.8 | 2026-07-22 | 新增共同富裕项目开放列表(项目名模糊/类型与实施年限精确+分页) |
383 403
 | 1.7 | 2026-07-22 | 新增农牧户开放列表(年/月/乡镇村模糊+分页) |
384 404
 | 1.6 | 2026-07-22 | 新增可支配收入开放列表(年份精确+分页) |

+ 5 - 1
doc/产业数据模型及服务/科研开放数据接口/科研开放数据接口测试用例.md

@@ -59,6 +59,8 @@
59 59
 | KYKF-API-026 | 农牧户 | 年/月/乡镇村筛选 | 接口测试 | curl | §6.10 | 已知年月与乡镇名片段 | GET 带筛选参数 | 条件生效;名称模糊匹配 |
60 60
 | KYKF-API-027 | 共同富裕项目 | 分页列表 | 接口测试 | curl | §6.11 | 有效 Token;库有项目数据 | GET `/common-prosperity-projects?pageNum=1&pageSize=10` | `code=200`;无本地路径/操作人 |
61 61
 | KYKF-API-028 | 共同富裕项目 | 名称/类型/年限筛选 | 接口测试 | curl | §6.11 | 已知项目名片段与类型 | GET 带筛选参数 | 条件生效;名称模糊、类型与年限精确 |
62
+| KYKF-API-029 | 养殖大户 | 分页列表 | 接口测试 | curl | §6.12 | 有效 Token;库有大户数据 | GET `/large-livestock-farmers?pageNum=1&pageSize=10` | `code=200`;法人已脱敏;无部门 ID |
63
+| KYKF-API-030 | 养殖大户 | 年/月/乡镇村/企业名筛选 | 接口测试 | curl | §6.12 | 已知企业名片段 | GET 带筛选参数 | 条件生效;名称模糊匹配 |
62 64
 
63 65
 ---
64 66
 
@@ -77,11 +79,12 @@
77 79
 | §6.9 可支配收入列表 | — | API-023~024 |
78 80
 | §6.10 农牧户列表 | — | API-025~026 |
79 81
 | §6.11 共同富裕项目列表 | — | API-027~028 |
82
+| §6.12 养殖大户列表 | — | API-029~030 |
80 83
 | §7 脱敏 | UT-001~004 | API-012 |
81 84
 | §2 分页 | — | API-010 |
82 85
 | §3 无机构区分 | UT-005 | API-001(单一凭证) |
83 86
 
84
-**用例统计**:单元 **6**、接口 **28**,合计 **34** 条。
87
+**用例统计**:单元 **6**、接口 **30**,合计 **36** 条。
85 88
 
86 89
 ---
87 90
 
@@ -104,6 +107,7 @@ curl -s "$BASE/family-ranches?pageNum=1&pageSize=5&statYear=2026" -H "Authorizat
104 107
 curl -s "$BASE/disposable-incomes?pageNum=1&pageSize=5&statYear=2025" -H "Authorization: Bearer $TOKEN"
105 108
 curl -s "$BASE/farmer-households?pageNum=1&pageSize=5&statYear=2026" -H "Authorization: Bearer $TOKEN"
106 109
 curl -s "$BASE/common-prosperity-projects?pageNum=1&pageSize=5&implYear=2025" -H "Authorization: Bearer $TOKEN"
110
+curl -s "$BASE/large-livestock-farmers?pageNum=1&pageSize=5&statYear=2026" -H "Authorization: Bearer $TOKEN"
107 111
 ```
108 112
 
109 113
 (Windows 环境可用 PowerShell `Invoke-RestMethod`,见技术方案 **§8**。)