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/EquipageController.java | 90 ++++++++++++++++++++++++++------------------
1 files changed, 53 insertions(+), 37 deletions(-)
diff --git a/src/main/java/org/springblade/modules/equipage/controller/EquipageController.java b/src/main/java/org/springblade/modules/equipage/controller/EquipageController.java
index a9d6881..98f7a99 100644
--- a/src/main/java/org/springblade/modules/equipage/controller/EquipageController.java
+++ b/src/main/java/org/springblade/modules/equipage/controller/EquipageController.java
@@ -18,6 +18,7 @@
import org.springblade.modules.equipage.vo.EquipageVo;
import org.springblade.modules.exam.excel.ExamScoreExcel;
import org.springblade.modules.exam.excel.ExamScoreImporter;
+import org.springblade.modules.system.service.MyAsyncService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -38,10 +39,12 @@
public class EquipageController {
private final EquipageService equipageService;
+ private final MyAsyncService myAsyncService;
/**
* 自定义分页
- * @param query page,size
+ *
+ * @param query page,size
* @param equipage 装备信息对象
*/
@GetMapping("/page")
@@ -52,6 +55,7 @@
/**
* 新增
+ *
* @param equipage 装备信息对象
*/
@PostMapping("/save")
@@ -62,6 +66,7 @@
/**
* 修改
+ *
* @param equipage 装备信息对象
*/
@PostMapping("/update")
@@ -71,69 +76,78 @@
/**
* 新增或修改
+ *
* @param equipage 装备信息对象
*/
@PostMapping("/submit")
- public R submit(@RequestBody Equipage equipage){
+ public R submit(@RequestBody Equipage equipage) {
boolean status = false;
- if (equipage.getId()==null){
+ if (equipage.getId() == null) {
//新增
status = equipageService.save(equipage);
-
- //数据推送
- String s1 =
- "insert into sys_equipage(id,name,number,specifications,mode,dept_id,brand,date_for_production,jurisdiction,user_id,num) " +
- "values(" + "'" + equipage.getId() + "'" + "," +
- "'" + equipage.getName() + "'" + "," +
- "'" + equipage.getNumber() + "'" + "," +
- "'" + equipage.getSpecifications() + "'" + "," +
- "'" + equipage.getMode() + "'" + "," +
- "'" + equipage.getDeptId() + "'" + "," +
- "'" + equipage.getBrand() + "'" + "," +
- "'" + new SimpleDateFormat("yyyy-MM-dd").format(equipage.getDateForProduction()) + "'" + "," +
- "'" + equipage.getJurisdiction() + "'" + "," +
- "'" + equipage.getUserId() + "'" + "," +
- "'" +equipage.getNum() + "'" + ")";
- FtpUtil.sqlFileUpload(s1);
- }else {
+ if (status) {
+ //数据推送
+ String s1 =
+ "insert into sys_equipage(id,name,number,specifications,mode,dept_id,brand,date_for_production,jurisdiction,person_in_charge,num) " +
+ "values(" + "'" + equipage.getId() + "'" + "," +
+ "'" + equipage.getName() + "'" + "," +
+ "'" + equipage.getNumber() + "'" + "," +
+ "'" + equipage.getSpecifications() + "'" + "," +
+ "'" + equipage.getMode() + "'" + "," +
+ "'" + equipage.getDeptId() + "'" + "," +
+ "'" + equipage.getBrand() + "'" + "," +
+ "'" + new SimpleDateFormat("yyyy-MM-dd").format(equipage.getDateForProduction()) + "'" + "," +
+ "'" + equipage.getJurisdiction() + "'" + "," +
+ "'" + equipage.getPersonInCharge() + "'" + "," +
+ "'" + equipage.getNum() + "'" + ")";
+ //FtpUtil.sqlFileUpload(s1);
+ myAsyncService.dataSync(s1);
+ }
+ } else {
//修改
status = equipageService.updateById(equipage);
- //内网同步
- String s1 =
- "update sys_equipage set name = " + "'" + equipage.getName() + "'" +
- ",number = " + "'" + equipage.getDeptId() + "'" +
- ",specifications = " + "'" + equipage.getSpecifications() + "'" +
- ",mode = " + "'" + equipage.getMode() + "'" +
- ",dept_id = " + "'" + equipage.getDeptId() + "'" +
- ",brand = " + "'" + equipage.getBrand() + "'" +
- ",date_for_production = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(equipage.getDateForProduction()) + "'" +
- ",jurisdiction = " + "'" + equipage.getJurisdiction() + "'" +
- ",user_id = " + "'" + equipage.getUserId() + "'" +
- ",num = " + "'" + equipage.getNum() + "'" +
- " " +"where id = " + "'" + equipage.getId() + "'";
- FtpUtil.sqlFileUpload(s1);
+ if (status) {
+ //内网同步
+ String s1 =
+ "update sys_equipage set name = " + "'" + equipage.getName() + "'" +
+ ",number = " + "'" + equipage.getDeptId() + "'" +
+ ",specifications = " + "'" + equipage.getSpecifications() + "'" +
+ ",mode = " + "'" + equipage.getMode() + "'" +
+ ",dept_id = " + "'" + equipage.getDeptId() + "'" +
+ ",brand = " + "'" + equipage.getBrand() + "'" +
+ ",date_for_production = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(equipage.getDateForProduction()) + "'" +
+ ",jurisdiction = " + "'" + equipage.getJurisdiction() + "'" +
+ ",num = " + "'" + equipage.getNum() + "'" +
+ ",person_in_charge = " + "'" + equipage.getPersonInCharge() + "'" +
+ " " + "where id = " + "'" + equipage.getId() + "'";
+ //FtpUtil.sqlFileUpload(s1);
+ 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_equipage where id = " + "'" + id + "'";
- FtpUtil.sqlFileUpload(s1);
+ //FtpUtil.sqlFileUpload(s1);
+ myAsyncService.dataSync(s1);
});
return R.status(equipageService.removeByIds(Func.toLongList(ids)));
}
/**
* 详情
+ *
* @param equipage 装备信息对象
*/
@GetMapping("/detail")
@@ -145,6 +159,7 @@
/**
* 导入装备数据
+ *
* @param isCovered 1 覆盖 0不覆盖
* @return
*/
@@ -161,7 +176,7 @@
*/
@GetMapping("export-template")
@ApiOperation(value = "导出模板")
- public void exportUser(HttpServletResponse response) {
+ public void exportEquipage(HttpServletResponse response) {
List<EquipageExcel> list = new ArrayList<>();
EquipageExcel equipage = new EquipageExcel();
equipage.setDeptName("***保安公司");
@@ -171,6 +186,7 @@
equipage.setPersonInCharge("张三");
equipage.setBrand("***有限公司");
equipage.setDateForProduction("2021/05/01");
+ equipage.setReceiveDate("2021/05/01");
list.add(equipage);
ExcelUtil.export(response, "装备导入数据模板", "装备导入数据表", list, EquipageExcel.class);
}
--
Gitblit v1.9.3