From b450267a5849bcd4f30ef91d9116fe0a78567a4a Mon Sep 17 00:00:00 2001 From: Aug <17674666882@163.com> Date: Mon, 28 Oct 2024 17:33:41 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=B5=8B=E8=AF=95=E7=BB=8F=E7=BA=AC?= =?UTF-8?q?=E5=BA=A6=E8=8E=B7=E5=8F=96-=E8=A1=A8=E5=8D=95=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/MytestUtilsController.java | 171 ++++++++++++++++++++ .../modules/mytestUtils/entity/MytestUtils.java | 58 +++++++ .../mytestUtils/mapper/MytestUtilsMapper.java | 17 ++ .../mytestUtils/mapper/xml/MytestUtilsMapper.xml | 5 + .../mytestUtils/service/IMytestUtilsService.java | 14 ++ .../service/impl/MytestUtilsServiceImpl.java | 19 +++ .../modules/mytestUtils/vue/MytestUtilsList.vue | 177 +++++++++++++++++++++ .../mytestUtils/vue/modules/MytestUtilsForm.vue | 109 +++++++++++++ .../vue/modules/MytestUtilsModal.Style#Drawer.vue | 84 ++++++++++ .../mytestUtils/vue/modules/MytestUtilsModal.vue | 60 +++++++ .../modules/mytestUtils/vue3/MytestUtils.api.ts | 61 +++++++ .../modules/mytestUtils/vue3/MytestUtils.data.ts | 33 ++++ .../modules/mytestUtils/vue3/MytestUtilsList.vue | 162 +++++++++++++++++++ .../vue3/components/MytestUtilsModal.vue | 58 +++++++ 14 files changed, 1028 insertions(+) create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/controller/MytestUtilsController.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/entity/MytestUtils.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/mapper/MytestUtilsMapper.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/mapper/xml/MytestUtilsMapper.xml create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/service/IMytestUtilsService.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/service/impl/MytestUtilsServiceImpl.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue/MytestUtilsList.vue create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue/modules/MytestUtilsForm.vue create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue/modules/MytestUtilsModal.Style#Drawer.vue create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue/modules/MytestUtilsModal.vue create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue3/MytestUtils.api.ts create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue3/MytestUtils.data.ts create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue3/MytestUtilsList.vue create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue3/components/MytestUtilsModal.vue diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/controller/MytestUtilsController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/controller/MytestUtilsController.java new file mode 100644 index 0000000..cbcb480 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/controller/MytestUtilsController.java @@ -0,0 +1,171 @@ +package org.jeecg.modules.mytestUtils.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.mytestUtils.entity.MytestUtils; +import org.jeecg.modules.mytestUtils.service.IMytestUtilsService; + +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-10-28 + * @Version: V1.0 + */ +@Api(tags="功能测试表") +@RestController +@RequestMapping("/mytestUtils/mytestUtils") +@Slf4j +public class MytestUtilsController extends JeecgController { + @Autowired + private IMytestUtilsService mytestUtilsService; + + /** + * 分页列表查询 + * + * @param mytestUtils + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "功能测试表-分页列表查询") + @ApiOperation(value="功能测试表-分页列表查询", notes="功能测试表-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(MytestUtils mytestUtils, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(mytestUtils, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = mytestUtilsService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param mytestUtils + * @return + */ + @AutoLog(value = "功能测试表-添加") + @ApiOperation(value="功能测试表-添加", notes="功能测试表-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody MytestUtils mytestUtils) { + mytestUtilsService.save(mytestUtils); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param mytestUtils + * @return + */ + @AutoLog(value = "功能测试表-编辑") + @ApiOperation(value="功能测试表-编辑", notes="功能测试表-编辑") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody MytestUtils mytestUtils) { + mytestUtilsService.updateById(mytestUtils); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "功能测试表-通过id删除") + @ApiOperation(value="功能测试表-通过id删除", notes="功能测试表-通过id删除") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + mytestUtilsService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "功能测试表-批量删除") + @ApiOperation(value="功能测试表-批量删除", notes="功能测试表-批量删除") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.mytestUtilsService.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 queryById(@RequestParam(name="id",required=true) String id) { + MytestUtils mytestUtils = mytestUtilsService.getById(id); + if(mytestUtils==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(mytestUtils); + } + + /** + * 导出excel + * + * @param request + * @param mytestUtils + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, MytestUtils mytestUtils) { + return super.exportXls(request, mytestUtils, MytestUtils.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, MytestUtils.class); + } + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/entity/MytestUtils.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/entity/MytestUtils.java new file mode 100644 index 0000000..65da6d8 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/entity/MytestUtils.java @@ -0,0 +1,58 @@ +package org.jeecg.modules.mytestUtils.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 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-10-28 + * @Version: V1.0 + */ +@Data +@TableName("mytest_utils") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="mytest_utils对象", description="功能测试表") +public class MytestUtils 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; + /**创建日期*/ + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**经度*/ + @Excel(name = "经度", width = 15) + @ApiModelProperty(value = "经度") + private java.lang.Double longitude; + /**纬度*/ + @Excel(name = "纬度", width = 15) + @ApiModelProperty(value = "纬度") + private java.lang.Double latitude; +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/mapper/MytestUtilsMapper.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/mapper/MytestUtilsMapper.java new file mode 100644 index 0000000..c2e3687 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/mapper/MytestUtilsMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.mytestUtils.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.mytestUtils.entity.MytestUtils; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 功能测试表 + * @Author: jeecg-boot + * @Date: 2024-10-28 + * @Version: V1.0 + */ +public interface MytestUtilsMapper extends BaseMapper { + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/mapper/xml/MytestUtilsMapper.xml b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/mapper/xml/MytestUtilsMapper.xml new file mode 100644 index 0000000..fae767b --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/mapper/xml/MytestUtilsMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/service/IMytestUtilsService.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/service/IMytestUtilsService.java new file mode 100644 index 0000000..bde4808 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/service/IMytestUtilsService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.mytestUtils.service; + +import org.jeecg.modules.mytestUtils.entity.MytestUtils; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 功能测试表 + * @Author: jeecg-boot + * @Date: 2024-10-28 + * @Version: V1.0 + */ +public interface IMytestUtilsService extends IService { + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/service/impl/MytestUtilsServiceImpl.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/service/impl/MytestUtilsServiceImpl.java new file mode 100644 index 0000000..43eedc9 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/service/impl/MytestUtilsServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.mytestUtils.service.impl; + +import org.jeecg.modules.mytestUtils.entity.MytestUtils; +import org.jeecg.modules.mytestUtils.mapper.MytestUtilsMapper; +import org.jeecg.modules.mytestUtils.service.IMytestUtilsService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 功能测试表 + * @Author: jeecg-boot + * @Date: 2024-10-28 + * @Version: V1.0 + */ +@Service +public class MytestUtilsServiceImpl extends ServiceImpl implements IMytestUtilsService { + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue/MytestUtilsList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue/MytestUtilsList.vue new file mode 100644 index 0000000..6f9ed07 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue/MytestUtilsList.vue @@ -0,0 +1,177 @@ + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue/modules/MytestUtilsForm.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue/modules/MytestUtilsForm.vue new file mode 100644 index 0000000..30db8e6 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue/modules/MytestUtilsForm.vue @@ -0,0 +1,109 @@ + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue/modules/MytestUtilsModal.Style#Drawer.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue/modules/MytestUtilsModal.Style#Drawer.vue new file mode 100644 index 0000000..0e89a92 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue/modules/MytestUtilsModal.Style#Drawer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue/modules/MytestUtilsModal.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue/modules/MytestUtilsModal.vue new file mode 100644 index 0000000..5cfd951 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue/modules/MytestUtilsModal.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue3/MytestUtils.api.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue3/MytestUtils.api.ts new file mode 100644 index 0000000..23abde8 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue3/MytestUtils.api.ts @@ -0,0 +1,61 @@ +import {defHttp} from '/@/utils/http/axios'; +import {Modal} from 'ant-design-vue'; + +enum Api { + list = '/mytestUtils/mytestUtils/list', + save='/mytestUtils/mytestUtils/add', + edit='/mytestUtils/mytestUtils/edit', + deleteOne = '/mytestUtils/mytestUtils/delete', + deleteBatch = '/mytestUtils/mytestUtils/deleteBatch', + importExcel = '/mytestUtils/mytestUtils/importExcel', + exportXls = '/mytestUtils/mytestUtils/exportXls', +} +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; +/** + * 列表接口 + * @param params + */ +export const list = (params) => + defHttp.get({url: Api.list, params}); + +/** + * 删除单个 + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} +/** + * 批量删除 + * @param params + */ +export const batchDelete = (params, handleSuccess) => { + Modal.confirm({ + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} +/** + * 保存或者更新 + * @param params + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({url: url, params}); +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue3/MytestUtils.data.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue3/MytestUtils.data.ts new file mode 100644 index 0000000..457e67d --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue3/MytestUtils.data.ts @@ -0,0 +1,33 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '经度', + align:"center", + dataIndex: 'longitude' + }, + { + title: '纬度', + align:"center", + dataIndex: 'latitude' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '经度', + field: 'longitude', + component: 'InputNumber', + }, + { + label: '纬度', + field: 'latitude', + component: 'InputNumber', + }, +]; diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue3/MytestUtilsList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue3/MytestUtilsList.vue new file mode 100644 index 0000000..e3372bd --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue3/MytestUtilsList.vue @@ -0,0 +1,162 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue3/components/MytestUtilsModal.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue3/components/MytestUtilsModal.vue new file mode 100644 index 0000000..a0151d2 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/mytestUtils/vue3/components/MytestUtilsModal.vue @@ -0,0 +1,58 @@ + + + + + \ No newline at end of file