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/equipage/controller/CarController.java |   88 +++++++++++++++++++++++++-------------------
 1 files changed, 50 insertions(+), 38 deletions(-)

diff --git a/src/main/java/org/springblade/modules/equipage/controller/CarController.java b/src/main/java/org/springblade/modules/equipage/controller/CarController.java
index 71f3295..3e89f6d 100644
--- a/src/main/java/org/springblade/modules/equipage/controller/CarController.java
+++ b/src/main/java/org/springblade/modules/equipage/controller/CarController.java
@@ -20,6 +20,7 @@
 import org.springblade.modules.equipage.excel.CarImporter;
 import org.springblade.modules.equipage.service.CarService;
 import org.springblade.modules.equipage.vo.CarVo;
+import org.springblade.modules.system.service.MyAsyncService;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -42,11 +43,13 @@
 public class CarController {
 
 	private final CarService carService;
+	private final MyAsyncService myAsyncService;
 
 	/**
 	 * 自定义分页
+	 *
 	 * @param query page,size
-	 * @param car 车辆信息对象
+	 * @param car   车辆信息对象
 	 */
 	@GetMapping("/page")
 	public R<IPage<CarVo>> page(CarVo car, Query query) {
@@ -56,6 +59,7 @@
 
 	/**
 	 * 新增
+	 *
 	 * @param car 车辆信息对象
 	 */
 	@PostMapping("/save")
@@ -66,6 +70,7 @@
 
 	/**
 	 * 修改
+	 *
 	 * @param car 车辆信息对象
 	 */
 	@PostMapping("/update")
@@ -75,71 +80,78 @@
 
 	/**
 	 * 新增或修改
+	 *
 	 * @param car 车辆信息对象
 	 */
 	@PostMapping("/submit")
 	public R submit(@RequestBody Car car) throws Exception {
 		boolean status = false;
-		if (null==car.getId()) {
+		if (null == car.getId()) {
 			car.setDateForProduction(new Date());
 			//新增
 			status = carService.save(car);
+			if (status) {
+				//数据同步
+				String s1 =
+					"insert into sys_car(id,car_number,number_type,car_type,dept_id," +
+						"person_in_charge,brand,date_for_production,umweltsatz,mode,jurisdiction) " +
+						"values(" + "'" + car.getId() + "'" + "," +
+						"'" + car.getCarNumber() + "'" + "," +
+						"'" + car.getNumberType() + "'" + "," +
+						"'" + car.getCarType() + "'" + "," +
+						"'" + car.getDeptId() + "'" + "," +
+						"'" + car.getPersonInCharge() + "'" + "," +
+						"'" + car.getBrand() + "'" + "," +
+						"'" + new SimpleDateFormat("yyyy-MM-dd").format(car.getDateForProduction()) + "'" + "," +
+						"'" + car.getUmweltsatz() + "'" + "," +
+						"'" + car.getMode() + "'" + "," +
+						"'" + car.getJurisdiction() + "'" + ")";
+				myAsyncService.dataSync(s1);
+			}
 
-			//数据同步
-			String s1 =
-				"insert into sys_car(id,car_number,number_type,car_type,dept_id," +
-					"person_in_charge,brand,date_for_production,umweltsatz,mode,jurisdiction) " +
-					"values(" + "'" + car.getId() + "'" + "," +
-					"'" + car.getCarNumber() + "'" + "," +
-					"'" + car.getNumberType() + "'" + "," +
-					"'" + car.getCarType() + "'" + "," +
-					"'" + car.getDeptId() + "'" + "," +
-					"'" + car.getPersonInCharge() + "'" + "," +
-					"'" + car.getBrand() + "'" + "," +
-					"'" + new SimpleDateFormat("yyyy-MM-dd").format(car.getDateForProduction()) + "'" + "," +
-					"'" + car.getUmweltsatz() + "'" + "," +
-					"'" + car.getMode() + "'" + "," +
-					"'" +car.getJurisdiction() + "'" + ")";
-			FtpUtil.sqlFileUpload(s1);
-		}else {
+		} else {
 			//修改
 			status = carService.updateById(car);
-			//内网同步
-			String s1 =
-				"update sys_car set car_number = " + "'" + car.getCarNumber() + "'" +
-					",number_type = " + "'" + car.getNumberType() + "'" +
-					",car_type = " + "'" + car.getCarType() + "'" +
-					",dept_id = " + "'" + car.getDeptId() + "'" +
-					",person_in_charge = " + "'" + car.getJurisdiction() + "'" +
-					",brand = " + "'" + car.getBrand() + "'" +
-					",date_for_production = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(car.getDateForProduction()) + "'" +
-					",umweltsatz = " + "'" + car.getUmweltsatz() + "'" +
-					",mode = " + "'" + car.getMode() + "'" +
-					",jurisdiction = " + "'" + car.getJurisdiction() + "'" +
-					" " +"where id = " + "'" + car.getId() + "'";
-			FtpUtil.sqlFileUpload(s1);
+			if (status) {
+				//内网同步
+				String s1 =
+					"update sys_car set car_number = " + "'" + car.getCarNumber() + "'" +
+						",number_type = " + "'" + car.getNumberType() + "'" +
+						",car_type = " + "'" + car.getCarType() + "'" +
+						",dept_id = " + "'" + car.getDeptId() + "'" +
+						",person_in_charge = " + "'" + car.getPersonInCharge() + "'" +
+						",brand = " + "'" + car.getBrand() + "'" +
+						",date_for_production = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(car.getDateForProduction()) + "'" +
+						",umweltsatz = " + "'" + car.getUmweltsatz() + "'" +
+						",mode = " + "'" + car.getMode() + "'" +
+						",jurisdiction = " + "'" + car.getJurisdiction() + "'" +
+						" " + "where id = " + "'" + car.getId() + "'";
+				myAsyncService.dataSync(s1);
+			}
 		}
 		return R.status(status);
 	}
 
 	/**
 	 * 删除
+	 *
 	 * @param ids 车辆信息ids 数组
 	 */
 	@PostMapping("/remove")
 	public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
 		//内网删除
 		List<Long> list = Func.toLongList(ids);
-		list.forEach(id ->{
+		list.forEach(id -> {
 			//内网同步
 			String s1 = "delete from sys_car where id = " + "'" + id + "'";
-			FtpUtil.sqlFileUpload(s1);
+			myAsyncService.dataSync(s1);
 		});
 		return R.status(carService.removeByIds(Func.toLongList(ids)));
 	}
 
 	/**
 	 * 详情
+	 *
 	 * @param car 车辆信息对象
 	 */
 	@GetMapping("/detail")
@@ -153,8 +165,8 @@
 	 * 导入车辆信息, excel
 	 */
 	@PostMapping("import-car")
-	public R importCar(MultipartFile file, Integer isCovered,String deptId) {
-		CarImporter carImporter = new CarImporter(carService, false,deptId);
+	public R importCar(MultipartFile file, Integer isCovered, String deptId) {
+		CarImporter carImporter = new CarImporter(carService, false, deptId);
 		ExcelUtil.save(file, carImporter, CarExcel.class);
 		return R.success("操作成功");
 	}
@@ -178,7 +190,7 @@
 		try {
 			response.setContentType("application/vnd.ms-excel");
 			response.setCharacterEncoding(org.apache.commons.codec.Charsets.UTF_8.name());
-			fileName = URLEncoder.encode("车辆导入数据模板"+ DateUtil.time(), Charsets.UTF_8.name());
+			fileName = URLEncoder.encode("车辆导入数据模板" + DateUtil.time(), Charsets.UTF_8.name());
 			response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
 
 			//修改单元格格式为文本格式

--
Gitblit v1.9.3