From fa326e87de2805d8b66b301daee596b1d959e430 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Thu, 15 Sep 2022 11:42:45 +0800
Subject: [PATCH] 出入库记录删除回滚逻辑修改
---
src/main/java/org/springblade/modules/farmplant/controller/FarmPlantController.java | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/src/main/java/org/springblade/modules/farmplant/controller/FarmPlantController.java b/src/main/java/org/springblade/modules/farmplant/controller/FarmPlantController.java
index 4b84822..1dc44fa 100644
--- a/src/main/java/org/springblade/modules/farmplant/controller/FarmPlantController.java
+++ b/src/main/java/org/springblade/modules/farmplant/controller/FarmPlantController.java
@@ -36,7 +36,9 @@
import org.springblade.modules.farm.entity.FarmingRecord;
import org.springblade.modules.farm.service.FarmingRecordService;
import org.springblade.modules.farmplant.entity.FarmPlant;
+import org.springblade.modules.farmplant.entity.Strain;
import org.springblade.modules.farmplant.service.FarmPlantService;
+import org.springblade.modules.farmplant.service.StrainService;
import org.springblade.modules.farmplant.vo.FarmPlantVO;
import org.springblade.modules.farmplant.vo.StrainVO;
import org.springblade.modules.lang.entity.Land;
@@ -72,6 +74,8 @@
private final ILandService landService;
+
+ private final StrainService strainService;
/**
* 详情
@@ -138,6 +142,16 @@
return R.data(farmplantService.getFarmPlantList(farmPlant));
}
+ /**
+ * 查询种养记录列表(秧苗)(不分页)
+ * @param farmPlant
+ * @return
+ */
+ @GetMapping("/getFarmPlantYMList")
+ public R getFarmPlantYMList(FarmPlantVO farmPlant) {
+ return R.data(farmplantService.getFarmPlantYMList(farmPlant));
+ }
+
/**
* 分页统计
@@ -189,6 +203,7 @@
farmPlant.setCreateTime(new Date());
boolean save = farmplantService.save(farmPlant);
if (save) {
+ Strain strain = strainService.getById(farmPlant.getStrainId());
//同时生成农事记录
FarmingRecord record = new FarmingRecord();
record.setCreateTime(new Date());
@@ -196,6 +211,7 @@
record.setTime(farmPlant.getTransplanTime());
record.setDeptId(farmPlant.getDeptId());
record.setTenantId(farmPlant.getTenantId());
+ record.setStrainId(farmPlant.getStrainId());
if (farmPlant.getPlantingWay().equals("0")) {
//移栽
record.setType("10");
@@ -210,7 +226,12 @@
}
record.setLandId(farmPlant.getLandId());
record.setOperator(farmPlant.getCreateUser());
- record.setContent("品种: " + farmPlant.getVarieties());
+ if (farmPlant.getVarieties().equals("")){
+ record.setContent("品种: " + strain.getStrainName());
+
+ }else {
+ record.setContent("品种: " + strain.getStrainName()+"-"+farmPlant.getVarieties());
+ }
//新增
farmingRecordService.save(record);
--
Gitblit v1.9.3