use of org.jeecg.modules.system.entity.SysUserAgent in project jeecg-boot by jeecgboot.
the class SysUserAgentController method queryById.
/**
* 通过id查询
* @param id
* @return
*/
@GetMapping(value = "/queryById")
public Result<SysUserAgent> queryById(@RequestParam(name = "id", required = true) String id) {
Result<SysUserAgent> result = new Result<SysUserAgent>();
SysUserAgent sysUserAgent = sysUserAgentService.getById(id);
if (sysUserAgent == null) {
result.error500("未找到对应实体");
} else {
result.setResult(sysUserAgent);
result.setSuccess(true);
}
return result;
}
use of org.jeecg.modules.system.entity.SysUserAgent in project jeecg-boot by jeecgboot.
the class SysUserAgentController method queryByUserName.
/**
* 通过userName查询
* @param userName
* @return
*/
@GetMapping(value = "/queryByUserName")
public Result<SysUserAgent> queryByUserName(@RequestParam(name = "userName", required = true) String userName) {
Result<SysUserAgent> result = new Result<SysUserAgent>();
LambdaQueryWrapper<SysUserAgent> queryWrapper = new LambdaQueryWrapper<SysUserAgent>();
queryWrapper.eq(SysUserAgent::getUserName, userName);
SysUserAgent sysUserAgent = sysUserAgentService.getOne(queryWrapper);
if (sysUserAgent == null) {
result.error500("未找到对应实体");
} else {
result.setResult(sysUserAgent);
result.setSuccess(true);
}
return result;
}
use of org.jeecg.modules.system.entity.SysUserAgent in project jeecg-boot by jeecgboot.
the class SysUserAgentController method delete.
/**
* 通过id删除
* @param id
* @return
*/
@DeleteMapping(value = "/delete")
public Result<SysUserAgent> delete(@RequestParam(name = "id", required = true) String id) {
Result<SysUserAgent> result = new Result<SysUserAgent>();
SysUserAgent sysUserAgent = sysUserAgentService.getById(id);
if (sysUserAgent == null) {
result.error500("未找到对应实体");
} else {
boolean ok = sysUserAgentService.removeById(id);
if (ok) {
result.success("删除成功!");
}
}
return result;
}
use of org.jeecg.modules.system.entity.SysUserAgent in project jeecg-boot by jeecgboot.
the class SysUserAgentController method exportXls.
/**
* 导出excel
*
* @param sysUserAgent
* @param request
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(SysUserAgent sysUserAgent, HttpServletRequest request) {
// Step.1 组装查询条件
QueryWrapper<SysUserAgent> queryWrapper = QueryGenerator.initQueryWrapper(sysUserAgent, request.getParameterMap());
// Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
List<SysUserAgent> pageList = sysUserAgentService.list(queryWrapper);
// 导出文件名称
mv.addObject(NormalExcelConstants.FILE_NAME, "用户代理人设置列表");
mv.addObject(NormalExcelConstants.CLASS, SysUserAgent.class);
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
ExportParams exportParams = new ExportParams("用户代理人设置列表数据", "导出人:" + user.getRealname(), "导出信息");
exportParams.setImageBasePath(upLoadPath);
mv.addObject(NormalExcelConstants.PARAMS, exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
use of org.jeecg.modules.system.entity.SysUserAgent in project kms by mahonelau.
the class SysUserAgentController method queryById.
/**
* 通过id查询
* @param id
* @return
*/
@GetMapping(value = "/queryById")
public Result<SysUserAgent> queryById(@RequestParam(name = "id", required = true) String id) {
Result<SysUserAgent> result = new Result<SysUserAgent>();
SysUserAgent sysUserAgent = sysUserAgentService.getById(id);
if (sysUserAgent == null) {
result.error500("未找到对应实体");
} else {
result.setResult(sysUserAgent);
result.setSuccess(true);
}
return result;
}
Aggregations