From 62eb499b0c969f246d3245d1429a97da4de1ce28 Mon Sep 17 00:00:00 2001
From: 钟日健 <arsn163@163.com>
Date: Mon, 01 Jun 2026 20:46:13 +0800
Subject: [PATCH] feat: 成绩查询增加年龄查询返回

---
 src/main/java/org/springblade/modules/talk/controller/TalkController.java |   68 ++++++++++++++++++++++++++++++++-
 1 files changed, 65 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/springblade/modules/talk/controller/TalkController.java b/src/main/java/org/springblade/modules/talk/controller/TalkController.java
index a633ca1..22a25cb 100644
--- a/src/main/java/org/springblade/modules/talk/controller/TalkController.java
+++ b/src/main/java/org/springblade/modules/talk/controller/TalkController.java
@@ -21,13 +21,17 @@
 import io.swagger.annotations.ApiParam;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import lombok.AllArgsConstructor;
+
 import javax.validation.Valid;
 
+import org.springblade.common.config.FtpConfig;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.FTP.FtpUtil;
 import org.springblade.modules.information.entity.Information;
+import org.springblade.modules.system.service.MyAsyncService;
 import org.springframework.web.bind.annotation.*;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.modules.talk.entity.Talk;
@@ -36,10 +40,12 @@
 import org.springblade.core.boot.ctrl.BladeController;
 import springfox.documentation.annotations.ApiIgnore;
 
+import java.text.SimpleDateFormat;
+import java.util.List;
 import java.util.Map;
 
 /**
- *  控制器
+ * 控制器
  *
  * @author BladeX
  * @since 2021-08-10
@@ -51,6 +57,7 @@
 public class TalkController extends BladeController {
 
 	private final ITalkService talkService;
+	private final MyAsyncService myAsyncService;
 
 	/**
 	 * 详情
@@ -92,7 +99,32 @@
 	@ApiOperationSupport(order = 4)
 	@ApiOperation(value = "新增", notes = "传入talk")
 	public R save(@Valid @RequestBody Talk talk) {
-		return R.status(talkService.save(talk));
+		boolean save = talkService.save(talk);
+		String url = "";
+		String[] split = talk.getImgurl().split(",");
+		for (int i = 0; i < split.length; i++) {
+			String s = split[i].substring(26, split[i].length());
+			url += FtpConfig.ip + s + ",";
+		}
+		String substring = url.substring(0, url.length() - 1);
+		talk.setImgurl(substring);
+		if (save) {
+			//数据同步
+			String s1 =
+				"insert into sys_talk(id,title,real_name,talkcontent,talktime,conclusion,evaluate,deptid,imgurl) " +
+					"values(" + "'" + talk.getId() + "'" + "," +
+					"'" + talk.getTitle() + "'" + "," +
+					"'" + talk.getRealName() + "'" + "," +
+					"'" + talk.getTalkcontent() + "'" + "," +
+					"'" + new SimpleDateFormat("yyyy-MM-dd").format(talk.getTalktime()) + "'" + "," +
+					"'" + talk.getConclusion() + "'" + "," +
+					"'" + talk.getEvaluate() + "'" + "," +
+					"'" + talk.getDeptid() + "'" + "," +
+					"'" + talk.getImgurl() + "'" + ")";
+			//FtpUtil.sqlFileUpload(s1);
+			myAsyncService.dataSync(s1);
+		}
+		return R.success("新增成功");
 	}
 
 	/**
@@ -102,7 +134,29 @@
 	@ApiOperationSupport(order = 5)
 	@ApiOperation(value = "修改", notes = "传入talk")
 	public R update(@Valid @RequestBody Talk talk) {
-		return R.status(talkService.updateById(talk));
+		boolean b = talkService.updateById(talk);
+		String url = "";
+		String[] split = talk.getImgurl().split(",");
+		for (int i = 0; i < split.length; i++) {
+			String s = split[i].substring(26, split[i].length());
+			url += FtpConfig.ip + s + ",";
+		}
+		String substring = url.substring(0, url.length() - 1);
+		talk.setImgurl(substring);
+		if (b) {
+			String s1 = "update sys_talk set title = " + "'" + talk.getTitle() + "'" +
+				",real_name = " + "'" + talk.getRealName() + "'" +
+				",talkcontent = " + "'" + talk.getTalkcontent() + "'" +
+				",talktime = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(talk.getTalktime()) + "'" +
+				",conclusion = " + "'" + talk.getConclusion() + "'" +
+				",evaluate = " + "'" + talk.getEvaluate() + "'" +
+				",deptid = " + "'" + talk.getDeptid() + "'" +
+				",imgurl = " + "'" + talk.getImgurl() + "'" +
+				" " + "where id = " + "'" + talk.getId() + "'";
+			//FtpUtil.sqlFileUpload(s1);
+			myAsyncService.dataSync(s1);
+		}
+		return R.success("修改成功");
 	}
 
 	/**
@@ -123,6 +177,14 @@
 	@ApiOperationSupport(order = 8)
 	@ApiOperation(value = "删除", notes = "传入ids")
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		//内网删除
+		List<Long> list = Func.toLongList(ids);
+		list.forEach(id -> {
+			//内网同步
+			String s1 = "delete from sys_talk where id = " + "'" + id + "'";
+			//FtpUtil.sqlFileUpload(s1);
+			myAsyncService.dataSync(s1);
+		});
 		return R.status(talkService.removeByIds(Func.toLongList(ids)));
 	}
 

--
Gitblit v1.9.3