From 38c07f1fd5cec992bef152fcee167d113e23bdf4 Mon Sep 17 00:00:00 2001 From: zxf <604804177@qq.com> Date: Tue, 18 Jul 2023 16:17:34 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A3=8E=E6=A0=BC=E7=B1=BB=E5=9E=8B=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/wheel/ZxfmnTypeController.java | 104 ++++++ .../java/com/zxf/system/domain/ZxfmnType.java | 135 +++++++ .../zxf/system/mapper/ZxfmnTypeMapper.java | 62 ++++ .../zxf/system/service/IZxfmnTypeService.java | 62 ++++ .../service/impl/ZxfmnTypeServiceImpl.java | 95 +++++ .../mapper/wheel/ZxfmnTypeMapper.xml | 86 +++++ zxf-ui/src/api/wheel/type.js | 44 +++ zxf-ui/src/views/wheel/type/index.vue | 335 ++++++++++++++++++ 8 files changed, 923 insertions(+) create mode 100644 zxf-admin/src/main/java/com/zxf/web/controller/wheel/ZxfmnTypeController.java create mode 100644 zxf-system/src/main/java/com/zxf/system/domain/ZxfmnType.java create mode 100644 zxf-system/src/main/java/com/zxf/system/mapper/ZxfmnTypeMapper.java create mode 100644 zxf-system/src/main/java/com/zxf/system/service/IZxfmnTypeService.java create mode 100644 zxf-system/src/main/java/com/zxf/system/service/impl/ZxfmnTypeServiceImpl.java create mode 100644 zxf-system/src/main/resources/mapper/wheel/ZxfmnTypeMapper.xml create mode 100644 zxf-ui/src/api/wheel/type.js create mode 100644 zxf-ui/src/views/wheel/type/index.vue diff --git a/zxf-admin/src/main/java/com/zxf/web/controller/wheel/ZxfmnTypeController.java b/zxf-admin/src/main/java/com/zxf/web/controller/wheel/ZxfmnTypeController.java new file mode 100644 index 0000000..5044425 --- /dev/null +++ b/zxf-admin/src/main/java/com/zxf/web/controller/wheel/ZxfmnTypeController.java @@ -0,0 +1,104 @@ +package com.zxf.web.controller.wheel; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zxf.common.utils.poi.ExcelUtil; +import com.zxf.system.domain.ZxfmnType; +import com.zxf.system.service.IZxfmnTypeService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.zxf.common.annotation.Log; +import com.zxf.common.core.controller.BaseController; +import com.zxf.common.core.domain.AjaxResult; +import com.zxf.common.enums.BusinessType; + + +/** + * typeController + * + * @author zxf + * @date 2023-07-18 + */ +@RestController +@RequestMapping("/wheel/type") +public class ZxfmnTypeController extends BaseController +{ + @Autowired + private IZxfmnTypeService zxfmnTypeService; + + /** + * 查询type列表 + */ + @PreAuthorize("@ss.hasPermi('wheel:type:list')") + @GetMapping("/list") + public AjaxResult list(ZxfmnType zxfmnType) + { + List list = zxfmnTypeService.selectZxfmnTypeList(zxfmnType); + return success(list); + } + + /** + * 导出type列表 + */ + @PreAuthorize("@ss.hasPermi('wheel:type:export')") + @Log(title = "type", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ZxfmnType zxfmnType) + { + List list = zxfmnTypeService.selectZxfmnTypeList(zxfmnType); + ExcelUtil util = new ExcelUtil(ZxfmnType.class); + util.exportExcel(response, list, "type数据"); + } + + /** + * 获取type详细信息 + */ + @PreAuthorize("@ss.hasPermi('wheel:type:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(zxfmnTypeService.selectZxfmnTypeById(id)); + } + + /** + * 新增type + */ + @PreAuthorize("@ss.hasPermi('wheel:type:add')") + @Log(title = "type", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ZxfmnType zxfmnType) + { + return toAjax(zxfmnTypeService.insertZxfmnType(zxfmnType)); + } + + /** + * 修改type + */ + @PreAuthorize("@ss.hasPermi('wheel:type:edit')") + @Log(title = "type", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ZxfmnType zxfmnType) + { + return toAjax(zxfmnTypeService.updateZxfmnType(zxfmnType)); + } + + /** + * 删除type + */ + @PreAuthorize("@ss.hasPermi('wheel:type:remove')") + @Log(title = "type", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(zxfmnTypeService.deleteZxfmnTypeByIds(ids)); + } +} diff --git a/zxf-system/src/main/java/com/zxf/system/domain/ZxfmnType.java b/zxf-system/src/main/java/com/zxf/system/domain/ZxfmnType.java new file mode 100644 index 0000000..e48eb80 --- /dev/null +++ b/zxf-system/src/main/java/com/zxf/system/domain/ZxfmnType.java @@ -0,0 +1,135 @@ +package com.zxf.system.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zxf.common.annotation.Excel; +import com.zxf.common.core.domain.TreeEntity; + +/** + * type对象 zxfmn_type + * + * @author zxf + * @date 2023-07-18 + */ +public class ZxfmnType extends TreeEntity +{ + private static final long serialVersionUID = 1L; + + /** */ + private Long id; + + /** 父id */ + @Excel(name = "父id") + private Long pId; + + /** 描述名称 */ + @Excel(name = "描述名称") + private String name; + + /** 图片地址 */ + @Excel(name = "图片地址") + private String imgUrl; + + /** 是否一级 1 是 2 不是 */ + @Excel(name = "是否一级 1 是 2 不是") + private String isP; + + /** 是否展示 1 展示 2 不展示 */ + @Excel(name = "是否展示 1 展示 2 不展示") + private String isFlag; + + /** 扩展 */ + @Excel(name = "扩展") + private String extend; + + /** 二级富文本信息 */ + @Excel(name = "二级富文本信息") + private String richText; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setpId(Long pId) + { + this.pId = pId; + } + + public Long getpId() + { + return pId; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setImgUrl(String imgUrl) + { + this.imgUrl = imgUrl; + } + + public String getImgUrl() + { + return imgUrl; + } + public void setIsP(String isP) + { + this.isP = isP; + } + + public String getIsP() + { + return isP; + } + public void setIsFlag(String isFlag) + { + this.isFlag = isFlag; + } + + public String getIsFlag() + { + return isFlag; + } + public void setExtend(String extend) + { + this.extend = extend; + } + + public String getExtend() + { + return extend; + } + public void setRichText(String richText) + { + this.richText = richText; + } + + public String getRichText() + { + return richText; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("pId", getpId()) + .append("name", getName()) + .append("imgUrl", getImgUrl()) + .append("isP", getIsP()) + .append("isFlag", getIsFlag()) + .append("extend", getExtend()) + .append("richText", getRichText()) + .toString(); + } +} diff --git a/zxf-system/src/main/java/com/zxf/system/mapper/ZxfmnTypeMapper.java b/zxf-system/src/main/java/com/zxf/system/mapper/ZxfmnTypeMapper.java new file mode 100644 index 0000000..bc39ba0 --- /dev/null +++ b/zxf-system/src/main/java/com/zxf/system/mapper/ZxfmnTypeMapper.java @@ -0,0 +1,62 @@ +package com.zxf.system.mapper; + +import java.util.List; + +import com.zxf.system.domain.ZxfmnType; + +/** + * typeMapper接口 + * + * @author zxf + * @date 2023-07-18 + */ +public interface ZxfmnTypeMapper +{ + /** + * 查询type + * + * @param id type主键 + * @return type + */ + public ZxfmnType selectZxfmnTypeById(Long id); + + /** + * 查询type列表 + * + * @param zxfmnType type + * @return type集合 + */ + public List selectZxfmnTypeList(ZxfmnType zxfmnType); + + /** + * 新增type + * + * @param zxfmnType type + * @return 结果 + */ + public int insertZxfmnType(ZxfmnType zxfmnType); + + /** + * 修改type + * + * @param zxfmnType type + * @return 结果 + */ + public int updateZxfmnType(ZxfmnType zxfmnType); + + /** + * 删除type + * + * @param id type主键 + * @return 结果 + */ + public int deleteZxfmnTypeById(Long id); + + /** + * 批量删除type + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteZxfmnTypeByIds(Long[] ids); +} diff --git a/zxf-system/src/main/java/com/zxf/system/service/IZxfmnTypeService.java b/zxf-system/src/main/java/com/zxf/system/service/IZxfmnTypeService.java new file mode 100644 index 0000000..e509154 --- /dev/null +++ b/zxf-system/src/main/java/com/zxf/system/service/IZxfmnTypeService.java @@ -0,0 +1,62 @@ +package com.zxf.system.service; + +import com.zxf.system.domain.ZxfmnType; + +import java.util.List; + +/** + * typeService接口 + * + * @author zxf + * @date 2023-07-18 + */ +public interface IZxfmnTypeService +{ + /** + * 查询type + * + * @param id type主键 + * @return type + */ + public ZxfmnType selectZxfmnTypeById(Long id); + + /** + * 查询type列表 + * + * @param zxfmnType type + * @return type集合 + */ + public List selectZxfmnTypeList(ZxfmnType zxfmnType); + + /** + * 新增type + * + * @param zxfmnType type + * @return 结果 + */ + public int insertZxfmnType(ZxfmnType zxfmnType); + + /** + * 修改type + * + * @param zxfmnType type + * @return 结果 + */ + public int updateZxfmnType(ZxfmnType zxfmnType); + + /** + * 批量删除type + * + * @param ids 需要删除的type主键集合 + * @return 结果 + */ + public int deleteZxfmnTypeByIds(Long[] ids); + + /** + * 删除type信息 + * + * @param id type主键 + * @return 结果 + */ + public int deleteZxfmnTypeById(Long id); +} diff --git a/zxf-system/src/main/java/com/zxf/system/service/impl/ZxfmnTypeServiceImpl.java b/zxf-system/src/main/java/com/zxf/system/service/impl/ZxfmnTypeServiceImpl.java new file mode 100644 index 0000000..901ba1e --- /dev/null +++ b/zxf-system/src/main/java/com/zxf/system/service/impl/ZxfmnTypeServiceImpl.java @@ -0,0 +1,95 @@ +package com.zxf.system.service.impl; + +import java.util.List; + +import com.zxf.system.domain.ZxfmnType; +import com.zxf.system.mapper.ZxfmnTypeMapper; +import com.zxf.system.service.IZxfmnTypeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * typeService业务层处理 + * + * @author zxf + * @date 2023-07-18 + */ +@Service +public class ZxfmnTypeServiceImpl implements IZxfmnTypeService +{ + @Autowired + private ZxfmnTypeMapper zxfmnTypeMapper; + + /** + * 查询type + * + * @param id type主键 + * @return type + */ + @Override + public ZxfmnType selectZxfmnTypeById(Long id) + { + return zxfmnTypeMapper.selectZxfmnTypeById(id); + } + + /** + * 查询type列表 + * + * @param zxfmnType type + * @return type + */ + @Override + public List selectZxfmnTypeList(ZxfmnType zxfmnType) + { + return zxfmnTypeMapper.selectZxfmnTypeList(zxfmnType); + } + + /** + * 新增type + * + * @param zxfmnType type + * @return 结果 + */ + @Override + public int insertZxfmnType(ZxfmnType zxfmnType) + { + return zxfmnTypeMapper.insertZxfmnType(zxfmnType); + } + + /** + * 修改type + * + * @param zxfmnType type + * @return 结果 + */ + @Override + public int updateZxfmnType(ZxfmnType zxfmnType) + { + return zxfmnTypeMapper.updateZxfmnType(zxfmnType); + } + + /** + * 批量删除type + * + * @param ids 需要删除的type主键 + * @return 结果 + */ + @Override + public int deleteZxfmnTypeByIds(Long[] ids) + { + return zxfmnTypeMapper.deleteZxfmnTypeByIds(ids); + } + + /** + * 删除type信息 + * + * @param id type主键 + * @return 结果 + */ + @Override + public int deleteZxfmnTypeById(Long id) + { + return zxfmnTypeMapper.deleteZxfmnTypeById(id); + } +} diff --git a/zxf-system/src/main/resources/mapper/wheel/ZxfmnTypeMapper.xml b/zxf-system/src/main/resources/mapper/wheel/ZxfmnTypeMapper.xml new file mode 100644 index 0000000..493c74c --- /dev/null +++ b/zxf-system/src/main/resources/mapper/wheel/ZxfmnTypeMapper.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + select id, p_id, name, img_url, is_p, is_flag, extend, rich_text from zxfmn_type + + + + + + + + insert into zxfmn_type + + p_id, + name, + img_url, + is_p, + is_flag, + extend, + rich_text, + + + #{pId}, + #{name}, + #{imgUrl}, + #{isP}, + #{isFlag}, + #{extend}, + #{richText}, + + + + + update zxfmn_type + + p_id = #{pId}, + name = #{name}, + img_url = #{imgUrl}, + is_p = #{isP}, + is_flag = #{isFlag}, + extend = #{extend}, + rich_text = #{richText}, + + where id = #{id} + + + + delete from zxfmn_type where id = #{id} + + + + delete from zxfmn_type where id in + + #{id} + + + \ No newline at end of file diff --git a/zxf-ui/src/api/wheel/type.js b/zxf-ui/src/api/wheel/type.js new file mode 100644 index 0000000..ef72f1c --- /dev/null +++ b/zxf-ui/src/api/wheel/type.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询type列表 +export function listType(query) { + return request({ + url: '/wheel/type/list', + method: 'get', + params: query + }) +} + +// 查询type详细 +export function getType(id) { + return request({ + url: '/wheel/type/' + id, + method: 'get' + }) +} + +// 新增type +export function addType(data) { + return request({ + url: '/wheel/type', + method: 'post', + data: data + }) +} + +// 修改type +export function updateType(data) { + return request({ + url: '/wheel/type', + method: 'put', + data: data + }) +} + +// 删除type +export function delType(id) { + return request({ + url: '/wheel/type/' + id, + method: 'delete' + }) +} diff --git a/zxf-ui/src/views/wheel/type/index.vue b/zxf-ui/src/views/wheel/type/index.vue new file mode 100644 index 0000000..3500df3 --- /dev/null +++ b/zxf-ui/src/views/wheel/type/index.vue @@ -0,0 +1,335 @@ + + +