update
This commit is contained in:
@@ -1,161 +1,168 @@
|
|||||||
package org.jeecg.modules.database.controller;
|
package org.jeecg.modules.database.controller;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.URLDecoder;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import org.jeecg.common.api.vo.Result;
|
|
||||||
import org.jeecg.common.system.query.QueryGenerator;
|
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
|
||||||
import org.jeecg.modules.database.entity.Experiment;
|
|
||||||
import org.jeecg.modules.database.service.IExperimentService;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
||||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
||||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
||||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
|
||||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
|
||||||
import org.jeecg.common.system.base.controller.JeecgController;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.util.JwtUtil;
|
||||||
|
import org.jeecg.modules.database.entity.Experiment;
|
||||||
|
import org.jeecg.modules.database.entity.ExperimentLog;
|
||||||
|
import org.jeecg.modules.database.service.IExperimentLogService;
|
||||||
|
import org.jeecg.modules.database.service.IExperimentService;
|
||||||
|
import org.jeecg.modules.system.entity.SysUser;
|
||||||
|
import org.jeecg.modules.system.service.ISysUserService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
/**
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
* @Description: 试验管理
|
* @Description: 试验管理
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2024-08-30
|
* @Date: 2024-08-30
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Tag(name="试验管理")
|
@Tag(name = "试验管理")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/database/experiment")
|
@RequestMapping("/database/experiment")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ExperimentController extends JeecgController<Experiment, IExperimentService> {
|
public class ExperimentController extends JeecgController<Experiment, IExperimentService> {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IExperimentService experimentService;
|
private IExperimentService experimentService;
|
||||||
|
@Autowired
|
||||||
/**
|
private IExperimentLogService experimentLogService;
|
||||||
* 分页列表查询
|
@Autowired
|
||||||
*
|
private ISysUserService userService;
|
||||||
* @param experiment
|
|
||||||
* @param pageNo
|
|
||||||
* @param pageSize
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
//@AutoLog(value = "试验管理-分页列表查询")
|
|
||||||
@Operation(summary="试验管理-分页列表查询")
|
|
||||||
@GetMapping(value = "/list")
|
|
||||||
public Result<IPage<Experiment>> queryPageList(Experiment experiment,
|
|
||||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
||||||
HttpServletRequest req) {
|
|
||||||
QueryWrapper<Experiment> queryWrapper = QueryGenerator.initQueryWrapper(experiment, req.getParameterMap());
|
|
||||||
Page<Experiment> page = new Page<Experiment>(pageNo, pageSize);
|
|
||||||
IPage<Experiment> pageList = experimentService.page(page, queryWrapper);
|
|
||||||
return Result.OK(pageList);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加
|
|
||||||
*
|
|
||||||
* @param experiment
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "试验管理-添加")
|
|
||||||
@Operation(summary="试验管理-添加")
|
|
||||||
@RequiresPermissions("database:experiment:add")
|
|
||||||
@PostMapping(value = "/add")
|
|
||||||
public Result<String> add(@RequestBody Experiment experiment) {
|
|
||||||
experimentService.save(experiment);
|
|
||||||
return Result.OK("添加成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param experiment
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "试验管理-编辑")
|
|
||||||
@Operation(summary="试验管理-编辑")
|
|
||||||
@RequiresPermissions("database:experiment:edit")
|
|
||||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
||||||
public Result<String> edit(@RequestBody Experiment experiment) {
|
|
||||||
experimentService.updateById(experiment);
|
|
||||||
return Result.OK("编辑成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id删除
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "试验管理-通过id删除")
|
|
||||||
@Operation(summary="试验管理-通过id删除")
|
|
||||||
@RequiresPermissions("database:experiment:delete")
|
|
||||||
@DeleteMapping(value = "/delete")
|
|
||||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
|
||||||
experimentService.removeById(id);
|
|
||||||
return Result.OK("删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param ids
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "试验管理-批量删除")
|
|
||||||
@Operation(summary="试验管理-批量删除")
|
|
||||||
@RequiresPermissions("database:experiment:deleteBatch")
|
|
||||||
@DeleteMapping(value = "/deleteBatch")
|
|
||||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
||||||
this.experimentService.removeByIds(Arrays.asList(ids.split(",")));
|
|
||||||
return Result.OK("批量删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
//@AutoLog(value = "试验管理-通过id查询")
|
|
||||||
@Operation(summary="试验管理-通过id查询")
|
|
||||||
@GetMapping(value = "/queryById")
|
|
||||||
public Result<Experiment> queryById(@RequestParam(name="id",required=true) String id) {
|
|
||||||
Experiment experiment = experimentService.getById(id);
|
|
||||||
if(experiment==null) {
|
|
||||||
return Result.error("未找到对应数据");
|
|
||||||
}
|
|
||||||
return Result.OK(experiment);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出excel
|
* 分页列表查询
|
||||||
*
|
*
|
||||||
* @param request
|
* @param experiment
|
||||||
* @param experiment
|
* @param pageNo
|
||||||
*/
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "试验管理-分页列表查询")
|
||||||
|
@Operation(summary = "试验管理-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<Experiment>> queryPageList(Experiment experiment,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<Experiment> queryWrapper = QueryGenerator.initQueryWrapper(experiment, req.getParameterMap());
|
||||||
|
Page<Experiment> page = new Page<Experiment>(pageNo, pageSize);
|
||||||
|
IPage<Experiment> pageList = experimentService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param experiment
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "试验管理-添加")
|
||||||
|
@Operation(summary = "试验管理-添加")
|
||||||
|
@RequiresPermissions("database:experiment:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody Experiment experiment, HttpServletRequest request) {
|
||||||
|
experimentService.save(experiment);
|
||||||
|
ExperimentLog experimentLog = new ExperimentLog();
|
||||||
|
experimentLog.setExperimentId(experiment.getId());
|
||||||
|
experimentLog.setLogContent("新建实验");
|
||||||
|
String username = JwtUtil.getUserNameByToken(request);
|
||||||
|
SysUser userByName = userService.getUserByName(username);
|
||||||
|
experimentLog.setCreateBy(userByName.getRealname());
|
||||||
|
experimentLogService.save(experimentLog);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param experiment
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "试验管理-编辑")
|
||||||
|
@Operation(summary = "试验管理-编辑")
|
||||||
|
@RequiresPermissions("database:experiment:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody Experiment experiment, HttpServletRequest request) {
|
||||||
|
experimentService.updateById(experiment);
|
||||||
|
ExperimentLog experimentLog = new ExperimentLog();
|
||||||
|
experimentLog.setExperimentId(experiment.getId());
|
||||||
|
experimentLog.setLogContent("修改实验信息");
|
||||||
|
String username = JwtUtil.getUserNameByToken(request);
|
||||||
|
SysUser userByName = userService.getUserByName(username);
|
||||||
|
experimentLog.setCreateBy(userByName.getRealname());
|
||||||
|
experimentLogService.save(experimentLog);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "试验管理-通过id删除")
|
||||||
|
@Operation(summary = "试验管理-通过id删除")
|
||||||
|
@RequiresPermissions("database:experiment:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
experimentService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "试验管理-批量删除")
|
||||||
|
@Operation(summary = "试验管理-批量删除")
|
||||||
|
@RequiresPermissions("database:experiment:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.experimentService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "试验管理-通过id查询")
|
||||||
|
@Operation(summary = "试验管理-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<Experiment> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
Experiment experiment = experimentService.getById(id);
|
||||||
|
if (experiment == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(experiment);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param experiment
|
||||||
|
*/
|
||||||
@RequiresPermissions("database:experiment:exportXls")
|
@RequiresPermissions("database:experiment:exportXls")
|
||||||
@RequestMapping(value = "/exportXls")
|
@RequestMapping(value = "/exportXls")
|
||||||
public ModelAndView exportXls(HttpServletRequest request, Experiment experiment) {
|
public ModelAndView exportXls(HttpServletRequest request, Experiment experiment) {
|
||||||
@@ -163,12 +170,12 @@ public class ExperimentController extends JeecgController<Experiment, IExperimen
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过excel导入数据
|
* 通过excel导入数据
|
||||||
*
|
*
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("database:experiment:importExcel")
|
@RequiresPermissions("database:experiment:importExcel")
|
||||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
|||||||
@@ -1,161 +1,182 @@
|
|||||||
package org.jeecg.modules.database.controller;
|
package org.jeecg.modules.database.controller;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.URLDecoder;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import org.jeecg.common.api.vo.Result;
|
|
||||||
import org.jeecg.common.system.query.QueryGenerator;
|
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
|
||||||
import org.jeecg.modules.database.entity.ExperimentRadiationProcess;
|
|
||||||
import org.jeecg.modules.database.service.IExperimentRadiationProcessService;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
||||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
||||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
||||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
|
||||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
|
||||||
import org.jeecg.common.system.base.controller.JeecgController;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.util.JwtUtil;
|
||||||
|
import org.jeecg.modules.database.entity.ExperimentLog;
|
||||||
|
import org.jeecg.modules.database.entity.ExperimentRadiationProcess;
|
||||||
|
import org.jeecg.modules.database.service.IExperimentLogService;
|
||||||
|
import org.jeecg.modules.database.service.IExperimentRadiationProcessService;
|
||||||
|
import org.jeecg.modules.system.entity.SysUser;
|
||||||
|
import org.jeecg.modules.system.service.ISysUserService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
/**
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
* @Description: 辐照过程
|
* @Description: 辐照过程
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2024-10-15
|
* @Date: 2024-10-15
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Tag(name="辐照过程")
|
@Tag(name = "辐照过程")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/database/experimentRadiationProcess")
|
@RequestMapping("/database/experimentRadiationProcess")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ExperimentRadiationProcessController extends JeecgController<ExperimentRadiationProcess, IExperimentRadiationProcessService> {
|
public class ExperimentRadiationProcessController extends JeecgController<ExperimentRadiationProcess, IExperimentRadiationProcessService> {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IExperimentRadiationProcessService experimentRadiationProcessService;
|
private IExperimentRadiationProcessService experimentRadiationProcessService;
|
||||||
|
|
||||||
/**
|
@Autowired
|
||||||
* 分页列表查询
|
private IExperimentLogService experimentLogService;
|
||||||
*
|
@Autowired
|
||||||
* @param experimentRadiationProcess
|
private ISysUserService userService;
|
||||||
* @param pageNo
|
|
||||||
* @param pageSize
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
//@AutoLog(value = "辐照过程-分页列表查询")
|
|
||||||
@Operation(summary="辐照过程-分页列表查询")
|
|
||||||
@GetMapping(value = "/list")
|
|
||||||
public Result<IPage<ExperimentRadiationProcess>> queryPageList(ExperimentRadiationProcess experimentRadiationProcess,
|
|
||||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
||||||
HttpServletRequest req) {
|
|
||||||
QueryWrapper<ExperimentRadiationProcess> queryWrapper = QueryGenerator.initQueryWrapper(experimentRadiationProcess, req.getParameterMap());
|
|
||||||
Page<ExperimentRadiationProcess> page = new Page<ExperimentRadiationProcess>(pageNo, pageSize);
|
|
||||||
IPage<ExperimentRadiationProcess> pageList = experimentRadiationProcessService.page(page, queryWrapper);
|
|
||||||
return Result.OK(pageList);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加
|
|
||||||
*
|
|
||||||
* @param experimentRadiationProcess
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "辐照过程-添加")
|
|
||||||
@Operation(summary="辐照过程-添加")
|
|
||||||
@RequiresPermissions("database:experiment_radiation_process:add")
|
|
||||||
@PostMapping(value = "/add")
|
|
||||||
public Result<String> add(@RequestBody ExperimentRadiationProcess experimentRadiationProcess) {
|
|
||||||
experimentRadiationProcessService.save(experimentRadiationProcess);
|
|
||||||
return Result.OK("添加成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param experimentRadiationProcess
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "辐照过程-编辑")
|
|
||||||
@Operation(summary="辐照过程-编辑")
|
|
||||||
@RequiresPermissions("database:experiment_radiation_process:edit")
|
|
||||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
||||||
public Result<String> edit(@RequestBody ExperimentRadiationProcess experimentRadiationProcess) {
|
|
||||||
experimentRadiationProcessService.updateById(experimentRadiationProcess);
|
|
||||||
return Result.OK("编辑成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id删除
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "辐照过程-通过id删除")
|
|
||||||
@Operation(summary="辐照过程-通过id删除")
|
|
||||||
@RequiresPermissions("database:experiment_radiation_process:delete")
|
|
||||||
@DeleteMapping(value = "/delete")
|
|
||||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
|
||||||
experimentRadiationProcessService.removeById(id);
|
|
||||||
return Result.OK("删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param ids
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "辐照过程-批量删除")
|
|
||||||
@Operation(summary="辐照过程-批量删除")
|
|
||||||
@RequiresPermissions("database:experiment_radiation_process:deleteBatch")
|
|
||||||
@DeleteMapping(value = "/deleteBatch")
|
|
||||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
||||||
this.experimentRadiationProcessService.removeByIds(Arrays.asList(ids.split(",")));
|
|
||||||
return Result.OK("批量删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
//@AutoLog(value = "辐照过程-通过id查询")
|
|
||||||
@Operation(summary="辐照过程-通过id查询")
|
|
||||||
@GetMapping(value = "/queryById")
|
|
||||||
public Result<ExperimentRadiationProcess> queryById(@RequestParam(name="id",required=true) String id) {
|
|
||||||
ExperimentRadiationProcess experimentRadiationProcess = experimentRadiationProcessService.getById(id);
|
|
||||||
if(experimentRadiationProcess==null) {
|
|
||||||
return Result.error("未找到对应数据");
|
|
||||||
}
|
|
||||||
return Result.OK(experimentRadiationProcess);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出excel
|
* 分页列表查询
|
||||||
*
|
*
|
||||||
* @param request
|
* @param experimentRadiationProcess
|
||||||
* @param experimentRadiationProcess
|
* @param pageNo
|
||||||
*/
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "辐照过程-分页列表查询")
|
||||||
|
@Operation(summary = "辐照过程-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<ExperimentRadiationProcess>> queryPageList(ExperimentRadiationProcess experimentRadiationProcess,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<ExperimentRadiationProcess> queryWrapper = QueryGenerator.initQueryWrapper(experimentRadiationProcess, req.getParameterMap());
|
||||||
|
Page<ExperimentRadiationProcess> page = new Page<ExperimentRadiationProcess>(pageNo, pageSize);
|
||||||
|
IPage<ExperimentRadiationProcess> pageList = experimentRadiationProcessService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param experimentRadiationProcess
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "辐照过程-添加")
|
||||||
|
@Operation(summary = "辐照过程-添加")
|
||||||
|
@RequiresPermissions("database:experiment_radiation_process:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody ExperimentRadiationProcess experimentRadiationProcess, HttpServletRequest request) {
|
||||||
|
experimentRadiationProcessService.save(experimentRadiationProcess);
|
||||||
|
|
||||||
|
ExperimentLog experimentLog = new ExperimentLog();
|
||||||
|
experimentLog.setExperimentId(experimentRadiationProcess.getExperimentId());
|
||||||
|
experimentLog.setLogContent("添加辐照过程");
|
||||||
|
String username = JwtUtil.getUserNameByToken(request);
|
||||||
|
SysUser userByName = userService.getUserByName(username);
|
||||||
|
experimentLog.setCreateBy(userByName.getRealname());
|
||||||
|
experimentLogService.save(experimentLog);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param experimentRadiationProcess
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "辐照过程-编辑")
|
||||||
|
@Operation(summary = "辐照过程-编辑")
|
||||||
|
@RequiresPermissions("database:experiment_radiation_process:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody ExperimentRadiationProcess experimentRadiationProcess, HttpServletRequest request) {
|
||||||
|
experimentRadiationProcessService.updateById(experimentRadiationProcess);
|
||||||
|
ExperimentRadiationProcess byId = experimentRadiationProcessService.getById(experimentRadiationProcess.getId());
|
||||||
|
|
||||||
|
ExperimentLog experimentLog = new ExperimentLog();
|
||||||
|
experimentLog.setExperimentId(byId.getExperimentId());
|
||||||
|
experimentLog.setLogContent("添加辐照过程");
|
||||||
|
String username = JwtUtil.getUserNameByToken(request);
|
||||||
|
SysUser userByName = userService.getUserByName(username);
|
||||||
|
experimentLog.setCreateBy(userByName.getRealname());
|
||||||
|
experimentLogService.save(experimentLog);
|
||||||
|
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "辐照过程-通过id删除")
|
||||||
|
@Operation(summary = "辐照过程-通过id删除")
|
||||||
|
@RequiresPermissions("database:experiment_radiation_process:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id, HttpServletRequest request) {
|
||||||
|
experimentRadiationProcessService.removeById(id);
|
||||||
|
ExperimentRadiationProcess byId = experimentRadiationProcessService.getById(id);
|
||||||
|
|
||||||
|
ExperimentLog experimentLog = new ExperimentLog();
|
||||||
|
experimentLog.setExperimentId(byId.getExperimentId());
|
||||||
|
experimentLog.setLogContent("删除辐照过程");
|
||||||
|
String username = JwtUtil.getUserNameByToken(request);
|
||||||
|
SysUser userByName = userService.getUserByName(username);
|
||||||
|
experimentLog.setCreateBy(userByName.getRealname());
|
||||||
|
experimentLogService.save(experimentLog);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "辐照过程-批量删除")
|
||||||
|
@Operation(summary = "辐照过程-批量删除")
|
||||||
|
@RequiresPermissions("database:experiment_radiation_process:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.experimentRadiationProcessService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "辐照过程-通过id查询")
|
||||||
|
@Operation(summary = "辐照过程-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<ExperimentRadiationProcess> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
ExperimentRadiationProcess experimentRadiationProcess = experimentRadiationProcessService.getById(id);
|
||||||
|
if (experimentRadiationProcess == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(experimentRadiationProcess);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param experimentRadiationProcess
|
||||||
|
*/
|
||||||
@RequiresPermissions("database:experiment_radiation_process:exportXls")
|
@RequiresPermissions("database:experiment_radiation_process:exportXls")
|
||||||
@RequestMapping(value = "/exportXls")
|
@RequestMapping(value = "/exportXls")
|
||||||
public ModelAndView exportXls(HttpServletRequest request, ExperimentRadiationProcess experimentRadiationProcess) {
|
public ModelAndView exportXls(HttpServletRequest request, ExperimentRadiationProcess experimentRadiationProcess) {
|
||||||
@@ -163,12 +184,12 @@ public class ExperimentRadiationProcessController extends JeecgController<Experi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过excel导入数据
|
* 通过excel导入数据
|
||||||
*
|
*
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("database:experiment_radiation_process:importExcel")
|
@RequiresPermissions("database:experiment_radiation_process:importExcel")
|
||||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
|||||||
@@ -1,161 +1,179 @@
|
|||||||
package org.jeecg.modules.database.controller;
|
package org.jeecg.modules.database.controller;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.URLDecoder;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import org.jeecg.common.api.vo.Result;
|
|
||||||
import org.jeecg.common.system.query.QueryGenerator;
|
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
|
||||||
import org.jeecg.modules.database.entity.ExperimentTestProcess;
|
|
||||||
import org.jeecg.modules.database.service.IExperimentTestProcessService;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
||||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
||||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
||||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
|
||||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
|
||||||
import org.jeecg.common.system.base.controller.JeecgController;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.util.JwtUtil;
|
||||||
|
import org.jeecg.modules.database.entity.ExperimentLog;
|
||||||
|
import org.jeecg.modules.database.entity.ExperimentTestProcess;
|
||||||
|
import org.jeecg.modules.database.service.IExperimentLogService;
|
||||||
|
import org.jeecg.modules.database.service.IExperimentTestProcessService;
|
||||||
|
import org.jeecg.modules.system.entity.SysUser;
|
||||||
|
import org.jeecg.modules.system.service.ISysUserService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
/**
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
* @Description: 测试过程
|
* @Description: 测试过程
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2024-10-15
|
* @Date: 2024-10-15
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Tag(name="测试过程")
|
@Tag(name = "测试过程")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/database/experimentTestProcess")
|
@RequestMapping("/database/experimentTestProcess")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ExperimentTestProcessController extends JeecgController<ExperimentTestProcess, IExperimentTestProcessService> {
|
public class ExperimentTestProcessController extends JeecgController<ExperimentTestProcess, IExperimentTestProcessService> {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IExperimentTestProcessService experimentTestProcessService;
|
private IExperimentTestProcessService experimentTestProcessService;
|
||||||
|
|
||||||
/**
|
@Autowired
|
||||||
* 分页列表查询
|
private IExperimentLogService experimentLogService;
|
||||||
*
|
@Autowired
|
||||||
* @param experimentTestProcess
|
private ISysUserService userService;
|
||||||
* @param pageNo
|
|
||||||
* @param pageSize
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
//@AutoLog(value = "测试过程-分页列表查询")
|
|
||||||
@Operation(summary="测试过程-分页列表查询")
|
|
||||||
@GetMapping(value = "/list")
|
|
||||||
public Result<IPage<ExperimentTestProcess>> queryPageList(ExperimentTestProcess experimentTestProcess,
|
|
||||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
||||||
HttpServletRequest req) {
|
|
||||||
QueryWrapper<ExperimentTestProcess> queryWrapper = QueryGenerator.initQueryWrapper(experimentTestProcess, req.getParameterMap());
|
|
||||||
Page<ExperimentTestProcess> page = new Page<ExperimentTestProcess>(pageNo, pageSize);
|
|
||||||
IPage<ExperimentTestProcess> pageList = experimentTestProcessService.page(page, queryWrapper);
|
|
||||||
return Result.OK(pageList);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加
|
|
||||||
*
|
|
||||||
* @param experimentTestProcess
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "测试过程-添加")
|
|
||||||
@Operation(summary="测试过程-添加")
|
|
||||||
@RequiresPermissions("database:experiment_test_process:add")
|
|
||||||
@PostMapping(value = "/add")
|
|
||||||
public Result<String> add(@RequestBody ExperimentTestProcess experimentTestProcess) {
|
|
||||||
experimentTestProcessService.save(experimentTestProcess);
|
|
||||||
return Result.OK("添加成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param experimentTestProcess
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "测试过程-编辑")
|
|
||||||
@Operation(summary="测试过程-编辑")
|
|
||||||
@RequiresPermissions("database:experiment_test_process:edit")
|
|
||||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
||||||
public Result<String> edit(@RequestBody ExperimentTestProcess experimentTestProcess) {
|
|
||||||
experimentTestProcessService.updateById(experimentTestProcess);
|
|
||||||
return Result.OK("编辑成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id删除
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "测试过程-通过id删除")
|
|
||||||
@Operation(summary="测试过程-通过id删除")
|
|
||||||
@RequiresPermissions("database:experiment_test_process:delete")
|
|
||||||
@DeleteMapping(value = "/delete")
|
|
||||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
|
||||||
experimentTestProcessService.removeById(id);
|
|
||||||
return Result.OK("删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param ids
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "测试过程-批量删除")
|
|
||||||
@Operation(summary="测试过程-批量删除")
|
|
||||||
@RequiresPermissions("database:experiment_test_process:deleteBatch")
|
|
||||||
@DeleteMapping(value = "/deleteBatch")
|
|
||||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
||||||
this.experimentTestProcessService.removeByIds(Arrays.asList(ids.split(",")));
|
|
||||||
return Result.OK("批量删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
//@AutoLog(value = "测试过程-通过id查询")
|
|
||||||
@Operation(summary="测试过程-通过id查询")
|
|
||||||
@GetMapping(value = "/queryById")
|
|
||||||
public Result<ExperimentTestProcess> queryById(@RequestParam(name="id",required=true) String id) {
|
|
||||||
ExperimentTestProcess experimentTestProcess = experimentTestProcessService.getById(id);
|
|
||||||
if(experimentTestProcess==null) {
|
|
||||||
return Result.error("未找到对应数据");
|
|
||||||
}
|
|
||||||
return Result.OK(experimentTestProcess);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出excel
|
* 分页列表查询
|
||||||
*
|
*
|
||||||
* @param request
|
* @param experimentTestProcess
|
||||||
* @param experimentTestProcess
|
* @param pageNo
|
||||||
*/
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "测试过程-分页列表查询")
|
||||||
|
@Operation(summary = "测试过程-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<ExperimentTestProcess>> queryPageList(ExperimentTestProcess experimentTestProcess,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<ExperimentTestProcess> queryWrapper = QueryGenerator.initQueryWrapper(experimentTestProcess, req.getParameterMap());
|
||||||
|
Page<ExperimentTestProcess> page = new Page<ExperimentTestProcess>(pageNo, pageSize);
|
||||||
|
IPage<ExperimentTestProcess> pageList = experimentTestProcessService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param experimentTestProcess
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "测试过程-添加")
|
||||||
|
@Operation(summary = "测试过程-添加")
|
||||||
|
@RequiresPermissions("database:experiment_test_process:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody ExperimentTestProcess experimentTestProcess, HttpServletRequest request) {
|
||||||
|
experimentTestProcessService.save(experimentTestProcess);
|
||||||
|
|
||||||
|
ExperimentLog experimentLog = new ExperimentLog();
|
||||||
|
experimentLog.setExperimentId(experimentTestProcess.getExperimentId());
|
||||||
|
experimentLog.setLogContent("添加测试过程");
|
||||||
|
String username = JwtUtil.getUserNameByToken(request);
|
||||||
|
SysUser userByName = userService.getUserByName(username);
|
||||||
|
experimentLog.setCreateBy(userByName.getRealname());
|
||||||
|
experimentLogService.save(experimentLog);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param experimentTestProcess
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "测试过程-编辑")
|
||||||
|
@Operation(summary = "测试过程-编辑")
|
||||||
|
@RequiresPermissions("database:experiment_test_process:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody ExperimentTestProcess experimentTestProcess, HttpServletRequest request) {
|
||||||
|
experimentTestProcessService.updateById(experimentTestProcess);
|
||||||
|
ExperimentTestProcess byId = experimentTestProcessService.getById(experimentTestProcess.getId());
|
||||||
|
|
||||||
|
ExperimentLog experimentLog = new ExperimentLog();
|
||||||
|
experimentLog.setExperimentId(byId.getExperimentId());
|
||||||
|
experimentLog.setLogContent("编辑测试过程");
|
||||||
|
String username = JwtUtil.getUserNameByToken(request);
|
||||||
|
SysUser userByName = userService.getUserByName(username);
|
||||||
|
experimentLog.setCreateBy(userByName.getRealname());
|
||||||
|
experimentLogService.save(experimentLog);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "测试过程-通过id删除")
|
||||||
|
@Operation(summary = "测试过程-通过id删除")
|
||||||
|
@RequiresPermissions("database:experiment_test_process:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id, HttpServletRequest request) {
|
||||||
|
experimentTestProcessService.removeById(id);
|
||||||
|
ExperimentLog experimentLog = new ExperimentLog();
|
||||||
|
experimentLog.setExperimentId(id);
|
||||||
|
experimentLog.setLogContent("删除测试过程");
|
||||||
|
String username = JwtUtil.getUserNameByToken(request);
|
||||||
|
SysUser userByName = userService.getUserByName(username);
|
||||||
|
experimentLog.setCreateBy(userByName.getRealname());
|
||||||
|
experimentLogService.save(experimentLog);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "测试过程-批量删除")
|
||||||
|
@Operation(summary = "测试过程-批量删除")
|
||||||
|
@RequiresPermissions("database:experiment_test_process:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.experimentTestProcessService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "测试过程-通过id查询")
|
||||||
|
@Operation(summary = "测试过程-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<ExperimentTestProcess> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
ExperimentTestProcess experimentTestProcess = experimentTestProcessService.getById(id);
|
||||||
|
if (experimentTestProcess == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(experimentTestProcess);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param experimentTestProcess
|
||||||
|
*/
|
||||||
@RequiresPermissions("database:experiment_test_process:exportXls")
|
@RequiresPermissions("database:experiment_test_process:exportXls")
|
||||||
@RequestMapping(value = "/exportXls")
|
@RequestMapping(value = "/exportXls")
|
||||||
public ModelAndView exportXls(HttpServletRequest request, ExperimentTestProcess experimentTestProcess) {
|
public ModelAndView exportXls(HttpServletRequest request, ExperimentTestProcess experimentTestProcess) {
|
||||||
@@ -163,12 +181,12 @@ public class ExperimentTestProcessController extends JeecgController<ExperimentT
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过excel导入数据
|
* 通过excel导入数据
|
||||||
*
|
*
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("database:experiment_test_process:importExcel")
|
@RequiresPermissions("database:experiment_test_process:importExcel")
|
||||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
|||||||
@@ -1,161 +1,179 @@
|
|||||||
package org.jeecg.modules.database.controller;
|
package org.jeecg.modules.database.controller;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.URLDecoder;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import org.jeecg.common.api.vo.Result;
|
|
||||||
import org.jeecg.common.system.query.QueryGenerator;
|
|
||||||
import org.jeecg.common.util.oConvertUtils;
|
|
||||||
import org.jeecg.modules.database.entity.ExperimentUser;
|
|
||||||
import org.jeecg.modules.database.service.IExperimentUserService;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
||||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
||||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
||||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
|
||||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
|
||||||
import org.jeecg.common.system.base.controller.JeecgController;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.util.JwtUtil;
|
||||||
|
import org.jeecg.modules.database.entity.ExperimentLog;
|
||||||
|
import org.jeecg.modules.database.entity.ExperimentUser;
|
||||||
|
import org.jeecg.modules.database.service.IExperimentLogService;
|
||||||
|
import org.jeecg.modules.database.service.IExperimentUserService;
|
||||||
|
import org.jeecg.modules.system.entity.SysUser;
|
||||||
|
import org.jeecg.modules.system.service.ISysUserService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
/**
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
* @Description: 试验人员
|
* @Description: 试验人员
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2024-08-30
|
* @Date: 2024-08-30
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Tag(name="试验人员")
|
@Tag(name = "试验人员")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/database/experimentUser")
|
@RequestMapping("/database/experimentUser")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ExperimentUserController extends JeecgController<ExperimentUser, IExperimentUserService> {
|
public class ExperimentUserController extends JeecgController<ExperimentUser, IExperimentUserService> {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IExperimentUserService experimentUserService;
|
private IExperimentUserService experimentUserService;
|
||||||
|
|
||||||
/**
|
@Autowired
|
||||||
* 分页列表查询
|
private IExperimentLogService experimentLogService;
|
||||||
*
|
@Autowired
|
||||||
* @param experimentUser
|
private ISysUserService userService;
|
||||||
* @param pageNo
|
|
||||||
* @param pageSize
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
//@AutoLog(value = "试验人员-分页列表查询")
|
|
||||||
@Operation(summary="试验人员-分页列表查询")
|
|
||||||
@GetMapping(value = "/list")
|
|
||||||
public Result<IPage<ExperimentUser>> queryPageList(ExperimentUser experimentUser,
|
|
||||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
||||||
HttpServletRequest req) {
|
|
||||||
QueryWrapper<ExperimentUser> queryWrapper = QueryGenerator.initQueryWrapper(experimentUser, req.getParameterMap());
|
|
||||||
Page<ExperimentUser> page = new Page<ExperimentUser>(pageNo, pageSize);
|
|
||||||
IPage<ExperimentUser> pageList = experimentUserService.page(page, queryWrapper);
|
|
||||||
return Result.OK(pageList);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加
|
|
||||||
*
|
|
||||||
* @param experimentUser
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "试验人员-添加")
|
|
||||||
@Operation(summary="试验人员-添加")
|
|
||||||
@RequiresPermissions("database:experiment_user:add")
|
|
||||||
@PostMapping(value = "/add")
|
|
||||||
public Result<String> add(@RequestBody ExperimentUser experimentUser) {
|
|
||||||
experimentUserService.save(experimentUser);
|
|
||||||
return Result.OK("添加成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param experimentUser
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "试验人员-编辑")
|
|
||||||
@Operation(summary="试验人员-编辑")
|
|
||||||
@RequiresPermissions("database:experiment_user:edit")
|
|
||||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
||||||
public Result<String> edit(@RequestBody ExperimentUser experimentUser) {
|
|
||||||
experimentUserService.updateById(experimentUser);
|
|
||||||
return Result.OK("编辑成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id删除
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "试验人员-通过id删除")
|
|
||||||
@Operation(summary="试验人员-通过id删除")
|
|
||||||
@RequiresPermissions("database:experiment_user:delete")
|
|
||||||
@DeleteMapping(value = "/delete")
|
|
||||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
|
||||||
experimentUserService.removeById(id);
|
|
||||||
return Result.OK("删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param ids
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "试验人员-批量删除")
|
|
||||||
@Operation(summary="试验人员-批量删除")
|
|
||||||
@RequiresPermissions("database:experiment_user:deleteBatch")
|
|
||||||
@DeleteMapping(value = "/deleteBatch")
|
|
||||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
||||||
this.experimentUserService.removeByIds(Arrays.asList(ids.split(",")));
|
|
||||||
return Result.OK("批量删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
//@AutoLog(value = "试验人员-通过id查询")
|
|
||||||
@Operation(summary="试验人员-通过id查询")
|
|
||||||
@GetMapping(value = "/queryById")
|
|
||||||
public Result<ExperimentUser> queryById(@RequestParam(name="id",required=true) String id) {
|
|
||||||
ExperimentUser experimentUser = experimentUserService.getById(id);
|
|
||||||
if(experimentUser==null) {
|
|
||||||
return Result.error("未找到对应数据");
|
|
||||||
}
|
|
||||||
return Result.OK(experimentUser);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出excel
|
* 分页列表查询
|
||||||
*
|
*
|
||||||
* @param request
|
* @param experimentUser
|
||||||
* @param experimentUser
|
* @param pageNo
|
||||||
*/
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "试验人员-分页列表查询")
|
||||||
|
@Operation(summary = "试验人员-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<ExperimentUser>> queryPageList(ExperimentUser experimentUser,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<ExperimentUser> queryWrapper = QueryGenerator.initQueryWrapper(experimentUser, req.getParameterMap());
|
||||||
|
Page<ExperimentUser> page = new Page<ExperimentUser>(pageNo, pageSize);
|
||||||
|
IPage<ExperimentUser> pageList = experimentUserService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param experimentUser
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "试验人员-添加")
|
||||||
|
@Operation(summary = "试验人员-添加")
|
||||||
|
@RequiresPermissions("database:experiment_user:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody ExperimentUser experimentUser, HttpServletRequest request) {
|
||||||
|
experimentUserService.save(experimentUser);
|
||||||
|
ExperimentLog experimentLog = new ExperimentLog();
|
||||||
|
experimentLog.setExperimentId(experimentUser.getExperimentId());
|
||||||
|
experimentLog.setLogContent("添加试验人员");
|
||||||
|
String username = JwtUtil.getUserNameByToken(request);
|
||||||
|
SysUser userByName = userService.getUserByName(username);
|
||||||
|
experimentLog.setCreateBy(userByName.getRealname());
|
||||||
|
experimentLogService.save(experimentLog);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param experimentUser
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "试验人员-编辑")
|
||||||
|
@Operation(summary = "试验人员-编辑")
|
||||||
|
@RequiresPermissions("database:experiment_user:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody ExperimentUser experimentUser, HttpServletRequest request) {
|
||||||
|
experimentUserService.updateById(experimentUser);
|
||||||
|
ExperimentUser byId = experimentUserService.getById(experimentUser.getId());
|
||||||
|
|
||||||
|
ExperimentLog experimentLog = new ExperimentLog();
|
||||||
|
experimentLog.setExperimentId(byId.getExperimentId());
|
||||||
|
experimentLog.setLogContent("编辑试验人员");
|
||||||
|
String username = JwtUtil.getUserNameByToken(request);
|
||||||
|
SysUser userByName = userService.getUserByName(username);
|
||||||
|
experimentLog.setCreateBy(userByName.getRealname());
|
||||||
|
experimentLogService.save(experimentLog);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "试验人员-通过id删除")
|
||||||
|
@Operation(summary = "试验人员-通过id删除")
|
||||||
|
@RequiresPermissions("database:experiment_user:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id, HttpServletRequest request) {
|
||||||
|
experimentUserService.removeById(id);
|
||||||
|
|
||||||
|
ExperimentLog experimentLog = new ExperimentLog();
|
||||||
|
experimentLog.setExperimentId(id);
|
||||||
|
experimentLog.setLogContent("删除试验人员");
|
||||||
|
String username = JwtUtil.getUserNameByToken(request);
|
||||||
|
SysUser userByName = userService.getUserByName(username);
|
||||||
|
experimentLog.setCreateBy(userByName.getRealname());
|
||||||
|
experimentLogService.save(experimentLog);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "试验人员-批量删除")
|
||||||
|
@Operation(summary = "试验人员-批量删除")
|
||||||
|
@RequiresPermissions("database:experiment_user:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.experimentUserService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "试验人员-通过id查询")
|
||||||
|
@Operation(summary = "试验人员-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<ExperimentUser> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
ExperimentUser experimentUser = experimentUserService.getById(id);
|
||||||
|
if (experimentUser == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(experimentUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param experimentUser
|
||||||
|
*/
|
||||||
@RequiresPermissions("database:experiment_user:exportXls")
|
@RequiresPermissions("database:experiment_user:exportXls")
|
||||||
@RequestMapping(value = "/exportXls")
|
@RequestMapping(value = "/exportXls")
|
||||||
public ModelAndView exportXls(HttpServletRequest request, ExperimentUser experimentUser) {
|
public ModelAndView exportXls(HttpServletRequest request, ExperimentUser experimentUser) {
|
||||||
@@ -163,12 +181,12 @@ public class ExperimentUserController extends JeecgController<ExperimentUser, IE
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过excel导入数据
|
* 通过excel导入数据
|
||||||
*
|
*
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("database:experiment_user:importExcel")
|
@RequiresPermissions("database:experiment_user:importExcel")
|
||||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
|||||||
Reference in New Issue
Block a user