From 981a3d85848753a799da2d909089c2fe4fcd3ccf Mon Sep 17 00:00:00 2001
From: zhongrj <123456>
Date: Mon, 18 Jul 2022 14:53:15 +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