|
@@ -1,4 +1,4 @@
|
|
-package org.jeecg.modules.thirt.controller;
|
|
|
|
|
|
+package org.jeecg.modules.third.controller;
|
|
|
|
|
|
import cn.com.ctop.common.module.annotation.AutoLog;
|
|
import cn.com.ctop.common.module.annotation.AutoLog;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
@@ -11,8 +11,8 @@ import lombok.extern.slf4j.Slf4j;
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
-import org.jeecg.modules.thirt.entity.ThirtConfigAdvertiser;
|
|
|
|
-import org.jeecg.modules.thirt.server.IThirtConfigAdvertiserService;
|
|
|
|
|
|
+import org.jeecg.modules.third.entity.ThirdConfigAdvertiser;
|
|
|
|
+import org.jeecg.modules.third.server.IThirdConfigAdvertiserService;
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
@@ -44,9 +44,9 @@ import java.util.Map;
|
|
@Api(tags = "对外配置关联广告主")
|
|
@Api(tags = "对外配置关联广告主")
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("/n/thirtConfigAdvertiser")
|
|
@RequestMapping("/n/thirtConfigAdvertiser")
|
|
-public class ThirtConfigAdvertiserController {
|
|
|
|
|
|
+public class ThirdConfigAdvertiserController {
|
|
@Autowired
|
|
@Autowired
|
|
- private IThirtConfigAdvertiserService thirtConfigAdvertiserService;
|
|
|
|
|
|
+ private IThirdConfigAdvertiserService thirtConfigAdvertiserService;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 分页列表查询
|
|
* 分页列表查询
|
|
@@ -60,14 +60,14 @@ public class ThirtConfigAdvertiserController {
|
|
@AutoLog(value = "对外配置关联广告主-分页列表查询")
|
|
@AutoLog(value = "对外配置关联广告主-分页列表查询")
|
|
@ApiOperation(value = "对外配置关联广告主-分页列表查询", notes = "对外配置关联广告主-分页列表查询")
|
|
@ApiOperation(value = "对外配置关联广告主-分页列表查询", notes = "对外配置关联广告主-分页列表查询")
|
|
@GetMapping(value = "/list")
|
|
@GetMapping(value = "/list")
|
|
- public Result<IPage<ThirtConfigAdvertiser>> queryPageList(ThirtConfigAdvertiser thirtConfigAdvertiser,
|
|
|
|
|
|
+ public Result<IPage<ThirdConfigAdvertiser>> queryPageList(ThirdConfigAdvertiser thirtConfigAdvertiser,
|
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
HttpServletRequest req) {
|
|
HttpServletRequest req) {
|
|
- Result<IPage<ThirtConfigAdvertiser>> result = new Result<>();
|
|
|
|
- QueryWrapper<ThirtConfigAdvertiser> queryWrapper = QueryGenerator.initQueryWrapper(thirtConfigAdvertiser, req.getParameterMap());
|
|
|
|
- Page<ThirtConfigAdvertiser> page = new Page<ThirtConfigAdvertiser>(pageNo, pageSize);
|
|
|
|
- IPage<ThirtConfigAdvertiser> pageList = thirtConfigAdvertiserService.page(page, queryWrapper);
|
|
|
|
|
|
+ Result<IPage<ThirdConfigAdvertiser>> result = new Result<>();
|
|
|
|
+ QueryWrapper<ThirdConfigAdvertiser> queryWrapper = QueryGenerator.initQueryWrapper(thirtConfigAdvertiser, req.getParameterMap());
|
|
|
|
+ Page<ThirdConfigAdvertiser> page = new Page<ThirdConfigAdvertiser>(pageNo, pageSize);
|
|
|
|
+ IPage<ThirdConfigAdvertiser> pageList = thirtConfigAdvertiserService.page(page, queryWrapper);
|
|
result.setSuccess(true);
|
|
result.setSuccess(true);
|
|
result.setResult(pageList);
|
|
result.setResult(pageList);
|
|
return result;
|
|
return result;
|
|
@@ -82,8 +82,8 @@ public class ThirtConfigAdvertiserController {
|
|
@AutoLog(value = "对外配置关联广告主-添加")
|
|
@AutoLog(value = "对外配置关联广告主-添加")
|
|
@ApiOperation(value = "对外配置关联广告主-添加", notes = "对外配置关联广告主-添加")
|
|
@ApiOperation(value = "对外配置关联广告主-添加", notes = "对外配置关联广告主-添加")
|
|
@PostMapping(value = "/add")
|
|
@PostMapping(value = "/add")
|
|
- public Result<ThirtConfigAdvertiser> add(@RequestBody ThirtConfigAdvertiser thirtConfigAdvertiser) {
|
|
|
|
- Result<ThirtConfigAdvertiser> result = new Result<>();
|
|
|
|
|
|
+ public Result<ThirdConfigAdvertiser> add(@RequestBody ThirdConfigAdvertiser thirtConfigAdvertiser) {
|
|
|
|
+ Result<ThirdConfigAdvertiser> result = new Result<>();
|
|
try {
|
|
try {
|
|
thirtConfigAdvertiserService.save(thirtConfigAdvertiser);
|
|
thirtConfigAdvertiserService.save(thirtConfigAdvertiser);
|
|
result.success("添加成功!");
|
|
result.success("添加成功!");
|
|
@@ -103,9 +103,9 @@ public class ThirtConfigAdvertiserController {
|
|
@AutoLog(value = "对外配置关联广告主-编辑")
|
|
@AutoLog(value = "对外配置关联广告主-编辑")
|
|
@ApiOperation(value = "对外配置关联广告主-编辑", notes = "对外配置关联广告主-编辑")
|
|
@ApiOperation(value = "对外配置关联广告主-编辑", notes = "对外配置关联广告主-编辑")
|
|
@PutMapping(value = "/edit")
|
|
@PutMapping(value = "/edit")
|
|
- public Result<ThirtConfigAdvertiser> edit(@RequestBody ThirtConfigAdvertiser thirtConfigAdvertiser) {
|
|
|
|
- Result<ThirtConfigAdvertiser> result = new Result<ThirtConfigAdvertiser>();
|
|
|
|
- ThirtConfigAdvertiser thirtConfigAdvertiserEntity = thirtConfigAdvertiserService.getById(thirtConfigAdvertiser.getId());
|
|
|
|
|
|
+ public Result<ThirdConfigAdvertiser> edit(@RequestBody ThirdConfigAdvertiser thirtConfigAdvertiser) {
|
|
|
|
+ Result<ThirdConfigAdvertiser> result = new Result<ThirdConfigAdvertiser>();
|
|
|
|
+ ThirdConfigAdvertiser thirtConfigAdvertiserEntity = thirtConfigAdvertiserService.getById(thirtConfigAdvertiser.getId());
|
|
if (thirtConfigAdvertiserEntity == null) {
|
|
if (thirtConfigAdvertiserEntity == null) {
|
|
result.error500("未找到对应实体");
|
|
result.error500("未找到对应实体");
|
|
} else {
|
|
} else {
|
|
@@ -146,8 +146,8 @@ public class ThirtConfigAdvertiserController {
|
|
@AutoLog(value = "对外配置关联广告主-批量删除")
|
|
@AutoLog(value = "对外配置关联广告主-批量删除")
|
|
@ApiOperation(value = "对外配置关联广告主-批量删除", notes = "对外配置关联广告主-批量删除")
|
|
@ApiOperation(value = "对外配置关联广告主-批量删除", notes = "对外配置关联广告主-批量删除")
|
|
@DeleteMapping(value = "/deleteBatch")
|
|
@DeleteMapping(value = "/deleteBatch")
|
|
- public Result<ThirtConfigAdvertiser> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
|
|
|
- Result<ThirtConfigAdvertiser> result = new Result<>();
|
|
|
|
|
|
+ public Result<ThirdConfigAdvertiser> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
|
|
|
+ Result<ThirdConfigAdvertiser> result = new Result<>();
|
|
if (ids == null || "".equals(ids.trim())) {
|
|
if (ids == null || "".equals(ids.trim())) {
|
|
result.error500("参数不识别!");
|
|
result.error500("参数不识别!");
|
|
} else {
|
|
} else {
|
|
@@ -166,9 +166,9 @@ public class ThirtConfigAdvertiserController {
|
|
@AutoLog(value = "对外配置关联广告主-通过id查询")
|
|
@AutoLog(value = "对外配置关联广告主-通过id查询")
|
|
@ApiOperation(value = "对外配置关联广告主-通过id查询", notes = "对外配置关联广告主-通过id查询")
|
|
@ApiOperation(value = "对外配置关联广告主-通过id查询", notes = "对外配置关联广告主-通过id查询")
|
|
@GetMapping(value = "/queryById")
|
|
@GetMapping(value = "/queryById")
|
|
- public Result<ThirtConfigAdvertiser> queryById(@RequestParam(name = "id", required = true) String id) {
|
|
|
|
- Result<ThirtConfigAdvertiser> result = new Result<>();
|
|
|
|
- ThirtConfigAdvertiser thirtConfigAdvertiser = thirtConfigAdvertiserService.getById(id);
|
|
|
|
|
|
+ public Result<ThirdConfigAdvertiser> queryById(@RequestParam(name = "id", required = true) String id) {
|
|
|
|
+ Result<ThirdConfigAdvertiser> result = new Result<>();
|
|
|
|
+ ThirdConfigAdvertiser thirtConfigAdvertiser = thirtConfigAdvertiserService.getById(id);
|
|
if (thirtConfigAdvertiser == null) {
|
|
if (thirtConfigAdvertiser == null) {
|
|
result.error500("未找到对应实体");
|
|
result.error500("未找到对应实体");
|
|
} else {
|
|
} else {
|
|
@@ -187,12 +187,12 @@ public class ThirtConfigAdvertiserController {
|
|
@RequestMapping(value = "/exportXls")
|
|
@RequestMapping(value = "/exportXls")
|
|
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
|
|
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
|
|
// Step.1 组装查询条件
|
|
// Step.1 组装查询条件
|
|
- QueryWrapper<ThirtConfigAdvertiser> queryWrapper = null;
|
|
|
|
|
|
+ QueryWrapper<ThirdConfigAdvertiser> queryWrapper = null;
|
|
try {
|
|
try {
|
|
String paramsStr = request.getParameter("paramsStr");
|
|
String paramsStr = request.getParameter("paramsStr");
|
|
if (oConvertUtils.isNotEmpty(paramsStr)) {
|
|
if (oConvertUtils.isNotEmpty(paramsStr)) {
|
|
String deString = URLDecoder.decode(paramsStr, "UTF-8");
|
|
String deString = URLDecoder.decode(paramsStr, "UTF-8");
|
|
- ThirtConfigAdvertiser thirtConfigAdvertiser = JSON.parseObject(deString, ThirtConfigAdvertiser.class);
|
|
|
|
|
|
+ ThirdConfigAdvertiser thirtConfigAdvertiser = JSON.parseObject(deString, ThirdConfigAdvertiser.class);
|
|
queryWrapper = QueryGenerator.initQueryWrapper(thirtConfigAdvertiser, request.getParameterMap());
|
|
queryWrapper = QueryGenerator.initQueryWrapper(thirtConfigAdvertiser, request.getParameterMap());
|
|
}
|
|
}
|
|
} catch (UnsupportedEncodingException e) {
|
|
} catch (UnsupportedEncodingException e) {
|
|
@@ -201,10 +201,10 @@ public class ThirtConfigAdvertiserController {
|
|
|
|
|
|
//Step.2 AutoPoi 导出Excel
|
|
//Step.2 AutoPoi 导出Excel
|
|
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
|
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
|
- List<ThirtConfigAdvertiser> pageList = thirtConfigAdvertiserService.list(queryWrapper);
|
|
|
|
|
|
+ List<ThirdConfigAdvertiser> pageList = thirtConfigAdvertiserService.list(queryWrapper);
|
|
//导出文件名称
|
|
//导出文件名称
|
|
mv.addObject(NormalExcelConstants.FILE_NAME, "对外配置关联广告主列表");
|
|
mv.addObject(NormalExcelConstants.FILE_NAME, "对外配置关联广告主列表");
|
|
- mv.addObject(NormalExcelConstants.CLASS, ThirtConfigAdvertiser.class);
|
|
|
|
|
|
+ mv.addObject(NormalExcelConstants.CLASS, ThirdConfigAdvertiser.class);
|
|
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("对外配置关联广告主列表数据", "导出人:Jeecg", "导出信息"));
|
|
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("对外配置关联广告主列表数据", "导出人:Jeecg", "导出信息"));
|
|
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
|
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
|
return mv;
|
|
return mv;
|
|
@@ -228,7 +228,7 @@ public class ThirtConfigAdvertiserController {
|
|
params.setHeadRows(1);
|
|
params.setHeadRows(1);
|
|
params.setNeedSave(true);
|
|
params.setNeedSave(true);
|
|
try {
|
|
try {
|
|
- List<ThirtConfigAdvertiser> listThirtConfigAdvertisers = ExcelImportUtil.importExcel(file.getInputStream(), ThirtConfigAdvertiser.class, params);
|
|
|
|
|
|
+ List<ThirdConfigAdvertiser> listThirtConfigAdvertisers = ExcelImportUtil.importExcel(file.getInputStream(), ThirdConfigAdvertiser.class, params);
|
|
thirtConfigAdvertiserService.saveBatch(listThirtConfigAdvertisers);
|
|
thirtConfigAdvertiserService.saveBatch(listThirtConfigAdvertisers);
|
|
return Result.ok("文件导入成功!数据行数:" + listThirtConfigAdvertisers.size());
|
|
return Result.ok("文件导入成功!数据行数:" + listThirtConfigAdvertisers.size());
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|