四六级实体类
This commit is contained in:
parent
7dbef4328b
commit
699c4382f2
|
@ -1,171 +0,0 @@
|
||||||
package org.jeecg.modules.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 javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.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.entity.Achievement;
|
|
||||||
import org.jeecg.modules.service.IAchievementService;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
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.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 成绩表
|
|
||||||
* @Author: jeecg-boot
|
|
||||||
* @Date: 2024-03-07
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Api(tags="成绩表")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/achievement")
|
|
||||||
@Slf4j
|
|
||||||
public class AchievementController extends JeecgController<Achievement, IAchievementService> {
|
|
||||||
@Autowired
|
|
||||||
private IAchievementService achievementService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页列表查询
|
|
||||||
*
|
|
||||||
* @param achievement
|
|
||||||
* @param pageNo
|
|
||||||
* @param pageSize
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
//@AutoLog(value = "成绩表-分页列表查询")
|
|
||||||
@ApiOperation(value="成绩表-分页列表查询", notes="成绩表-分页列表查询")
|
|
||||||
@GetMapping(value = "/list")
|
|
||||||
public Result<IPage<Achievement>> queryPageList(Achievement achievement,
|
|
||||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
||||||
HttpServletRequest req) {
|
|
||||||
QueryWrapper<Achievement> queryWrapper = QueryGenerator.initQueryWrapper(achievement, req.getParameterMap());
|
|
||||||
Page<Achievement> page = new Page<Achievement>(pageNo, pageSize);
|
|
||||||
IPage<Achievement> pageList = achievementService.page(page, queryWrapper);
|
|
||||||
return Result.OK(pageList);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加
|
|
||||||
*
|
|
||||||
* @param achievement
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "成绩表-添加")
|
|
||||||
@ApiOperation(value="成绩表-添加", notes="成绩表-添加")
|
|
||||||
@PostMapping(value = "/add")
|
|
||||||
public Result<String> add(@RequestBody Achievement achievement) {
|
|
||||||
achievementService.save(achievement);
|
|
||||||
return Result.OK("添加成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param achievement
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "成绩表-编辑")
|
|
||||||
@ApiOperation(value="成绩表-编辑", notes="成绩表-编辑")
|
|
||||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
||||||
public Result<String> edit(@RequestBody Achievement achievement) {
|
|
||||||
achievementService.updateById(achievement);
|
|
||||||
return Result.OK("编辑成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id删除
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "成绩表-通过id删除")
|
|
||||||
@ApiOperation(value="成绩表-通过id删除", notes="成绩表-通过id删除")
|
|
||||||
@DeleteMapping(value = "/delete")
|
|
||||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
|
||||||
achievementService.removeById(id);
|
|
||||||
return Result.OK("删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param ids
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "成绩表-批量删除")
|
|
||||||
@ApiOperation(value="成绩表-批量删除", notes="成绩表-批量删除")
|
|
||||||
@DeleteMapping(value = "/deleteBatch")
|
|
||||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
||||||
this.achievementService.removeByIds(Arrays.asList(ids.split(",")));
|
|
||||||
return Result.OK("批量删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
//@AutoLog(value = "成绩表-通过id查询")
|
|
||||||
@ApiOperation(value="成绩表-通过id查询", notes="成绩表-通过id查询")
|
|
||||||
@GetMapping(value = "/queryById")
|
|
||||||
public Result<Achievement> queryById(@RequestParam(name="id",required=true) String id) {
|
|
||||||
Achievement achievement = achievementService.getById(id);
|
|
||||||
if(achievement==null) {
|
|
||||||
return Result.error("未找到对应数据");
|
|
||||||
}
|
|
||||||
return Result.OK(achievement);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出excel
|
|
||||||
*
|
|
||||||
* @param request
|
|
||||||
* @param achievement
|
|
||||||
*/
|
|
||||||
@RequestMapping(value = "/exportXls")
|
|
||||||
public ModelAndView exportXls(HttpServletRequest request, Achievement achievement) {
|
|
||||||
return super.exportXls(request, achievement, Achievement.class, "成绩表");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过excel导入数据
|
|
||||||
*
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
|
||||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
return super.importExcel(request, response, Achievement.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -5,8 +5,8 @@ import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
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.modules.entity.TxtMap;
|
import org.jeecg.modules.entity.Cet_4;
|
||||||
import org.jeecg.modules.service.ITxtMapService;
|
import org.jeecg.modules.service.ICet_4Service;
|
||||||
|
|
||||||
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;
|
||||||
|
@ -20,68 +20,71 @@ import org.springframework.web.servlet.ModelAndView;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 关键词
|
* @Description: cet_4
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2024-03-07
|
* @Date: 2024-03-26
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Api(tags="关键词")
|
@Api(tags="cet_4")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/txtMap")
|
@RequestMapping("/cet/cet_4")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class TxtMapController extends JeecgController<TxtMap, ITxtMapService> {
|
public class Cet_4Controller extends JeecgController<Cet_4, ICet_4Service> {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ITxtMapService txtMapService;
|
private ICet_4Service cet_4Service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页列表查询
|
* 分页列表查询
|
||||||
*
|
*
|
||||||
* @param txtMap
|
* @param cet_4
|
||||||
* @param pageNo
|
* @param pageNo
|
||||||
* @param pageSize
|
* @param pageSize
|
||||||
* @param req
|
* @param req
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
//@AutoLog(value = "关键词-分页列表查询")
|
//@AutoLog(value = "cet_4-分页列表查询")
|
||||||
@ApiOperation(value="关键词-分页列表查询", notes="关键词-分页列表查询")
|
@ApiOperation(value="cet_4-分页列表查询", notes="cet_4-分页列表查询")
|
||||||
@GetMapping(value = "/list")
|
@GetMapping(value = "/list")
|
||||||
public Result<IPage<TxtMap>> queryPageList(TxtMap txtMap,
|
public Result<IPage<Cet_4>> queryPageList(Cet_4 cet_4,
|
||||||
@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) {
|
||||||
QueryWrapper<TxtMap> queryWrapper = QueryGenerator.initQueryWrapper(txtMap, req.getParameterMap());
|
QueryWrapper<Cet_4> queryWrapper = QueryGenerator.initQueryWrapper(cet_4, req.getParameterMap());
|
||||||
Page<TxtMap> page = new Page<TxtMap>(pageNo, pageSize);
|
Page<Cet_4> page = new Page<Cet_4>(pageNo, pageSize);
|
||||||
IPage<TxtMap> pageList = txtMapService.page(page, queryWrapper);
|
IPage<Cet_4> pageList = cet_4Service.page(page, queryWrapper);
|
||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加
|
* 添加
|
||||||
*
|
*
|
||||||
* @param txtMap
|
* @param cet_4
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@AutoLog(value = "关键词-添加")
|
@AutoLog(value = "cet_4-添加")
|
||||||
@ApiOperation(value="关键词-添加", notes="关键词-添加")
|
@ApiOperation(value="cet_4-添加", notes="cet_4-添加")
|
||||||
|
@RequiresPermissions("cet:cet_4:add")
|
||||||
@PostMapping(value = "/add")
|
@PostMapping(value = "/add")
|
||||||
public Result<String> add(@RequestBody TxtMap txtMap) {
|
public Result<String> add(@RequestBody Cet_4 cet_4) {
|
||||||
txtMapService.save(txtMap);
|
cet_4Service.save(cet_4);
|
||||||
return Result.OK("添加成功!");
|
return Result.OK("添加成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
*
|
*
|
||||||
* @param txtMap
|
* @param cet_4
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@AutoLog(value = "关键词-编辑")
|
@AutoLog(value = "cet_4-编辑")
|
||||||
@ApiOperation(value="关键词-编辑", notes="关键词-编辑")
|
@ApiOperation(value="cet_4-编辑", notes="cet_4-编辑")
|
||||||
|
@RequiresPermissions("cet:cet_4:edit")
|
||||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
public Result<String> edit(@RequestBody TxtMap txtMap) {
|
public Result<String> edit(@RequestBody Cet_4 cet_4) {
|
||||||
txtMapService.updateById(txtMap);
|
cet_4Service.updateById(cet_4);
|
||||||
return Result.OK("编辑成功!");
|
return Result.OK("编辑成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,11 +94,12 @@ public class TxtMapController extends JeecgController<TxtMap, ITxtMapService> {
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@AutoLog(value = "关键词-通过id删除")
|
@AutoLog(value = "cet_4-通过id删除")
|
||||||
@ApiOperation(value="关键词-通过id删除", notes="关键词-通过id删除")
|
@ApiOperation(value="cet_4-通过id删除", notes="cet_4-通过id删除")
|
||||||
|
@RequiresPermissions("cet:cet_4:delete")
|
||||||
@DeleteMapping(value = "/delete")
|
@DeleteMapping(value = "/delete")
|
||||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
txtMapService.removeById(id);
|
cet_4Service.removeById(id);
|
||||||
return Result.OK("删除成功!");
|
return Result.OK("删除成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,11 +109,12 @@ public class TxtMapController extends JeecgController<TxtMap, ITxtMapService> {
|
||||||
* @param ids
|
* @param ids
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@AutoLog(value = "关键词-批量删除")
|
@AutoLog(value = "cet_4-批量删除")
|
||||||
@ApiOperation(value="关键词-批量删除", notes="关键词-批量删除")
|
@ApiOperation(value="cet_4-批量删除", notes="cet_4-批量删除")
|
||||||
|
@RequiresPermissions("cet:cet_4:deleteBatch")
|
||||||
@DeleteMapping(value = "/deleteBatch")
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
this.txtMapService.removeByIds(Arrays.asList(ids.split(",")));
|
this.cet_4Service.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
return Result.OK("批量删除成功!");
|
return Result.OK("批量删除成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,26 +124,27 @@ public class TxtMapController extends JeecgController<TxtMap, ITxtMapService> {
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
//@AutoLog(value = "关键词-通过id查询")
|
//@AutoLog(value = "cet_4-通过id查询")
|
||||||
@ApiOperation(value="关键词-通过id查询", notes="关键词-通过id查询")
|
@ApiOperation(value="cet_4-通过id查询", notes="cet_4-通过id查询")
|
||||||
@GetMapping(value = "/queryById")
|
@GetMapping(value = "/queryById")
|
||||||
public Result<TxtMap> queryById(@RequestParam(name="id",required=true) String id) {
|
public Result<Cet_4> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
TxtMap txtMap = txtMapService.getById(id);
|
Cet_4 cet_4 = cet_4Service.getById(id);
|
||||||
if(txtMap==null) {
|
if(cet_4==null) {
|
||||||
return Result.error("未找到对应数据");
|
return Result.error("未找到对应数据");
|
||||||
}
|
}
|
||||||
return Result.OK(txtMap);
|
return Result.OK(cet_4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出excel
|
* 导出excel
|
||||||
*
|
*
|
||||||
* @param request
|
* @param request
|
||||||
* @param txtMap
|
* @param cet_4
|
||||||
*/
|
*/
|
||||||
|
@RequiresPermissions("cet:cet_4:exportXls")
|
||||||
@RequestMapping(value = "/exportXls")
|
@RequestMapping(value = "/exportXls")
|
||||||
public ModelAndView exportXls(HttpServletRequest request, TxtMap txtMap) {
|
public ModelAndView exportXls(HttpServletRequest request, Cet_4 cet_4) {
|
||||||
return super.exportXls(request, txtMap, TxtMap.class, "关键词");
|
return super.exportXls(request, cet_4, Cet_4.class, "cet_4");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -148,9 +154,10 @@ public class TxtMapController extends JeecgController<TxtMap, ITxtMapService> {
|
||||||
* @param response
|
* @param response
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@RequiresPermissions("cet:cet_4: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) {
|
||||||
return super.importExcel(request, response, TxtMap.class);
|
return super.importExcel(request, response, Cet_4.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,163 @@
|
||||||
|
package org.jeecg.modules.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.modules.entity.Cet_6;
|
||||||
|
import org.jeecg.modules.service.ICet_6Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
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.servlet.ModelAndView;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: cet_6
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-03-26
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Api(tags="cet_6")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/cet/cet_6")
|
||||||
|
@Slf4j
|
||||||
|
public class Cet_6Controller extends JeecgController<Cet_6, ICet_6Service> {
|
||||||
|
@Autowired
|
||||||
|
private ICet_6Service cet_6Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param cet_6
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "cet_6-分页列表查询")
|
||||||
|
@ApiOperation(value="cet_6-分页列表查询", notes="cet_6-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<Cet_6>> queryPageList(Cet_6 cet_6,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<Cet_6> queryWrapper = QueryGenerator.initQueryWrapper(cet_6, req.getParameterMap());
|
||||||
|
Page<Cet_6> page = new Page<Cet_6>(pageNo, pageSize);
|
||||||
|
IPage<Cet_6> pageList = cet_6Service.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param cet_6
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "cet_6-添加")
|
||||||
|
@ApiOperation(value="cet_6-添加", notes="cet_6-添加")
|
||||||
|
@RequiresPermissions("cet:cet_6:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody Cet_6 cet_6) {
|
||||||
|
cet_6Service.save(cet_6);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param cet_6
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "cet_6-编辑")
|
||||||
|
@ApiOperation(value="cet_6-编辑", notes="cet_6-编辑")
|
||||||
|
@RequiresPermissions("cet:cet_6:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody Cet_6 cet_6) {
|
||||||
|
cet_6Service.updateById(cet_6);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "cet_6-通过id删除")
|
||||||
|
@ApiOperation(value="cet_6-通过id删除", notes="cet_6-通过id删除")
|
||||||
|
@RequiresPermissions("cet:cet_6:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
cet_6Service.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "cet_6-批量删除")
|
||||||
|
@ApiOperation(value="cet_6-批量删除", notes="cet_6-批量删除")
|
||||||
|
@RequiresPermissions("cet:cet_6:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.cet_6Service.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "cet_6-通过id查询")
|
||||||
|
@ApiOperation(value="cet_6-通过id查询", notes="cet_6-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<Cet_6> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
Cet_6 cet_6 = cet_6Service.getById(id);
|
||||||
|
if(cet_6==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(cet_6);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param cet_6
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("cet:cet_6:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, Cet_6 cet_6) {
|
||||||
|
return super.exportXls(request, cet_6, Cet_6.class, "cet_6");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("cet:cet_6:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, Cet_6.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,185 +0,0 @@
|
||||||
package org.jeecg.modules.controller;
|
|
||||||
|
|
||||||
import java.net.UnknownHostException;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import org.jeecg.common.api.vo.Result;
|
|
||||||
import org.jeecg.common.system.query.QueryGenerator;
|
|
||||||
import org.jeecg.modules.entity.Generationdata;
|
|
||||||
import org.jeecg.modules.generate.ChartData;
|
|
||||||
import org.jeecg.modules.service.IGenerationdataService;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
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.servlet.ModelAndView;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 生成数据管理表
|
|
||||||
* @Author: jeecg-boot
|
|
||||||
* @Date: 2024-03-03
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Api(tags = "生成数据管理表")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/generate")
|
|
||||||
@Slf4j
|
|
||||||
public class GenerationdataController extends JeecgController<Generationdata, IGenerationdataService> {
|
|
||||||
@Autowired
|
|
||||||
private IGenerationdataService generationdataService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 制作大屏的测试数据
|
|
||||||
*/
|
|
||||||
@PostMapping(value = "/getTestData")
|
|
||||||
public Result<?> getTestData(@RequestBody HashMap<String, Object> params) {
|
|
||||||
try {
|
|
||||||
ChartData chartData = new ChartData();
|
|
||||||
JSONObject jsonObject = chartData.getData(new JSONObject(params));
|
|
||||||
return Result.OK(jsonObject);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return Result.error("数据生成失败,原因是:"+e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 依据ID获取数据
|
|
||||||
* 使用/ /风格
|
|
||||||
*/
|
|
||||||
@GetMapping(value = "/getTestDataById/{id}")
|
|
||||||
public Result<?> getTestDataById(@PathVariable String id) throws UnknownHostException {
|
|
||||||
return Result.OK(generationdataService.getDataById(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页列表查询
|
|
||||||
*
|
|
||||||
* @param generationdata
|
|
||||||
* @param pageNo
|
|
||||||
* @param pageSize
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
//@AutoLog(value = "生成数据管理表-分页列表查询")
|
|
||||||
@ApiOperation(value = "生成数据管理表-分页列表查询", notes = "生成数据管理表-分页列表查询")
|
|
||||||
@GetMapping(value = "/list")
|
|
||||||
public Result<IPage<Generationdata>> queryPageList(Generationdata generationdata,
|
|
||||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
||||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
||||||
HttpServletRequest req) {
|
|
||||||
QueryWrapper<Generationdata> queryWrapper = QueryGenerator.initQueryWrapper(generationdata, req.getParameterMap());
|
|
||||||
Page<Generationdata> page = new Page<Generationdata>(pageNo, pageSize);
|
|
||||||
IPage<Generationdata> pageList = generationdataService.page(page, queryWrapper);
|
|
||||||
return Result.OK(pageList);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加
|
|
||||||
*
|
|
||||||
* @param generationdata
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "生成数据管理表-添加")
|
|
||||||
@ApiOperation(value = "生成数据管理表-添加", notes = "生成数据管理表-添加")
|
|
||||||
@PostMapping(value = "/add")
|
|
||||||
public Result<String> add(@RequestBody Generationdata generationdata) {
|
|
||||||
generationdataService.save(generationdata);
|
|
||||||
return Result.OK(generationdata.getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param generationdata
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "生成数据管理表-编辑")
|
|
||||||
@ApiOperation(value = "生成数据管理表-编辑", notes = "生成数据管理表-编辑")
|
|
||||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
|
||||||
public Result<String> edit(@RequestBody Generationdata generationdata) {
|
|
||||||
generationdataService.updateById(generationdata);
|
|
||||||
return Result.OK("编辑成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id删除
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "生成数据管理表-通过id删除")
|
|
||||||
@ApiOperation(value = "生成数据管理表-通过id删除", notes = "生成数据管理表-通过id删除")
|
|
||||||
@DeleteMapping(value = "/delete")
|
|
||||||
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
|
||||||
generationdataService.removeById(id);
|
|
||||||
return Result.OK("删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param ids
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "生成数据管理表-批量删除")
|
|
||||||
@ApiOperation(value = "生成数据管理表-批量删除", notes = "生成数据管理表-批量删除")
|
|
||||||
@DeleteMapping(value = "/deleteBatch")
|
|
||||||
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
|
||||||
this.generationdataService.removeByIds(Arrays.asList(ids.split(",")));
|
|
||||||
return Result.OK("批量删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
//@AutoLog(value = "生成数据管理表-通过id查询")
|
|
||||||
@ApiOperation(value = "生成数据管理表-通过id查询", notes = "生成数据管理表-通过id查询")
|
|
||||||
@GetMapping(value = "/queryById")
|
|
||||||
public Result<Generationdata> queryById(@RequestParam(name = "id", required = true) String id) {
|
|
||||||
Generationdata generationdata = generationdataService.getById(id);
|
|
||||||
if (generationdata == null) {
|
|
||||||
return Result.error("未找到对应数据");
|
|
||||||
}
|
|
||||||
return Result.OK(generationdata);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出excel
|
|
||||||
*
|
|
||||||
* @param request
|
|
||||||
* @param generationdata
|
|
||||||
*/
|
|
||||||
@RequestMapping(value = "/exportXls")
|
|
||||||
public ModelAndView exportXls(HttpServletRequest request, Generationdata generationdata) {
|
|
||||||
return super.exportXls(request, generationdata, Generationdata.class, "生成数据管理表");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过excel导入数据
|
|
||||||
*
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
|
||||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
return super.importExcel(request, response, Generationdata.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,70 +0,0 @@
|
||||||
package org.jeecg.modules.entity;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.Data;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 成绩表
|
|
||||||
* @Author: jeecg-boot
|
|
||||||
* @Date: 2024-03-07
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@TableName("achievement")
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@ApiModel(value="achievement对象", description="成绩表")
|
|
||||||
public class Achievement implements Serializable {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**主键*/
|
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
|
||||||
@ApiModelProperty(value = "主键")
|
|
||||||
private java.lang.String id;
|
|
||||||
/**创建人*/
|
|
||||||
@ApiModelProperty(value = "创建人")
|
|
||||||
private java.lang.String createBy;
|
|
||||||
/**创建日期*/
|
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
|
||||||
@ApiModelProperty(value = "创建日期")
|
|
||||||
private java.util.Date createTime;
|
|
||||||
/**更新人*/
|
|
||||||
@ApiModelProperty(value = "更新人")
|
|
||||||
private java.lang.String updateBy;
|
|
||||||
/**更新日期*/
|
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
|
||||||
@ApiModelProperty(value = "更新日期")
|
|
||||||
private java.util.Date updateTime;
|
|
||||||
/**所属部门*/
|
|
||||||
@ApiModelProperty(value = "所属部门")
|
|
||||||
private java.lang.String sysOrgCode;
|
|
||||||
/**学号*/
|
|
||||||
@Excel(name = "学号", width = 15)
|
|
||||||
@ApiModelProperty(value = "学号")
|
|
||||||
private java.lang.Integer num;
|
|
||||||
/**姓名*/
|
|
||||||
@Excel(name = "姓名", width = 15)
|
|
||||||
@ApiModelProperty(value = "姓名")
|
|
||||||
private java.lang.String name;
|
|
||||||
/**高数成绩*/
|
|
||||||
@Excel(name = "高数成绩", width = 15)
|
|
||||||
@ApiModelProperty(value = "高数成绩")
|
|
||||||
private java.lang.Double math;
|
|
||||||
/**英语成绩*/
|
|
||||||
@Excel(name = "英语成绩", width = 15)
|
|
||||||
@ApiModelProperty(value = "英语成绩")
|
|
||||||
private java.lang.Double english;
|
|
||||||
}
|
|
|
@ -0,0 +1,70 @@
|
||||||
|
package org.jeecg.modules.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: cet_4
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-03-26
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("cet_4")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value="cet_4对象", description="cet_4")
|
||||||
|
public class Cet_4 implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**学生姓名*/
|
||||||
|
@Excel(name = "学生姓名", width = 15)
|
||||||
|
@ApiModelProperty(value = "学生姓名")
|
||||||
|
private String name;
|
||||||
|
/**学生所在学院*/
|
||||||
|
@Excel(name = "学生所在学院", width = 15)
|
||||||
|
@ApiModelProperty(value = "学生所在学院")
|
||||||
|
private String college;
|
||||||
|
/**学生成绩*/
|
||||||
|
@Excel(name = "学生成绩", width = 15)
|
||||||
|
@ApiModelProperty(value = "学生成绩")
|
||||||
|
private Integer result;
|
||||||
|
/**学生学号*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "学生学号")
|
||||||
|
private String id;
|
||||||
|
/**考试批次*/
|
||||||
|
@Excel(name = "考试批次", width = 15, format = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||||
|
@ApiModelProperty(value = "考试批次")
|
||||||
|
private Date batch;
|
||||||
|
/**入学时间*/
|
||||||
|
@Excel(name = "入学时间", width = 15)
|
||||||
|
@ApiModelProperty(value = "入学时间")
|
||||||
|
private String entrydate;
|
||||||
|
/**听力成绩*/
|
||||||
|
@Excel(name = "听力成绩", width = 15)
|
||||||
|
@ApiModelProperty(value = "听力成绩")
|
||||||
|
private Integer listen;
|
||||||
|
/**阅读成绩*/
|
||||||
|
@Excel(name = "阅读成绩", width = 15)
|
||||||
|
@ApiModelProperty(value = "阅读成绩")
|
||||||
|
private Integer reading;
|
||||||
|
/**作文成绩*/
|
||||||
|
@Excel(name = "作文成绩", width = 15)
|
||||||
|
@ApiModelProperty(value = "作文成绩")
|
||||||
|
private Integer writing;
|
||||||
|
}
|
|
@ -0,0 +1,69 @@
|
||||||
|
package org.jeecg.modules.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: cet_6
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-03-26
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("cet_6")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value="cet_6对象", description="cet_6")
|
||||||
|
public class Cet_6 implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**学生姓名*/
|
||||||
|
@Excel(name = "学生姓名", width = 15)
|
||||||
|
@ApiModelProperty(value = "学生姓名")
|
||||||
|
private java.lang.String name;
|
||||||
|
/**学生所在学院*/
|
||||||
|
@Excel(name = "学生所在学院", width = 15)
|
||||||
|
@ApiModelProperty(value = "学生所在学院")
|
||||||
|
private java.lang.String college;
|
||||||
|
/**学生成绩*/
|
||||||
|
@Excel(name = "学生成绩", width = 15)
|
||||||
|
@ApiModelProperty(value = "学生成绩")
|
||||||
|
private java.lang.Integer result;
|
||||||
|
/**学生学号*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "学生学号")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**考试批次*/
|
||||||
|
@Excel(name = "考试批次", width = 15, format = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||||
|
@ApiModelProperty(value = "考试批次")
|
||||||
|
private java.util.Date batch;
|
||||||
|
/**入学时间*/
|
||||||
|
@Excel(name = "入学时间", width = 15)
|
||||||
|
@ApiModelProperty(value = "入学时间")
|
||||||
|
private java.lang.String entrydate;
|
||||||
|
/**听力成绩*/
|
||||||
|
@Excel(name = "听力成绩", width = 15)
|
||||||
|
@ApiModelProperty(value = "听力成绩")
|
||||||
|
private java.lang.Integer listen;
|
||||||
|
/**阅读成绩*/
|
||||||
|
@Excel(name = "阅读成绩", width = 15)
|
||||||
|
@ApiModelProperty(value = "阅读成绩")
|
||||||
|
private java.lang.Integer reading;
|
||||||
|
/**作文成绩*/
|
||||||
|
@Excel(name = "作文成绩", width = 15)
|
||||||
|
@ApiModelProperty(value = "作文成绩")
|
||||||
|
private java.lang.Integer writing;
|
||||||
|
}
|
|
@ -1,78 +0,0 @@
|
||||||
package org.jeecg.modules.entity;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
|
||||||
import lombok.Data;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
|
||||||
import org.jeecg.common.aspect.annotation.Dict;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 生成数据管理表
|
|
||||||
* @Author: jeecg-boot
|
|
||||||
* @Date: 2024-03-04
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@TableName("generationdata")
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@ApiModel(value="generationdata对象", description="生成数据管理表")
|
|
||||||
public class Generationdata implements Serializable {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**主键*/
|
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
|
||||||
@ApiModelProperty(value = "主键")
|
|
||||||
private java.lang.String id;
|
|
||||||
/**创建人*/
|
|
||||||
@ApiModelProperty(value = "创建人")
|
|
||||||
private java.lang.String createBy;
|
|
||||||
/**创建日期*/
|
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
|
||||||
@ApiModelProperty(value = "创建日期")
|
|
||||||
private java.util.Date createTime;
|
|
||||||
/**更新人*/
|
|
||||||
@ApiModelProperty(value = "更新人")
|
|
||||||
private java.lang.String updateBy;
|
|
||||||
/**更新日期*/
|
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
|
||||||
@ApiModelProperty(value = "更新日期")
|
|
||||||
private java.util.Date updateTime;
|
|
||||||
/**所属部门*/
|
|
||||||
@ApiModelProperty(value = "所属部门")
|
|
||||||
private java.lang.String sysOrgCode;
|
|
||||||
/**数据链接*/
|
|
||||||
@Excel(name = "数据链接", width = 15)
|
|
||||||
@ApiModelProperty(value = "数据链接")
|
|
||||||
private java.lang.String url;
|
|
||||||
/**查询参数*/
|
|
||||||
@Excel(name = "查询参数", width = 15)
|
|
||||||
@ApiModelProperty(value = "查询参数")
|
|
||||||
private java.lang.String parameter;
|
|
||||||
/**数据类型*/
|
|
||||||
@Excel(name = "数据类型", width = 15)
|
|
||||||
@ApiModelProperty(value = "数据类型")
|
|
||||||
private java.lang.String datatype;
|
|
||||||
/**数据规则*/
|
|
||||||
@Excel(name = "数据规则", width = 15)
|
|
||||||
@ApiModelProperty(value = "数据规则")
|
|
||||||
private java.lang.String datarules;
|
|
||||||
/**备注*/
|
|
||||||
@Excel(name = "备注", width = 15)
|
|
||||||
@ApiModelProperty(value = "备注")
|
|
||||||
private java.lang.String remarks;
|
|
||||||
}
|
|
|
@ -1,67 +0,0 @@
|
||||||
package org.jeecg.modules.entity;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.Data;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 关键词
|
|
||||||
* @Author: jeecg-boot
|
|
||||||
* @Date: 2024-03-07
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@TableName("map")
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@ApiModel(value="map对象", description="关键词")
|
|
||||||
public class TxtMap implements Serializable {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**主键*/
|
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
|
||||||
@ApiModelProperty(value = "主键")
|
|
||||||
private String id;
|
|
||||||
/**创建人*/
|
|
||||||
@ApiModelProperty(value = "创建人")
|
|
||||||
private String createBy;
|
|
||||||
/**创建日期*/
|
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
|
||||||
@ApiModelProperty(value = "创建日期")
|
|
||||||
private Date createTime;
|
|
||||||
/**更新人*/
|
|
||||||
@ApiModelProperty(value = "更新人")
|
|
||||||
private String updateBy;
|
|
||||||
/**更新日期*/
|
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
|
||||||
@ApiModelProperty(value = "更新日期")
|
|
||||||
private Date updateTime;
|
|
||||||
/**所属部门*/
|
|
||||||
@ApiModelProperty(value = "所属部门")
|
|
||||||
private String sysOrgCode;
|
|
||||||
/**特殊键*/
|
|
||||||
@Excel(name = "特殊键", width = 15)
|
|
||||||
@ApiModelProperty(value = "特殊键")
|
|
||||||
private String txtkey;
|
|
||||||
/**值*/
|
|
||||||
@Excel(name = "值", width = 15)
|
|
||||||
@ApiModelProperty(value = "值")
|
|
||||||
private String txtvalue;
|
|
||||||
/**备注*/
|
|
||||||
@Excel(name = "备注", width = 15)
|
|
||||||
@ApiModelProperty(value = "备注")
|
|
||||||
private String remarks;
|
|
||||||
}
|
|
|
@ -1,65 +0,0 @@
|
||||||
package org.jeecg.modules.generate;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import org.jeecg.modules.generate.core.*;
|
|
||||||
import org.jeecg.modules.generate.entity.Parameters;
|
|
||||||
|
|
||||||
//'widget-text': WidgetText,
|
|
||||||
//'widget-barchart': widgetBarchart,
|
|
||||||
//'widget-linechart': WidgetLinechart,
|
|
||||||
//'widget-barlinechart': WidgetBarlinechart,
|
|
||||||
//'widget-piechart': WidgetPiechart,
|
|
||||||
//'widget-funnel': WidgetFunnel,
|
|
||||||
//'widget-table': WidgetTable,
|
|
||||||
//'widget-radar': WidgetRadar,
|
|
||||||
public class Butler {
|
|
||||||
// 处理查询参数
|
|
||||||
public static Parameters getQueryParameters(JSONObject params) {
|
|
||||||
String chartType = (String) params.get("type");
|
|
||||||
if (chartType.equals("widget-text")) {
|
|
||||||
return WidgetText.getQueryParameters(params);
|
|
||||||
} else if (chartType.equals("widget-barchart")) {
|
|
||||||
return WidgetBarchart.getQueryParameters(params);
|
|
||||||
} else if (chartType.equals("widget-linechart")) {
|
|
||||||
return WidgetLinechart.getQueryParameters(params);
|
|
||||||
} else if (chartType.equals("widget-barlinechart")) {
|
|
||||||
return WidgetBarlinechart.getQueryParameters(params);
|
|
||||||
} else if (chartType.equals("widget-piechart")) {
|
|
||||||
return WidgetPiechart.getQueryParameters(params);
|
|
||||||
} else if (chartType.equals("widget-funnel")) {
|
|
||||||
return WidgetFunnel.getQueryParameters(params);
|
|
||||||
} else if (chartType.equals("widget-table")) {
|
|
||||||
return WidgetTable.getQueryParameters(params);
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理查询结果
|
|
||||||
public static JSONObject getQueryResult(JSONObject params, JSONObject result) {
|
|
||||||
if (result.isEmpty() || ((JSONArray) result.get("records")).isEmpty()) {
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
|
||||||
jsonObject.put("data", "该逻辑暂无数据");
|
|
||||||
return jsonObject;
|
|
||||||
}
|
|
||||||
String chartType = (String) params.get("type");
|
|
||||||
if (chartType.equals("widget-text")) {
|
|
||||||
return WidgetText.getQueryResult(params, result);
|
|
||||||
} else if (chartType.equals("widget-barchart")) {
|
|
||||||
return WidgetBarchart.getQueryResult(params, result);
|
|
||||||
} else if (chartType.equals("widget-linechart")) {
|
|
||||||
return WidgetLinechart.getQueryResult(params, result);
|
|
||||||
} else if (chartType.equals("widget-barlinechart")) {
|
|
||||||
return WidgetBarlinechart.getQueryResult(params, result);
|
|
||||||
} else if (chartType.equals("widget-piechart")) {
|
|
||||||
return WidgetPiechart.getQueryResult(params, result);
|
|
||||||
} else if (chartType.equals("widget-funnel")) {
|
|
||||||
return WidgetFunnel.getQueryResult(params, result);
|
|
||||||
} else if (chartType.equals("widget-table")) {
|
|
||||||
return WidgetTable.getQueryResult(params, result);
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,43 +0,0 @@
|
||||||
package org.jeecg.modules.generate;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import freemarker.core.Environment;
|
|
||||||
import org.jeecg.modules.generate.entity.Parameters;
|
|
||||||
import org.jeecg.modules.generate.util.HttpGet;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.net.InetAddress;
|
|
||||||
import java.net.UnknownHostException;
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 制作图标的数据
|
|
||||||
*/
|
|
||||||
public class ChartData {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询类
|
|
||||||
* 塞入接口数据查询对应的接口获取数据
|
|
||||||
* 参数有三个
|
|
||||||
* 1. 查询的数据类型,决定数据的处理
|
|
||||||
* 2. 查询的接口和参数,决定查询的数据
|
|
||||||
* 3. 查询的数据处理方式,决定数据的处理方式
|
|
||||||
*/
|
|
||||||
public static JSONObject getData(JSONObject params) {
|
|
||||||
Parameters parameters = Butler.getQueryParameters(params);
|
|
||||||
if (parameters == null) {
|
|
||||||
// 抛出异常
|
|
||||||
throw new RuntimeException("生成参数异常");
|
|
||||||
}
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
|
||||||
try {
|
|
||||||
HttpGet httpGet = new HttpGet();
|
|
||||||
jsonObject = httpGet.sendGet(params.get("url").toString(), parameters);
|
|
||||||
} catch (UnknownHostException e) {
|
|
||||||
throw new RuntimeException("网络连接异常");
|
|
||||||
}
|
|
||||||
// 处理得到的结果
|
|
||||||
return Butler.getQueryResult(params, jsonObject);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,52 +0,0 @@
|
||||||
package org.jeecg.modules.generate.core;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import org.jeecg.modules.generate.entity.Parameters;
|
|
||||||
import org.jeecg.modules.generate.entity.orderType;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所有数据处理的父类
|
|
||||||
*/
|
|
||||||
public class Widget {
|
|
||||||
/**
|
|
||||||
* 文本模式的分页和条数默认只有第一条
|
|
||||||
*
|
|
||||||
* @param params
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static Parameters getQueryParameters(JSONObject params) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static JSONObject getQueryResult(JSONObject params, JSONObject result) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 公共方法,用于处理superQueryParams
|
|
||||||
public static void inputSuperQueryParams(JSONObject params, Parameters Parameters) {
|
|
||||||
// 判断数据匹配参数是否为[]
|
|
||||||
JSONObject queryParam = params.getJSONObject("queryParam");
|
|
||||||
if (queryParam.getString("superQueryParams") == null || queryParam.getString("superQueryMatchType") == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!queryParam.getString("superQueryParams").isEmpty() && !queryParam.getString("superQueryMatchType").isEmpty()) {
|
|
||||||
Parameters.setSuperQueryParams(queryParam.get("superQueryParams").toString());
|
|
||||||
Parameters.setSuperQueryMatchType(queryParam.get("superQueryMatchType").toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void inputSort(JSONObject params, Parameters Parameters) {
|
|
||||||
// 判断是否需要排序,如果不需要则默认为createTime和desc
|
|
||||||
JSONObject chartRule = params.getJSONObject("chartRule");
|
|
||||||
JSONObject data = chartRule.getJSONObject("data");
|
|
||||||
if (data.get("sort").equals(true)) {
|
|
||||||
Parameters.setColumn(data.get("sortColumn").toString());
|
|
||||||
Parameters.setOrder(data.get("sortType").equals(true) ? orderType.asc : orderType.desc);
|
|
||||||
} else {
|
|
||||||
Parameters.setColumn("createTime");
|
|
||||||
Parameters.setOrder(orderType.desc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,52 +0,0 @@
|
||||||
package org.jeecg.modules.generate.core;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import org.jeecg.modules.generate.entity.Parameters;
|
|
||||||
|
|
||||||
public class WidgetBarchart extends Widget {
|
|
||||||
public static Parameters getQueryParameters(JSONObject params) {
|
|
||||||
Parameters Parameters = new Parameters();
|
|
||||||
int dataCount = params.getObject("chartRule", JSONObject.class).getJSONObject("data").getInteger("dataCount");
|
|
||||||
// 如果为0则设置分页为1000
|
|
||||||
// 塞入分页
|
|
||||||
Parameters.setPageNo(1);
|
|
||||||
Parameters.setPageSize(dataCount == 0 ? 1000 : dataCount);
|
|
||||||
// 塞入数据匹配参数
|
|
||||||
inputSuperQueryParams(params, Parameters);
|
|
||||||
inputSort(params, Parameters);
|
|
||||||
return Parameters;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static JSONObject getQueryResult(JSONObject params, JSONObject results) {
|
|
||||||
// 获取参数参数中的chartRule
|
|
||||||
JSONObject chartRule = params.getJSONObject("chartRule");
|
|
||||||
//获取参数data中的x和y轴字段,收集为list
|
|
||||||
JSONObject data = chartRule.getJSONObject("data");
|
|
||||||
String xAxis = data.get("xAxis").toString();
|
|
||||||
String yAxis = data.get("yAxis").toString();
|
|
||||||
JSONArray xAxisList = new JSONArray();
|
|
||||||
JSONArray yAxisList = new JSONArray();
|
|
||||||
// 获取结果中的records
|
|
||||||
JSONArray records = results.getJSONArray("records");
|
|
||||||
for (int i = 0; i < records.size(); i++) {
|
|
||||||
JSONObject record = records.getJSONObject(i);
|
|
||||||
xAxisList.add(record.get(xAxis));
|
|
||||||
yAxisList.add(record.get(yAxis));
|
|
||||||
}
|
|
||||||
|
|
||||||
JSONObject result = new JSONObject();
|
|
||||||
JSONObject dataResult = new JSONObject();
|
|
||||||
dataResult.put("xAxis", xAxisList);
|
|
||||||
dataResult.put("series", new JSONArray() {{
|
|
||||||
add(new JSONObject() {{
|
|
||||||
put("type", "bar");
|
|
||||||
put("name", yAxis);
|
|
||||||
put("data", yAxisList);
|
|
||||||
}});
|
|
||||||
}});
|
|
||||||
result.put("data", dataResult);
|
|
||||||
result.put("chartType", "widget-barchart");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,62 +0,0 @@
|
||||||
package org.jeecg.modules.generate.core;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import org.jeecg.modules.generate.entity.Parameters;
|
|
||||||
|
|
||||||
|
|
||||||
public class WidgetBarlinechart extends Widget{
|
|
||||||
public static Parameters getQueryParameters(JSONObject params) {
|
|
||||||
Parameters Parameters = new Parameters();
|
|
||||||
int dataCount = params.getObject("chartRule", JSONObject.class).getJSONObject("data").getInteger("dataCount");
|
|
||||||
// 如果为0则设置分页为1000
|
|
||||||
// 塞入分页
|
|
||||||
Parameters.setPageNo(1);
|
|
||||||
Parameters.setPageSize(dataCount == 0 ? 1000 : dataCount);
|
|
||||||
// 塞入数据匹配参数
|
|
||||||
inputSuperQueryParams(params, Parameters);
|
|
||||||
inputSort(params, Parameters);
|
|
||||||
return Parameters;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static JSONObject getQueryResult(JSONObject params, JSONObject results) {
|
|
||||||
// 获取参数参数中的chartRule
|
|
||||||
JSONObject chartRule = params.getJSONObject("chartRule");
|
|
||||||
//获取参数data中的x和y轴字段,收集为list
|
|
||||||
JSONObject data = chartRule.getJSONObject("data");
|
|
||||||
String xAxis = data.get("xAxis").toString();
|
|
||||||
// 柱线图分为了LineYAxis和BarYAxis
|
|
||||||
String barYAxis = data.get("BarYAxis").toString();
|
|
||||||
String LineYAxis = data.get("LineYAxis").toString();
|
|
||||||
JSONArray xAxisList = new JSONArray();
|
|
||||||
JSONArray barYAxisList = new JSONArray();
|
|
||||||
JSONArray yAxisList = new JSONArray();
|
|
||||||
// 获取结果中的records
|
|
||||||
JSONArray records = results.getJSONArray("records");
|
|
||||||
for (int i = 0; i < records.size(); i++) {
|
|
||||||
JSONObject record = records.getJSONObject(i);
|
|
||||||
xAxisList.add(record.get(xAxis));
|
|
||||||
barYAxisList.add(record.get(barYAxis));
|
|
||||||
yAxisList.add(record.get(LineYAxis));
|
|
||||||
}
|
|
||||||
|
|
||||||
JSONObject result = new JSONObject();
|
|
||||||
JSONObject dataResult = new JSONObject();
|
|
||||||
dataResult.put("xAxis", xAxisList);
|
|
||||||
JSONArray series = new JSONArray();
|
|
||||||
series.add(new JSONObject() {{
|
|
||||||
put("type", "bar");
|
|
||||||
put("name", barYAxis);
|
|
||||||
put("data", barYAxisList);
|
|
||||||
}});
|
|
||||||
series.add(new JSONObject() {{
|
|
||||||
put("type", "line");
|
|
||||||
put("name", LineYAxis);
|
|
||||||
put("data", yAxisList);
|
|
||||||
}});
|
|
||||||
dataResult.put("series", series);
|
|
||||||
result.put("data", dataResult);
|
|
||||||
result.put("chartType", "widget-barlinechart");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,51 +0,0 @@
|
||||||
package org.jeecg.modules.generate.core;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import org.jeecg.modules.generate.entity.Parameters;
|
|
||||||
|
|
||||||
public class WidgetFunnel extends Widget{
|
|
||||||
public static Parameters getQueryParameters(JSONObject params) {
|
|
||||||
Parameters Parameters = new Parameters();
|
|
||||||
int dataCount = params.getObject("chartRule", JSONObject.class).getJSONObject("data").getInteger("dataCount");
|
|
||||||
// 如果为0则设置分页为1000
|
|
||||||
// 塞入分页
|
|
||||||
Parameters.setPageNo(1);
|
|
||||||
Parameters.setPageSize(dataCount == 0 ? 1000 : dataCount);
|
|
||||||
// 塞入数据匹配参数
|
|
||||||
inputSuperQueryParams(params, Parameters);
|
|
||||||
inputSort(params, Parameters);
|
|
||||||
return Parameters;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static JSONObject getQueryResult(JSONObject params, JSONObject results) {
|
|
||||||
// 获取参数参数中的chartRule
|
|
||||||
JSONObject chartRule = params.getJSONObject("chartRule");
|
|
||||||
//获取参数data中的x和y轴字段,收集为list
|
|
||||||
JSONObject data = chartRule.getJSONObject("data");
|
|
||||||
String xAxis = data.get("xAxis").toString();
|
|
||||||
String yAxis = data.get("yAxis").toString();
|
|
||||||
JSONArray xAxisList = new JSONArray();
|
|
||||||
JSONArray yAxisList = new JSONArray();
|
|
||||||
// 获取结果中的records
|
|
||||||
JSONArray records = results.getJSONArray("records");
|
|
||||||
for (int i = 0; i < records.size(); i++) {
|
|
||||||
JSONObject record = records.getJSONObject(i);
|
|
||||||
xAxisList.add(record.get(xAxis));
|
|
||||||
yAxisList.add(record.get(yAxis));
|
|
||||||
}
|
|
||||||
|
|
||||||
JSONObject result = new JSONObject();
|
|
||||||
JSONArray dataResult = new JSONArray();
|
|
||||||
for (int i = 0; i < records.size(); i++) {
|
|
||||||
JSONObject record = records.getJSONObject(i);
|
|
||||||
JSONObject datas = new JSONObject();
|
|
||||||
datas.put("name", record.get(xAxis));
|
|
||||||
datas.put("value", record.get(yAxis));
|
|
||||||
dataResult.add(datas);
|
|
||||||
}
|
|
||||||
result.put("data", dataResult);
|
|
||||||
result.put("chartType", "widget-funnel");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,53 +0,0 @@
|
||||||
package org.jeecg.modules.generate.core;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import org.jeecg.modules.generate.entity.Parameters;
|
|
||||||
|
|
||||||
|
|
||||||
public class WidgetLinechart extends Widget{
|
|
||||||
public static Parameters getQueryParameters(JSONObject params) {
|
|
||||||
Parameters Parameters = new Parameters();
|
|
||||||
int dataCount = params.getObject("chartRule", JSONObject.class).getJSONObject("data").getInteger("dataCount");
|
|
||||||
// 如果为0则设置分页为1000
|
|
||||||
// 塞入分页
|
|
||||||
Parameters.setPageNo(1);
|
|
||||||
Parameters.setPageSize(dataCount == 0 ? 1000 : dataCount);
|
|
||||||
// 塞入数据匹配参数
|
|
||||||
inputSuperQueryParams(params, Parameters);
|
|
||||||
inputSort(params, Parameters);
|
|
||||||
return Parameters;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static JSONObject getQueryResult(JSONObject params, JSONObject results) {
|
|
||||||
// 获取参数参数中的chartRule
|
|
||||||
JSONObject chartRule = params.getJSONObject("chartRule");
|
|
||||||
//获取参数data中的x和y轴字段,收集为list
|
|
||||||
JSONObject data = chartRule.getJSONObject("data");
|
|
||||||
String xAxis = data.get("xAxis").toString();
|
|
||||||
String yAxis = data.get("yAxis").toString();
|
|
||||||
JSONArray xAxisList = new JSONArray();
|
|
||||||
JSONArray yAxisList = new JSONArray();
|
|
||||||
// 获取结果中的records
|
|
||||||
JSONArray records = results.getJSONArray("records");
|
|
||||||
for (int i = 0; i < records.size(); i++) {
|
|
||||||
JSONObject record = records.getJSONObject(i);
|
|
||||||
xAxisList.add(record.get(xAxis));
|
|
||||||
yAxisList.add(record.get(yAxis));
|
|
||||||
}
|
|
||||||
|
|
||||||
JSONObject result = new JSONObject();
|
|
||||||
JSONObject dataResult = new JSONObject();
|
|
||||||
dataResult.put("xAxis", xAxisList);
|
|
||||||
dataResult.put("series", new JSONArray() {{
|
|
||||||
add(new JSONObject() {{
|
|
||||||
put("type", "line");
|
|
||||||
put("name", yAxis);
|
|
||||||
put("data", yAxisList);
|
|
||||||
}});
|
|
||||||
}});
|
|
||||||
result.put("data", dataResult);
|
|
||||||
result.put("chartType", "widget-linechart");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,51 +0,0 @@
|
||||||
package org.jeecg.modules.generate.core;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import org.jeecg.modules.generate.entity.Parameters;
|
|
||||||
|
|
||||||
public class WidgetPiechart extends Widget{
|
|
||||||
public static Parameters getQueryParameters(JSONObject params) {
|
|
||||||
Parameters Parameters = new Parameters();
|
|
||||||
int dataCount = params.getObject("chartRule", JSONObject.class).getJSONObject("data").getInteger("dataCount");
|
|
||||||
// 如果为0则设置分页为1000
|
|
||||||
// 塞入分页
|
|
||||||
Parameters.setPageNo(1);
|
|
||||||
Parameters.setPageSize(dataCount == 0 ? 1000 : dataCount);
|
|
||||||
// 塞入数据匹配参数
|
|
||||||
inputSuperQueryParams(params, Parameters);
|
|
||||||
inputSort(params, Parameters);
|
|
||||||
return Parameters;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static JSONObject getQueryResult(JSONObject params, JSONObject results) {
|
|
||||||
// 获取参数参数中的chartRule
|
|
||||||
JSONObject chartRule = params.getJSONObject("chartRule");
|
|
||||||
//获取参数data中的x和y轴字段,收集为list
|
|
||||||
JSONObject data = chartRule.getJSONObject("data");
|
|
||||||
String xAxis = data.get("xAxis").toString();
|
|
||||||
String yAxis = data.get("yAxis").toString();
|
|
||||||
JSONArray xAxisList = new JSONArray();
|
|
||||||
JSONArray yAxisList = new JSONArray();
|
|
||||||
// 获取结果中的records
|
|
||||||
JSONArray records = results.getJSONArray("records");
|
|
||||||
for (int i = 0; i < records.size(); i++) {
|
|
||||||
JSONObject record = records.getJSONObject(i);
|
|
||||||
xAxisList.add(record.get(xAxis));
|
|
||||||
yAxisList.add(record.get(yAxis));
|
|
||||||
}
|
|
||||||
|
|
||||||
JSONObject result = new JSONObject();
|
|
||||||
JSONArray dataResult = new JSONArray();
|
|
||||||
for (int i = 0; i < records.size(); i++) {
|
|
||||||
JSONObject record = records.getJSONObject(i);
|
|
||||||
JSONObject datas = new JSONObject();
|
|
||||||
datas.put("name", record.get(xAxis));
|
|
||||||
datas.put("value", record.get(yAxis));
|
|
||||||
dataResult.add(datas);
|
|
||||||
}
|
|
||||||
result.put("data", dataResult);
|
|
||||||
result.put("chartType", "widget-piechart");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,36 +0,0 @@
|
||||||
package org.jeecg.modules.generate.core;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import org.jeecg.modules.generate.entity.Parameters;
|
|
||||||
|
|
||||||
public class WidgetTable extends Widget {
|
|
||||||
/**
|
|
||||||
* 文本模式的分页和条数默认只有第一条
|
|
||||||
*
|
|
||||||
* @param params
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static Parameters getQueryParameters(JSONObject params) {
|
|
||||||
Parameters Parameters = new Parameters();
|
|
||||||
int dataCount = params.getObject("chartRule", JSONObject.class).getJSONObject("data").getInteger("dataCount");
|
|
||||||
// 如果为0则设置分页为1000
|
|
||||||
// 塞入分页
|
|
||||||
Parameters.setPageNo(1);
|
|
||||||
Parameters.setPageSize(dataCount == 0 ? 1000 : dataCount);
|
|
||||||
// 塞入数据匹配参数
|
|
||||||
inputSuperQueryParams(params, Parameters);
|
|
||||||
inputSort(params, Parameters);
|
|
||||||
return Parameters;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static JSONObject getQueryResult(JSONObject params, JSONObject results) {
|
|
||||||
JSONObject result = new JSONObject();
|
|
||||||
// 塞入数据和图表类型
|
|
||||||
JSONArray records = results.getJSONArray("records");
|
|
||||||
result.put("data", records);
|
|
||||||
result.put("chartType", "widget-table");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,48 +0,0 @@
|
||||||
package org.jeecg.modules.generate.core;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import org.jeecg.modules.generate.entity.Parameters;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文本框类型
|
|
||||||
*/
|
|
||||||
public class WidgetText extends Widget {
|
|
||||||
/**
|
|
||||||
* 文本模式的分页和条数默认只有第一条
|
|
||||||
*
|
|
||||||
* @param params
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static Parameters getQueryParameters(JSONObject params) {
|
|
||||||
Parameters Parameters = new Parameters();
|
|
||||||
// 塞入分页
|
|
||||||
Parameters.setPageNo(1);
|
|
||||||
Parameters.setPageSize(1);
|
|
||||||
// 塞入数据匹配参数
|
|
||||||
inputSuperQueryParams(params, Parameters);
|
|
||||||
inputSort(params, Parameters);
|
|
||||||
return Parameters;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static JSONObject getQueryResult(JSONObject params, JSONObject results) {
|
|
||||||
// 获取参数参数中的chartRule
|
|
||||||
JSONObject chartRule = params.getJSONObject("chartRule");
|
|
||||||
//获取参数data中的column(查询字段)
|
|
||||||
JSONObject data = chartRule.getJSONObject("data");
|
|
||||||
String column = data.get("column").toString();
|
|
||||||
|
|
||||||
JSONObject result = new JSONObject();
|
|
||||||
// 塞入数据和图表类型
|
|
||||||
JSONArray records = results.getJSONArray("records");
|
|
||||||
JSONArray jsonArray = new JSONArray();
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
|
||||||
jsonObject.put("value", records.getJSONObject(0).get(column));
|
|
||||||
jsonArray.add(jsonObject);
|
|
||||||
|
|
||||||
result.put("data", jsonArray);
|
|
||||||
result.put("chartType", "widget-text");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
package org.jeecg.modules.generate.entity;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 这是查询接口需要用到的参数
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class Parameters {
|
|
||||||
// 排序字段
|
|
||||||
private String column;
|
|
||||||
// 排序方式
|
|
||||||
private orderType order;
|
|
||||||
// 分页数量
|
|
||||||
private int pageSize;
|
|
||||||
// 当前页
|
|
||||||
private int pageNo;
|
|
||||||
// 数据匹配模式
|
|
||||||
private String superQueryMatchType;
|
|
||||||
// 数据匹配参数
|
|
||||||
private String superQueryParams;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
// 把所有参数按照GET的方式拼接起来(如果superQueryMatchType为空,则模式和参数都不拼接)
|
|
||||||
String tempMatchType = this.superQueryMatchType == null ? "" : "&superQueryMatchType=" + this.superQueryMatchType;
|
|
||||||
String tempQueryParams = this.superQueryParams == null ? "" : "&superQueryParams=" + this.superQueryParams;
|
|
||||||
return "column=" + column + "&order=" + order + "&pageSize=" + pageSize + "&pageNo=" + pageNo + tempMatchType + tempQueryParams;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
package org.jeecg.modules.generate.entity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排序方式
|
|
||||||
*/
|
|
||||||
public enum orderType {
|
|
||||||
// 升序
|
|
||||||
asc,
|
|
||||||
// 降序
|
|
||||||
desc
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
package org.jeecg.modules.generate.entity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 数据匹配模式
|
|
||||||
*/
|
|
||||||
public enum superQueryMatchType {
|
|
||||||
// 或
|
|
||||||
or,
|
|
||||||
// 和
|
|
||||||
and
|
|
||||||
}
|
|
|
@ -1,40 +0,0 @@
|
||||||
package org.jeecg.modules.generate.util;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import org.jeecg.modules.generate.entity.Parameters;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
|
||||||
|
|
||||||
import java.net.InetAddress;
|
|
||||||
import java.net.UnknownHostException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网络查询类 Get请求
|
|
||||||
*/
|
|
||||||
public class HttpGet {
|
|
||||||
String ip = "";
|
|
||||||
int port = 3100;
|
|
||||||
/*
|
|
||||||
* 入参URL和请求头
|
|
||||||
*/
|
|
||||||
//
|
|
||||||
|
|
||||||
public HttpGet() throws UnknownHostException {
|
|
||||||
ip = InetAddress.getLocalHost().getHostAddress();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 发送请求,入参数为url和请求参数
|
|
||||||
public JSONObject sendGet(String url, Parameters parameters) {
|
|
||||||
url = getUrl(url);
|
|
||||||
RestTemplate restTemplate = new RestTemplate();
|
|
||||||
ResponseEntity<String> response = restTemplate.getForEntity(url + "?" + parameters.toString(), String.class);
|
|
||||||
JSONObject jsonObject = JSONObject.parseObject(response.getBody());
|
|
||||||
return jsonObject.getJSONObject("result");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 制作需要的url http://+ip+port+url
|
|
||||||
public String getUrl(String url) {
|
|
||||||
return "http://" + ip + ":" + port + "/jeecgboot/" + url;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
package org.jeecg.modules.mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
import org.jeecg.modules.entity.Achievement;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 成绩表
|
|
||||||
* @Author: jeecg-boot
|
|
||||||
* @Date: 2024-03-07
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
public interface AchievementMapper extends BaseMapper<Achievement> {
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
package org.jeecg.modules.mapper;
|
||||||
|
|
||||||
|
import org.jeecg.modules.entity.Cet_4;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: cet_4
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-03-26
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface Cet_4Mapper extends BaseMapper<Cet_4> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package org.jeecg.modules.mapper;
|
||||||
|
|
||||||
|
import org.jeecg.modules.entity.Cet_6;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: cet_6
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-03-26
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface Cet_6Mapper extends BaseMapper<Cet_6> {
|
||||||
|
|
||||||
|
}
|
|
@ -1,14 +0,0 @@
|
||||||
package org.jeecg.modules.mapper;
|
|
||||||
|
|
||||||
import org.jeecg.modules.entity.Generationdata;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 生成数据管理表
|
|
||||||
* @Author: jeecg-boot
|
|
||||||
* @Date: 2024-03-03
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
public interface GenerationdataMapper extends BaseMapper<Generationdata> {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
package org.jeecg.modules.mapper;
|
|
||||||
|
|
||||||
import org.jeecg.modules.entity.TxtMap;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 关键词
|
|
||||||
* @Author: jeecg-boot
|
|
||||||
* @Date: 2024-03-07
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
public interface TxtMapMapper extends BaseMapper<TxtMap> {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="org.jeecg.modules.mapper.TxtMapMapper">
|
<mapper namespace="org.jeecg.modules.mapper.Cet_4Mapper">
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="org.jeecg.modules.mapper.AchievementMapper">
|
<mapper namespace="org.jeecg.modules.mapper.Cet_6Mapper">
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="org.jeecg.modules.mapper.GenerationdataMapper">
|
|
||||||
|
|
||||||
</mapper>
|
|
|
@ -1,14 +0,0 @@
|
||||||
package org.jeecg.modules.service;
|
|
||||||
|
|
||||||
import org.jeecg.modules.entity.Achievement;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 成绩表
|
|
||||||
* @Author: jeecg-boot
|
|
||||||
* @Date: 2024-03-07
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
public interface IAchievementService extends IService<Achievement> {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,14 +1,14 @@
|
||||||
package org.jeecg.modules.service;
|
package org.jeecg.modules.service;
|
||||||
|
|
||||||
import org.jeecg.modules.entity.TxtMap;
|
import org.jeecg.modules.entity.Cet_4;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 关键词
|
* @Description: cet_4
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2024-03-07
|
* @Date: 2024-03-26
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
public interface ITxtMapService extends IService<TxtMap> {
|
public interface ICet_4Service extends IService<Cet_4> {
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package org.jeecg.modules.service;
|
||||||
|
|
||||||
|
import org.jeecg.modules.entity.Cet_6;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: cet_6
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-03-26
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface ICet_6Service extends IService<Cet_6> {
|
||||||
|
|
||||||
|
}
|
|
@ -1,19 +0,0 @@
|
||||||
package org.jeecg.modules.service;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import org.jeecg.modules.entity.Generationdata;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
|
|
||||||
import java.net.UnknownHostException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 生成数据管理表
|
|
||||||
* @Author: jeecg-boot
|
|
||||||
* @Date: 2024-03-03
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
public interface IGenerationdataService extends IService<Generationdata> {
|
|
||||||
// 通过id获取数据
|
|
||||||
public JSONObject getDataById(String id) throws UnknownHostException;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
package org.jeecg.modules.service.impl;
|
|
||||||
|
|
||||||
import org.jeecg.modules.entity.Achievement;
|
|
||||||
import org.jeecg.modules.mapper.AchievementMapper;
|
|
||||||
import org.jeecg.modules.service.IAchievementService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 成绩表
|
|
||||||
* @Author: jeecg-boot
|
|
||||||
* @Date: 2024-03-07
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class AchievementServiceImpl extends ServiceImpl<AchievementMapper, Achievement> implements IAchievementService {
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
package org.jeecg.modules.service.impl;
|
||||||
|
|
||||||
|
import org.jeecg.modules.entity.Cet_4;
|
||||||
|
import org.jeecg.modules.mapper.Cet_4Mapper;
|
||||||
|
import org.jeecg.modules.service.ICet_4Service;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: cet_4
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-03-26
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class Cet_4ServiceImpl extends ServiceImpl<Cet_4Mapper, Cet_4> implements ICet_4Service {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package org.jeecg.modules.service.impl;
|
||||||
|
|
||||||
|
import org.jeecg.modules.entity.Cet_6;
|
||||||
|
import org.jeecg.modules.mapper.Cet_6Mapper;
|
||||||
|
import org.jeecg.modules.service.ICet_6Service;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: cet_6
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-03-26
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class Cet_6ServiceImpl extends ServiceImpl<Cet_6Mapper, Cet_6> implements ICet_6Service {
|
||||||
|
|
||||||
|
}
|
|
@ -1,51 +0,0 @@
|
||||||
package org.jeecg.modules.service.impl;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import org.jeecg.modules.entity.Generationdata;
|
|
||||||
import org.jeecg.modules.generate.ChartData;
|
|
||||||
import org.jeecg.modules.mapper.GenerationdataMapper;
|
|
||||||
import org.jeecg.modules.service.IGenerationdataService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
|
|
||||||
import java.net.UnknownHostException;
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 生成数据管理表
|
|
||||||
* @Author: jeecg-boot
|
|
||||||
* @Date: 2024-03-03
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class GenerationdataServiceImpl extends ServiceImpl<GenerationdataMapper, Generationdata> implements IGenerationdataService {
|
|
||||||
// 通过id获取数据
|
|
||||||
public JSONObject getDataById(String id) throws UnknownHostException {
|
|
||||||
// 通过查询器查询id对应的数据
|
|
||||||
QueryWrapper<Generationdata> queryWrapper = new QueryWrapper<Generationdata>();
|
|
||||||
queryWrapper.eq("id", id);
|
|
||||||
Generationdata generationdata = this.getOne(queryWrapper);
|
|
||||||
// 如果查询为空则返回null
|
|
||||||
if (generationdata == null) {
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
|
||||||
jsonObject.put("data", "id异常,请检查数据是否正确");
|
|
||||||
return jsonObject;
|
|
||||||
}
|
|
||||||
// 将获取的chartRule和queryParam转换为json格式
|
|
||||||
|
|
||||||
JSONObject params = new JSONObject();
|
|
||||||
params.put("type", generationdata.getDatatype());
|
|
||||||
params.put("url", generationdata.getUrl());
|
|
||||||
params.put("chartRule", stringToJson(generationdata.getDatarules()));
|
|
||||||
params.put("queryParam", stringToJson(generationdata.getParameter()));
|
|
||||||
return ChartData.getData(params);
|
|
||||||
}
|
|
||||||
// 将字符串转为json格式
|
|
||||||
public JSONObject stringToJson(String str) {
|
|
||||||
return JSONObject.parseObject(str);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
package org.jeecg.modules.service.impl;
|
|
||||||
|
|
||||||
import org.jeecg.modules.entity.TxtMap;
|
|
||||||
import org.jeecg.modules.mapper.TxtMapMapper;
|
|
||||||
import org.jeecg.modules.service.ITxtMapService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 关键词
|
|
||||||
* @Author: jeecg-boot
|
|
||||||
* @Date: 2024-03-07
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class TxtMapServiceImpl extends ServiceImpl<TxtMapMapper, TxtMap> implements ITxtMapService {
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue