From fdff4ca4813fc77a9006309ed4e5c232b4f3c85e Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Fri, 22 Jul 2022 14:26:51 +0800
Subject: [PATCH] 返回数据新增农场全景地址

---
 src/main/java/org/springblade/modules/traceability/service/impl/TraceabilityServiceImpl.java |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/main/java/org/springblade/modules/traceability/service/impl/TraceabilityServiceImpl.java b/src/main/java/org/springblade/modules/traceability/service/impl/TraceabilityServiceImpl.java
index 0bf0775..b1ada12 100644
--- a/src/main/java/org/springblade/modules/traceability/service/impl/TraceabilityServiceImpl.java
+++ b/src/main/java/org/springblade/modules/traceability/service/impl/TraceabilityServiceImpl.java
@@ -130,7 +130,7 @@
 			//插入扫描记录
 			SweepRecord sweepRecord = new SweepRecord();
 			sweepRecord.setCreateTime(new Date());
-			sweepRecord.setCode(traceability.getId().toString());
+			sweepRecord.setCode(traceability1.getId().toString());
 			sweepRecord.setDeptId(traceability1.getDeptId());
 			//新增
 			sweepRecordService.save(sweepRecord);
@@ -145,13 +145,11 @@
 		LandVO landInfo = (LandVO)landService.getLandInfo(land);
 		//4. 查询农事记录信息(种植开始起)
 		List<FarmingRecordVO> farmingRecordVOList = farmingRecordService.getFarmingRecordByFarmPlantId(recoveryVO);
-		//5. 查询企业信息
-		Farm farm = new Farm();
-		farm.setDeptId(traceability1.getDeptId());
-		Farm farmVO = farmService.getOne(new QueryWrapper<>(farm));
+		//5. 查询农场信息
+		Farm farm = farmService.getById(recoveryVO.getFarmId());
 		//6. 数据封装
 		dto.setRecoveryVO(recoveryVO);
-		dto.setFarm(farmVO);
+		dto.setFarm(farm);
 		dto.setRecordVOList(farmingRecordVOList);
 		dto.setPaperVOList(farmPaperList);
 		dto.setLandVO(landInfo);
@@ -159,7 +157,7 @@
 		if (null!=recoveryVO){
 			count = count + 20;
 		}
-		if (null!=farmVO){
+		if (null!=farm){
 			count = count + 20;
 		}
 		if (null==landInfo){
@@ -200,7 +198,7 @@
 		//记录扫描记录
 		SweepRecord sweepRecord = new SweepRecord();
 		sweepRecord.setCreateTime(new Date());
-		sweepRecord.setCode(traceability.getId().toString());
+		sweepRecord.setCode(traceability1.getId().toString());
 		sweepRecord.setDeptId(traceability1.getDeptId());
 		//新增
 		sweepRecordService.save(sweepRecord);

--
Gitblit v1.9.3