From eab652f2f1c596c839013172a472bf88466f0c83 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Sat, 17 Sep 2022 14:43:14 +0800
Subject: [PATCH] 数据统计产量统计修正

---
 src/main/java/org/springblade/modules/remote/controller/RemoteController.java |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/src/main/java/org/springblade/modules/remote/controller/RemoteController.java b/src/main/java/org/springblade/modules/remote/controller/RemoteController.java
index a5c15cf..73f3787 100644
--- a/src/main/java/org/springblade/modules/remote/controller/RemoteController.java
+++ b/src/main/java/org/springblade/modules/remote/controller/RemoteController.java
@@ -27,6 +27,7 @@
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.StringUtil;
 import org.springblade.modules.desk.entity.Notice;
 import org.springblade.modules.remote.wrapper.RemoteWrapper;
 import org.springframework.web.bind.annotation.*;
@@ -38,7 +39,7 @@
 import org.springblade.core.boot.ctrl.BladeController;
 import springfox.documentation.annotations.ApiIgnore;
 
-import java.util.Map;
+import java.util.*;
 
 /**
  *  控制器
@@ -88,6 +89,11 @@
 		return R.data(pages);
 	}
 
+	@GetMapping("/getSensings")
+	public R getSensing(String type){
+		return R.data(remoteService.getRemoteList(type));
+	}
+
 	/**
 	 * 新增
 	 */
@@ -115,6 +121,13 @@
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "新增或修改", notes = "传入remote")
 	public R submit(@Valid @RequestBody Remote remote) {
+		if (remote.getReType().equals("0")) {//判断是否修改为展示
+			//查找当前类型默认展示的数量
+			List<Remote> remoteList = remoteService.findByType(remote);
+			if (remoteList.size() > 0) {
+				throw new org.springblade.core.log.exception.ServiceException(StringUtil.format("该类型已有默认展示,请先取消默认展示"));
+			}
+		}
 		return R.status(remoteService.saveOrUpdate(remote));
 	}
 

--
Gitblit v1.9.3