From 895bea27308499e1e09c9900b0607cd7e2f94146 Mon Sep 17 00:00:00 2001 From: lzx_win <2602107437@qq.com> Date: Thu, 5 Jun 2025 08:39:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E5=A4=8D=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/jeecg/config/shiro/ShiroConfig.java | 2 + .../api/controller/AppletCommentController.java | 4 +- .../api/controller/AppletIndexController.java | 9 +- .../api/controller/AppletOrderController.java | 2 + .../jeecg/api/service/AppletCommentService.java | 2 +- .../org/jeecg/api/service/AppletIndexService.java | 4 +- .../service/impl/AppletAchievementServiceImpl.java | 24 +-- .../api/service/impl/AppletCommentServiceImpl.java | 4 +- .../api/service/impl/AppletIndexServiceImpl.java | 21 ++- .../api/service/impl/AppletLoginServiceImpl.java | 1 - .../controller/CommonBannerController.java | 171 ++++++++++++++++++ .../modules/commonBanner/entity/CommonBanner.java | 62 +++++++ .../commonBanner/mapper/CommonBannerMapper.java | 17 ++ .../commonBanner/mapper/xml/CommonBannerMapper.xml | 5 + .../commonBanner/service/ICommonBannerService.java | 14 ++ .../service/impl/CommonBannerServiceImpl.java | 19 ++ .../modules/commonBanner/vue/CommonBannerList.vue | 184 +++++++++++++++++++ .../commonBanner/vue/modules/CommonBannerForm.vue | 114 ++++++++++++ .../vue/modules/CommonBannerModal.Style#Drawer.vue | 84 +++++++++ .../commonBanner/vue/modules/CommonBannerModal.vue | 60 +++++++ .../modules/commonBanner/vue3/CommonBanner.api.ts | 61 +++++++ .../modules/commonBanner/vue3/CommonBanner.data.ts | 46 +++++ .../modules/commonBanner/vue3/CommonBannerList.vue | 162 +++++++++++++++++ .../vue3/components/CommonBannerModal.vue | 58 ++++++ .../controller/CommonBookController.java | 171 ++++++++++++++++++ .../modules/commonBook/entity/CommonBook.java | 71 ++++++++ .../commonBook/mapper/CommonBookMapper.java | 17 ++ .../commonBook/mapper/xml/CommonBookMapper.xml | 5 + .../commonBook/service/ICommonBookService.java | 14 ++ .../service/impl/CommonBookServiceImpl.java | 19 ++ .../modules/commonBook/vue/CommonBookList.vue | 197 +++++++++++++++++++++ .../commonBook/vue/modules/CommonBookForm.vue | 124 +++++++++++++ .../vue/modules/CommonBookModal.Style#Drawer.vue | 84 +++++++++ .../commonBook/vue/modules/CommonBookModal.vue | 60 +++++++ .../modules/commonBook/vue3/CommonBook.api.ts | 61 +++++++ .../modules/commonBook/vue3/CommonBook.data.ts | 69 ++++++++ .../modules/commonBook/vue3/CommonBookList.vue | 162 +++++++++++++++++ .../commonBook/vue3/components/CommonBookModal.vue | 58 ++++++ .../controller/CommonConfigController.java | 171 ++++++++++++++++++ .../modules/commonConfig/entity/CommonConfig.java | 67 +++++++ .../commonConfig/mapper/CommonConfigMapper.java | 17 ++ .../commonConfig/mapper/xml/CommonConfigMapper.xml | 5 + .../commonConfig/service/ICommonConfigService.java | 14 ++ .../service/impl/CommonConfigServiceImpl.java | 19 ++ .../modules/commonConfig/vue/CommonConfigList.vue | 190 ++++++++++++++++++++ .../commonConfig/vue/modules/CommonConfigForm.vue | 119 +++++++++++++ .../vue/modules/CommonConfigModal.Style#Drawer.vue | 84 +++++++++ .../commonConfig/vue/modules/CommonConfigModal.vue | 60 +++++++ .../modules/commonConfig/vue3/CommonConfig.api.ts | 61 +++++++ .../modules/commonConfig/vue3/CommonConfig.data.ts | 56 ++++++ .../modules/commonConfig/vue3/CommonConfigList.vue | 162 +++++++++++++++++ .../vue3/components/CommonConfigModal.vue | 58 ++++++ .../controller/CommonNoticeController.java | 171 ++++++++++++++++++ .../modules/commonNotice/entity/CommonNotice.java | 66 +++++++ .../commonNotice/mapper/CommonNoticeMapper.java | 17 ++ .../commonNotice/mapper/xml/CommonNoticeMapper.xml | 5 + .../commonNotice/service/ICommonNoticeService.java | 14 ++ .../service/impl/CommonNoticeServiceImpl.java | 19 ++ .../modules/commonNotice/vue/CommonNoticeList.vue | 197 +++++++++++++++++++++ .../commonNotice/vue/modules/CommonNoticeForm.vue | 119 +++++++++++++ .../vue/modules/CommonNoticeModal.Style#Drawer.vue | 84 +++++++++ .../commonNotice/vue/modules/CommonNoticeModal.vue | 60 +++++++ .../modules/commonNotice/vue3/CommonNotice.api.ts | 61 +++++++ .../modules/commonNotice/vue3/CommonNotice.data.ts | 62 +++++++ .../modules/commonNotice/vue3/CommonNoticeList.vue | 162 +++++++++++++++++ .../vue3/components/CommonNoticeModal.vue | 58 ++++++ 66 files changed, 4391 insertions(+), 29 deletions(-) create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBanner/controller/CommonBannerController.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBanner/entity/CommonBanner.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBanner/mapper/CommonBannerMapper.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBanner/mapper/xml/CommonBannerMapper.xml create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBanner/service/ICommonBannerService.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBanner/service/impl/CommonBannerServiceImpl.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBanner/vue/CommonBannerList.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBanner/vue/modules/CommonBannerForm.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBanner/vue/modules/CommonBannerModal.Style#Drawer.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBanner/vue/modules/CommonBannerModal.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBanner/vue3/CommonBanner.api.ts create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBanner/vue3/CommonBanner.data.ts create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBanner/vue3/CommonBannerList.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBanner/vue3/components/CommonBannerModal.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBook/controller/CommonBookController.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBook/entity/CommonBook.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBook/mapper/CommonBookMapper.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBook/mapper/xml/CommonBookMapper.xml create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBook/service/ICommonBookService.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBook/service/impl/CommonBookServiceImpl.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBook/vue/CommonBookList.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBook/vue/modules/CommonBookForm.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBook/vue/modules/CommonBookModal.Style#Drawer.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBook/vue/modules/CommonBookModal.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBook/vue3/CommonBook.api.ts create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBook/vue3/CommonBook.data.ts create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBook/vue3/CommonBookList.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonBook/vue3/components/CommonBookModal.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonConfig/controller/CommonConfigController.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commonConfig/entity/CommonConfig.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commonConfig/mapper/CommonConfigMapper.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commonConfig/mapper/xml/CommonConfigMapper.xml create mode 100644 module-common/src/main/java/org/jeecg/modules/commonConfig/service/ICommonConfigService.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commonConfig/service/impl/CommonConfigServiceImpl.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commonConfig/vue/CommonConfigList.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonConfig/vue/modules/CommonConfigForm.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonConfig/vue/modules/CommonConfigModal.Style#Drawer.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonConfig/vue/modules/CommonConfigModal.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonConfig/vue3/CommonConfig.api.ts create mode 100644 module-common/src/main/java/org/jeecg/modules/commonConfig/vue3/CommonConfig.data.ts create mode 100644 module-common/src/main/java/org/jeecg/modules/commonConfig/vue3/CommonConfigList.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonConfig/vue3/components/CommonConfigModal.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonNotice/controller/CommonNoticeController.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commonNotice/entity/CommonNotice.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commonNotice/mapper/CommonNoticeMapper.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commonNotice/mapper/xml/CommonNoticeMapper.xml create mode 100644 module-common/src/main/java/org/jeecg/modules/commonNotice/service/ICommonNoticeService.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commonNotice/service/impl/CommonNoticeServiceImpl.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commonNotice/vue/CommonNoticeList.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonNotice/vue/modules/CommonNoticeForm.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonNotice/vue/modules/CommonNoticeModal.Style#Drawer.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonNotice/vue/modules/CommonNoticeModal.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonNotice/vue3/CommonNotice.api.ts create mode 100644 module-common/src/main/java/org/jeecg/modules/commonNotice/vue3/CommonNotice.data.ts create mode 100644 module-common/src/main/java/org/jeecg/modules/commonNotice/vue3/CommonNoticeList.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commonNotice/vue3/components/CommonNoticeModal.vue diff --git a/module-base/base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java b/module-base/base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java index ecfb237..65dfa5e 100644 --- a/module-base/base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java +++ b/module-base/base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java @@ -82,6 +82,8 @@ public class ShiroConfig { filterChainDefinitionMap.put("/my_comment/**", "anon"); filterChainDefinitionMap.put("/all_money/**", "anon"); filterChainDefinitionMap.put("/all_achievement/**", "anon"); + filterChainDefinitionMap.put("/my_order/**", "anon"); + diff --git a/module-common/src/main/java/org/jeecg/api/controller/AppletCommentController.java b/module-common/src/main/java/org/jeecg/api/controller/AppletCommentController.java index e9898f6..b61cefb 100644 --- a/module-common/src/main/java/org/jeecg/api/controller/AppletCommentController.java +++ b/module-common/src/main/java/org/jeecg/api/controller/AppletCommentController.java @@ -29,8 +29,8 @@ public class AppletCommentController { //查询我未读的评论列表 @ApiOperation(value="获取我的评论列表", notes="获取我的评论列表") @GetMapping(value = "/getMyCommentList") - public Result getMyCommentList(@RequestHeader("X-Access-Token") String token, PageBean pageBean) { - return appletCommentService.getMyCommentList(token, pageBean); + public Result getMyCommentList(@RequestHeader("X-Access-Token") String token,String type, PageBean pageBean) { + return appletCommentService.getMyCommentList(token,type, pageBean); } diff --git a/module-common/src/main/java/org/jeecg/api/controller/AppletIndexController.java b/module-common/src/main/java/org/jeecg/api/controller/AppletIndexController.java index 0c65a63..2f3ed8f 100644 --- a/module-common/src/main/java/org/jeecg/api/controller/AppletIndexController.java +++ b/module-common/src/main/java/org/jeecg/api/controller/AppletIndexController.java @@ -1,6 +1,7 @@ package org.jeecg.api.controller; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -62,8 +63,8 @@ public class AppletIndexController { //获取首页精品推荐小说列表带分页 @ApiOperation(value="获取首页精品推荐小说列表带分页", notes="获取首页精品推荐小说列表带分页") @GetMapping(value = "/getRecommendList") - public Result getRecommendList(){ - return appletIndexService.getRecommendList(); + public Result getRecommendList(String name,String shopCion,String shopClass, PageBean pageBean){ + return appletIndexService.getRecommendList(name,shopCion,shopClass, pageBean); } @@ -71,8 +72,8 @@ public class AppletIndexController { //获取首页最新小说列表带分页 @ApiOperation(value="获取首页最新小说列表带分页", notes="获取首页最新小说列表带分页") @GetMapping(value = "/getNewList") - public Result getNewList(PageBean pageBean){ - return appletIndexService.getNewList(pageBean); + public Result getNewList(String name,String shopCion,String shopClass, PageBean pageBean){ + return appletIndexService.getNewList(name,shopCion,shopClass, pageBean); } //获取书城区域列表 diff --git a/module-common/src/main/java/org/jeecg/api/controller/AppletOrderController.java b/module-common/src/main/java/org/jeecg/api/controller/AppletOrderController.java index 583afb7..1020a5a 100644 --- a/module-common/src/main/java/org/jeecg/api/controller/AppletOrderController.java +++ b/module-common/src/main/java/org/jeecg/api/controller/AppletOrderController.java @@ -29,6 +29,8 @@ public class AppletOrderController { return appletOrderService.getInteractionGiftList(pageBean); } + + //查询我的礼物包订单列表 @ApiOperation( value="查询我的礼物包订单列表", notes="查询我的礼物包订单列表") @GetMapping("/getMyGiftList") diff --git a/module-common/src/main/java/org/jeecg/api/service/AppletCommentService.java b/module-common/src/main/java/org/jeecg/api/service/AppletCommentService.java index 6eac9c1..7501da0 100644 --- a/module-common/src/main/java/org/jeecg/api/service/AppletCommentService.java +++ b/module-common/src/main/java/org/jeecg/api/service/AppletCommentService.java @@ -10,7 +10,7 @@ public interface AppletCommentService { Result getMyCommentNum(String token); //查询我未读的评论列表 - Result getMyCommentList(String token, PageBean pageBean); + Result getMyCommentList(String token,String type, PageBean pageBean); //根据书籍标识查询评论信息列表带分页 Result getCommentList(String bookId, PageBean pageBean); diff --git a/module-common/src/main/java/org/jeecg/api/service/AppletIndexService.java b/module-common/src/main/java/org/jeecg/api/service/AppletIndexService.java index 6215af2..47812ba 100644 --- a/module-common/src/main/java/org/jeecg/api/service/AppletIndexService.java +++ b/module-common/src/main/java/org/jeecg/api/service/AppletIndexService.java @@ -19,10 +19,10 @@ public interface AppletIndexService { Result getNoticeById(String id); // 获取首页精品推荐小说列表带分页 - Result getRecommendList(); + Result getRecommendList(String name,String shopCion,String shopClass, PageBean pageBean); // 获取首页最新小说列表带分页 - Result getNewList(PageBean pageBean); + Result getNewList(String name,String shopCion,String shopClass,PageBean pageBean); // 获取书城区域列表 Result getBookAreaList(); diff --git a/module-common/src/main/java/org/jeecg/api/service/impl/AppletAchievementServiceImpl.java b/module-common/src/main/java/org/jeecg/api/service/impl/AppletAchievementServiceImpl.java index 666bd71..19cf67e 100644 --- a/module-common/src/main/java/org/jeecg/api/service/impl/AppletAchievementServiceImpl.java +++ b/module-common/src/main/java/org/jeecg/api/service/impl/AppletAchievementServiceImpl.java @@ -41,17 +41,17 @@ public class AppletAchievementServiceImpl implements AppletAchievementService { @Override public Result setAchievementName(String token, CommonBookAchievementLog bookAchievementLog){ HanHaiMember member = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); - //书籍标识不能为空 - if(StringUtils.isEmpty(bookAchievementLog.getBookId())){ - return Result.error("书籍标识不能为空"); - } - //根据书籍标识查询书籍信息 - CommonShop commonShop = commonShopService.getById(bookAchievementLog.getBookId()); - if(commonShop==null){ - return Result.error("书籍不存在"); - } +// //书籍标识不能为空 +// if(StringUtils.isEmpty(bookAchievementLog.getBookId())){ +// return Result.error("书籍标识不能为空"); +// } +// //根据书籍标识查询书籍信息 +// CommonShop commonShop = commonShopService.getById(bookAchievementLog.getBookId()); +// if(commonShop==null){ +// return Result.error("书籍不存在"); +// } CommonBookAchievementLog one = commonBookAchievementLogService.lambdaQuery() - .eq(CommonBookAchievementLog::getBookId, bookAchievementLog.getBookId()) +// .eq(CommonBookAchievementLog::getBookId, bookAchievementLog.getBookId()) .eq(CommonBookAchievementLog::getUserId, member.getId()) .one(); if(one!=null){ @@ -59,7 +59,7 @@ public class AppletAchievementServiceImpl implements AppletAchievementService { commonBookAchievementLogService.save(bookAchievementLog); return Result.OK("修改成功"); }else{ - bookAchievementLog.setBookId(commonShop.getId()); +// bookAchievementLog.setBookId(commonShop.getId()); bookAchievementLog.setUserId(member.getId()); commonBookAchievementLogService.save(bookAchievementLog); return Result.OK("设置成功"); @@ -72,7 +72,7 @@ public class AppletAchievementServiceImpl implements AppletAchievementService { public Result getAchievement(String token, String bookId){ HanHaiMember member = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); CommonBookAchievementLog one = commonBookAchievementLogService.lambdaQuery() - .eq(CommonBookAchievementLog::getBookId, bookId) +// .eq(CommonBookAchievementLog::getBookId, bookId) .eq(CommonBookAchievementLog::getUserId, member.getId()) .one(); return Result.OK("查询成功",one); diff --git a/module-common/src/main/java/org/jeecg/api/service/impl/AppletCommentServiceImpl.java b/module-common/src/main/java/org/jeecg/api/service/impl/AppletCommentServiceImpl.java index b2f90d3..5589ef7 100644 --- a/module-common/src/main/java/org/jeecg/api/service/impl/AppletCommentServiceImpl.java +++ b/module-common/src/main/java/org/jeecg/api/service/impl/AppletCommentServiceImpl.java @@ -45,13 +45,13 @@ public class AppletCommentServiceImpl implements AppletCommentService { //查询我未读的评论列表 @Override - public Result getMyCommentList(String token, PageBean pageBean){ + public Result getMyCommentList(String token,String type, PageBean pageBean){ HanHaiMember member = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); Page page = new Page<>(pageBean.getPageNo(), pageBean.getPageSize()); IPage pageList = commonBookCommentService .lambdaQuery() .eq(CommonBookComment::getToUserId, member.getId()) - .eq(CommonBookComment::getIsLook, "N") + .eq(StringUtils.isNotBlank(type),CommonBookComment::getIsLook, type) .page(page); //创建一个新的集合 List commonBookComments = new ArrayList<>(); diff --git a/module-common/src/main/java/org/jeecg/api/service/impl/AppletIndexServiceImpl.java b/module-common/src/main/java/org/jeecg/api/service/impl/AppletIndexServiceImpl.java index a3fd5f8..86b0798 100644 --- a/module-common/src/main/java/org/jeecg/api/service/impl/AppletIndexServiceImpl.java +++ b/module-common/src/main/java/org/jeecg/api/service/impl/AppletIndexServiceImpl.java @@ -120,19 +120,30 @@ public class AppletIndexServiceImpl implements AppletIndexService { // 获取首页精品推荐小说列表带分页 @Override - public Result getRecommendList(){ - List commonBooks = commonShopService.lambdaQuery() + public Result getRecommendList(String name,String shopCion,String shopClass, PageBean pageBean){ + Page page = new Page<>(pageBean.getPageNo(),pageBean.getPageSize()); + IPage commonBooks = commonShopService + .lambdaQuery() + .like(StringUtils.isNotBlank(name),CommonShop::getName,name) + .eq(StringUtils.isNotBlank(shopCion),CommonShop::getShopCion,shopCion) + .eq(StringUtils.isNotBlank(shopClass),CommonShop::getShopClass,shopClass) .orderByDesc(CommonShop::getCreateTime) - .list(); + .page(page); return Result.OK("首页精品推荐小说列表",commonBooks); } // 获取首页最新小说列表带分页 @Override - public Result getNewList(PageBean pageBean){ + public Result getNewList(String name,String shopCion,String shopClass, PageBean pageBean){ Page page = new Page<>(pageBean.getPageNo(),pageBean.getPageSize()); - IPage commonBooks = commonShopService.page(page); + IPage commonBooks = commonShopService + .lambdaQuery() + .like(StringUtils.isNotBlank(name),CommonShop::getName,name) + .eq(StringUtils.isNotBlank(shopCion),CommonShop::getShopCion,shopCion) + .eq(StringUtils.isNotBlank(shopClass),CommonShop::getShopClass,shopClass) + .orderByDesc(CommonShop::getCreateTime) + .page(page); return Result.OK("首页最新小说列表",commonBooks); } diff --git a/module-common/src/main/java/org/jeecg/api/service/impl/AppletLoginServiceImpl.java b/module-common/src/main/java/org/jeecg/api/service/impl/AppletLoginServiceImpl.java index f3fed7f..33a936c 100644 --- a/module-common/src/main/java/org/jeecg/api/service/impl/AppletLoginServiceImpl.java +++ b/module-common/src/main/java/org/jeecg/api/service/impl/AppletLoginServiceImpl.java @@ -92,7 +92,6 @@ public class AppletLoginServiceImpl implements AppletLoginService { loginReq.setSession_key(sessionKey); member = new HanHaiMember(); member.setAppletOpenid(wxOpenid); - member.setNickName("裂变星"+System.currentTimeMillis()); member.setHeadImage(loginReq.getHeadimgurl()); // 生成token返回给小程序端 diff --git a/module-common/src/main/java/org/jeecg/modules/commonBanner/controller/CommonBannerController.java b/module-common/src/main/java/org/jeecg/modules/commonBanner/controller/CommonBannerController.java new file mode 100644 index 0000000..319253f --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBanner/controller/CommonBannerController.java @@ -0,0 +1,171 @@ +package org.jeecg.modules.commonBanner.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.commonBanner.entity.CommonBanner; +import org.jeecg.modules.commonBanner.service.ICommonBannerService; + +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: 2025-05-14 + * @Version: V1.0 + */ +@Api(tags="公共轮播图") +@RestController +@RequestMapping("/commonBanner/commonBanner") +@Slf4j +public class CommonBannerController extends JeecgController { + @Autowired + private ICommonBannerService commonBannerService; + + /** + * 分页列表查询 + * + * @param commonBanner + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "公共轮播图-分页列表查询") + @ApiOperation(value="公共轮播图-分页列表查询", notes="公共轮播图-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(CommonBanner commonBanner, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(commonBanner, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = commonBannerService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param commonBanner + * @return + */ + @AutoLog(value = "公共轮播图-添加") + @ApiOperation(value="公共轮播图-添加", notes="公共轮播图-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody CommonBanner commonBanner) { + commonBannerService.save(commonBanner); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param commonBanner + * @return + */ + @AutoLog(value = "公共轮播图-编辑") + @ApiOperation(value="公共轮播图-编辑", notes="公共轮播图-编辑") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody CommonBanner commonBanner) { + commonBannerService.updateById(commonBanner); + 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) { + commonBannerService.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.commonBannerService.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) { + CommonBanner commonBanner = commonBannerService.getById(id); + if(commonBanner==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(commonBanner); + } + + /** + * 导出excel + * + * @param request + * @param commonBanner + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, CommonBanner commonBanner) { + return super.exportXls(request, commonBanner, CommonBanner.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, CommonBanner.class); + } + +} diff --git a/module-common/src/main/java/org/jeecg/modules/commonBanner/entity/CommonBanner.java b/module-common/src/main/java/org/jeecg/modules/commonBanner/entity/CommonBanner.java new file mode 100644 index 0000000..8f2ace1 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBanner/entity/CommonBanner.java @@ -0,0 +1,62 @@ +package org.jeecg.modules.commonBanner.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: 2025-05-14 + * @Version: V1.0 + */ +@Data +@TableName("common_banner") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="common_banner对象", description="公共轮播图") +public class CommonBanner 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.String image; + /**标题*/ + @Excel(name = "标题", width = 15) + @ApiModelProperty(value = "标题") + private java.lang.String title; + /**说明*/ + @Excel(name = "说明", width = 15) + @ApiModelProperty(value = "说明") + private java.lang.String details; +} diff --git a/module-common/src/main/java/org/jeecg/modules/commonBanner/mapper/CommonBannerMapper.java b/module-common/src/main/java/org/jeecg/modules/commonBanner/mapper/CommonBannerMapper.java new file mode 100644 index 0000000..425d62c --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBanner/mapper/CommonBannerMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.commonBanner.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.commonBanner.entity.CommonBanner; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 公共轮播图 + * @Author: jeecg-boot + * @Date: 2025-05-14 + * @Version: V1.0 + */ +public interface CommonBannerMapper extends BaseMapper { + +} diff --git a/module-common/src/main/java/org/jeecg/modules/commonBanner/mapper/xml/CommonBannerMapper.xml b/module-common/src/main/java/org/jeecg/modules/commonBanner/mapper/xml/CommonBannerMapper.xml new file mode 100644 index 0000000..5fc1f08 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBanner/mapper/xml/CommonBannerMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonBanner/service/ICommonBannerService.java b/module-common/src/main/java/org/jeecg/modules/commonBanner/service/ICommonBannerService.java new file mode 100644 index 0000000..465a8b2 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBanner/service/ICommonBannerService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.commonBanner.service; + +import org.jeecg.modules.commonBanner.entity.CommonBanner; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 公共轮播图 + * @Author: jeecg-boot + * @Date: 2025-05-14 + * @Version: V1.0 + */ +public interface ICommonBannerService extends IService { + +} diff --git a/module-common/src/main/java/org/jeecg/modules/commonBanner/service/impl/CommonBannerServiceImpl.java b/module-common/src/main/java/org/jeecg/modules/commonBanner/service/impl/CommonBannerServiceImpl.java new file mode 100644 index 0000000..8b605a8 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBanner/service/impl/CommonBannerServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.commonBanner.service.impl; + +import org.jeecg.modules.commonBanner.entity.CommonBanner; +import org.jeecg.modules.commonBanner.mapper.CommonBannerMapper; +import org.jeecg.modules.commonBanner.service.ICommonBannerService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 公共轮播图 + * @Author: jeecg-boot + * @Date: 2025-05-14 + * @Version: V1.0 + */ +@Service +public class CommonBannerServiceImpl extends ServiceImpl implements ICommonBannerService { + +} diff --git a/module-common/src/main/java/org/jeecg/modules/commonBanner/vue/CommonBannerList.vue b/module-common/src/main/java/org/jeecg/modules/commonBanner/vue/CommonBannerList.vue new file mode 100644 index 0000000..81d9ffa --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBanner/vue/CommonBannerList.vue @@ -0,0 +1,184 @@ + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonBanner/vue/modules/CommonBannerForm.vue b/module-common/src/main/java/org/jeecg/modules/commonBanner/vue/modules/CommonBannerForm.vue new file mode 100644 index 0000000..28a979b --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBanner/vue/modules/CommonBannerForm.vue @@ -0,0 +1,114 @@ + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonBanner/vue/modules/CommonBannerModal.Style#Drawer.vue b/module-common/src/main/java/org/jeecg/modules/commonBanner/vue/modules/CommonBannerModal.Style#Drawer.vue new file mode 100644 index 0000000..496d1a0 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBanner/vue/modules/CommonBannerModal.Style#Drawer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonBanner/vue/modules/CommonBannerModal.vue b/module-common/src/main/java/org/jeecg/modules/commonBanner/vue/modules/CommonBannerModal.vue new file mode 100644 index 0000000..1e25f38 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBanner/vue/modules/CommonBannerModal.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonBanner/vue3/CommonBanner.api.ts b/module-common/src/main/java/org/jeecg/modules/commonBanner/vue3/CommonBanner.api.ts new file mode 100644 index 0000000..d99f1f2 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBanner/vue3/CommonBanner.api.ts @@ -0,0 +1,61 @@ +import {defHttp} from '/@/utils/http/axios'; +import {Modal} from 'ant-design-vue'; + +enum Api { + list = '/commonBanner/commonBanner/list', + save='/commonBanner/commonBanner/add', + edit='/commonBanner/commonBanner/edit', + deleteOne = '/commonBanner/commonBanner/delete', + deleteBatch = '/commonBanner/commonBanner/deleteBatch', + importExcel = '/commonBanner/commonBanner/importExcel', + exportXls = '/commonBanner/commonBanner/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/module-common/src/main/java/org/jeecg/modules/commonBanner/vue3/CommonBanner.data.ts b/module-common/src/main/java/org/jeecg/modules/commonBanner/vue3/CommonBanner.data.ts new file mode 100644 index 0000000..39405d3 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBanner/vue3/CommonBanner.data.ts @@ -0,0 +1,46 @@ +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: 'image', + customRender:render.renderAvatar, + }, + { + title: '标题', + align:"center", + dataIndex: 'title' + }, + { + title: '说明', + align:"center", + dataIndex: 'details' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '图片', + field: 'image', + component: 'JImageUpload', + componentProps:{ + }, + }, + { + label: '标题', + field: 'title', + component: 'Input', + }, + { + label: '说明', + field: 'details', + component: 'InputTextArea',//TODO 注意string转换问题 + }, +]; diff --git a/module-common/src/main/java/org/jeecg/modules/commonBanner/vue3/CommonBannerList.vue b/module-common/src/main/java/org/jeecg/modules/commonBanner/vue3/CommonBannerList.vue new file mode 100644 index 0000000..f04ad61 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBanner/vue3/CommonBannerList.vue @@ -0,0 +1,162 @@ + + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonBanner/vue3/components/CommonBannerModal.vue b/module-common/src/main/java/org/jeecg/modules/commonBanner/vue3/components/CommonBannerModal.vue new file mode 100644 index 0000000..b1c19f5 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBanner/vue3/components/CommonBannerModal.vue @@ -0,0 +1,58 @@ + + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonBook/controller/CommonBookController.java b/module-common/src/main/java/org/jeecg/modules/commonBook/controller/CommonBookController.java new file mode 100644 index 0000000..e060e2c --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBook/controller/CommonBookController.java @@ -0,0 +1,171 @@ +package org.jeecg.modules.commonBook.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.commonBook.entity.CommonBook; +import org.jeecg.modules.commonBook.service.ICommonBookService; + +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: 2025-05-14 + * @Version: V1.0 + */ +@Api(tags="书架信息") +@RestController +@RequestMapping("/commonBook/commonBook") +@Slf4j +public class CommonBookController extends JeecgController { + @Autowired + private ICommonBookService commonBookService; + + /** + * 分页列表查询 + * + * @param commonBook + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "书架信息-分页列表查询") + @ApiOperation(value="书架信息-分页列表查询", notes="书架信息-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(CommonBook commonBook, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(commonBook, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = commonBookService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param commonBook + * @return + */ + @AutoLog(value = "书架信息-添加") + @ApiOperation(value="书架信息-添加", notes="书架信息-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody CommonBook commonBook) { + commonBookService.save(commonBook); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param commonBook + * @return + */ + @AutoLog(value = "书架信息-编辑") + @ApiOperation(value="书架信息-编辑", notes="书架信息-编辑") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody CommonBook commonBook) { + commonBookService.updateById(commonBook); + 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) { + commonBookService.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.commonBookService.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) { + CommonBook commonBook = commonBookService.getById(id); + if(commonBook==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(commonBook); + } + + /** + * 导出excel + * + * @param request + * @param commonBook + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, CommonBook commonBook) { + return super.exportXls(request, commonBook, CommonBook.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, CommonBook.class); + } + +} diff --git a/module-common/src/main/java/org/jeecg/modules/commonBook/entity/CommonBook.java b/module-common/src/main/java/org/jeecg/modules/commonBook/entity/CommonBook.java new file mode 100644 index 0000000..d622d0a --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBook/entity/CommonBook.java @@ -0,0 +1,71 @@ +package org.jeecg.modules.commonBook.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: 2025-05-14 + * @Version: V1.0 + */ +@Data +@TableName("common_book") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="common_book对象", description="书架信息") +public class CommonBook 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.String userId; + /**类型*/ + @Excel(name = "类型", width = 15) + @ApiModelProperty(value = "类型") + private java.lang.String type; + /**书名*/ + @Excel(name = "书名", width = 15) + @ApiModelProperty(value = "书名") + private java.lang.String name; + /**主图*/ + @Excel(name = "主图", width = 15) + @ApiModelProperty(value = "主图") + private java.lang.String image; + /**关联小说*/ + @Excel(name = "关联小说", width = 15, dictTable = "common_shop", dicText = "name", dicCode = "id") + @Dict(dictTable = "common_shop", dicText = "name", dicCode = "id") + @ApiModelProperty(value = "关联小说") + private java.lang.String shopId; +} diff --git a/module-common/src/main/java/org/jeecg/modules/commonBook/mapper/CommonBookMapper.java b/module-common/src/main/java/org/jeecg/modules/commonBook/mapper/CommonBookMapper.java new file mode 100644 index 0000000..5360040 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBook/mapper/CommonBookMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.commonBook.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.commonBook.entity.CommonBook; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 书架信息 + * @Author: jeecg-boot + * @Date: 2025-05-14 + * @Version: V1.0 + */ +public interface CommonBookMapper extends BaseMapper { + +} diff --git a/module-common/src/main/java/org/jeecg/modules/commonBook/mapper/xml/CommonBookMapper.xml b/module-common/src/main/java/org/jeecg/modules/commonBook/mapper/xml/CommonBookMapper.xml new file mode 100644 index 0000000..30ff995 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBook/mapper/xml/CommonBookMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonBook/service/ICommonBookService.java b/module-common/src/main/java/org/jeecg/modules/commonBook/service/ICommonBookService.java new file mode 100644 index 0000000..983c694 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBook/service/ICommonBookService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.commonBook.service; + +import org.jeecg.modules.commonBook.entity.CommonBook; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 书架信息 + * @Author: jeecg-boot + * @Date: 2025-05-14 + * @Version: V1.0 + */ +public interface ICommonBookService extends IService { + +} diff --git a/module-common/src/main/java/org/jeecg/modules/commonBook/service/impl/CommonBookServiceImpl.java b/module-common/src/main/java/org/jeecg/modules/commonBook/service/impl/CommonBookServiceImpl.java new file mode 100644 index 0000000..fcc31dd --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBook/service/impl/CommonBookServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.commonBook.service.impl; + +import org.jeecg.modules.commonBook.entity.CommonBook; +import org.jeecg.modules.commonBook.mapper.CommonBookMapper; +import org.jeecg.modules.commonBook.service.ICommonBookService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 书架信息 + * @Author: jeecg-boot + * @Date: 2025-05-14 + * @Version: V1.0 + */ +@Service +public class CommonBookServiceImpl extends ServiceImpl implements ICommonBookService { + +} diff --git a/module-common/src/main/java/org/jeecg/modules/commonBook/vue/CommonBookList.vue b/module-common/src/main/java/org/jeecg/modules/commonBook/vue/CommonBookList.vue new file mode 100644 index 0000000..5f04ef3 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBook/vue/CommonBookList.vue @@ -0,0 +1,197 @@ + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonBook/vue/modules/CommonBookForm.vue b/module-common/src/main/java/org/jeecg/modules/commonBook/vue/modules/CommonBookForm.vue new file mode 100644 index 0000000..9b83673 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBook/vue/modules/CommonBookForm.vue @@ -0,0 +1,124 @@ + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonBook/vue/modules/CommonBookModal.Style#Drawer.vue b/module-common/src/main/java/org/jeecg/modules/commonBook/vue/modules/CommonBookModal.Style#Drawer.vue new file mode 100644 index 0000000..32d1430 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBook/vue/modules/CommonBookModal.Style#Drawer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonBook/vue/modules/CommonBookModal.vue b/module-common/src/main/java/org/jeecg/modules/commonBook/vue/modules/CommonBookModal.vue new file mode 100644 index 0000000..5e29382 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBook/vue/modules/CommonBookModal.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonBook/vue3/CommonBook.api.ts b/module-common/src/main/java/org/jeecg/modules/commonBook/vue3/CommonBook.api.ts new file mode 100644 index 0000000..9ef5ab4 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBook/vue3/CommonBook.api.ts @@ -0,0 +1,61 @@ +import {defHttp} from '/@/utils/http/axios'; +import {Modal} from 'ant-design-vue'; + +enum Api { + list = '/commonBook/commonBook/list', + save='/commonBook/commonBook/add', + edit='/commonBook/commonBook/edit', + deleteOne = '/commonBook/commonBook/delete', + deleteBatch = '/commonBook/commonBook/deleteBatch', + importExcel = '/commonBook/commonBook/importExcel', + exportXls = '/commonBook/commonBook/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/module-common/src/main/java/org/jeecg/modules/commonBook/vue3/CommonBook.data.ts b/module-common/src/main/java/org/jeecg/modules/commonBook/vue3/CommonBook.data.ts new file mode 100644 index 0000000..b5b5126 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBook/vue3/CommonBook.data.ts @@ -0,0 +1,69 @@ +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: 'userId' + }, + { + title: '类型', + align:"center", + dataIndex: 'type' + }, + { + title: '书名', + align:"center", + dataIndex: 'name' + }, + { + title: '主图', + align:"center", + dataIndex: 'image', + customRender:render.renderAvatar, + }, + { + title: '关联小说', + align:"center", + dataIndex: 'shopId_dictText' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '用户', + field: 'userId', + component: 'Input', + }, + { + label: '类型', + field: 'type', + component: 'Input', + }, + { + label: '书名', + field: 'name', + component: 'Input', + }, + { + label: '主图', + field: 'image', + component: 'JImageUpload', + componentProps:{ + }, + }, + { + label: '关联小说', + field: 'shopId', + component: 'JSearchSelect', + componentProps:{ + dict:"common_shop,name,id" + }, + }, +]; diff --git a/module-common/src/main/java/org/jeecg/modules/commonBook/vue3/CommonBookList.vue b/module-common/src/main/java/org/jeecg/modules/commonBook/vue3/CommonBookList.vue new file mode 100644 index 0000000..0e68c69 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBook/vue3/CommonBookList.vue @@ -0,0 +1,162 @@ + + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonBook/vue3/components/CommonBookModal.vue b/module-common/src/main/java/org/jeecg/modules/commonBook/vue3/components/CommonBookModal.vue new file mode 100644 index 0000000..7e49db0 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonBook/vue3/components/CommonBookModal.vue @@ -0,0 +1,58 @@ + + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonConfig/controller/CommonConfigController.java b/module-common/src/main/java/org/jeecg/modules/commonConfig/controller/CommonConfigController.java new file mode 100644 index 0000000..f50b1d4 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonConfig/controller/CommonConfigController.java @@ -0,0 +1,171 @@ +package org.jeecg.modules.commonConfig.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.commonConfig.entity.CommonConfig; +import org.jeecg.modules.commonConfig.service.ICommonConfigService; + +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: 2025-05-14 + * @Version: V1.0 + */ +@Api(tags="公共配置表") +@RestController +@RequestMapping("/commonConfig/commonConfig") +@Slf4j +public class CommonConfigController extends JeecgController { + @Autowired + private ICommonConfigService commonConfigService; + + /** + * 分页列表查询 + * + * @param commonConfig + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "公共配置表-分页列表查询") + @ApiOperation(value="公共配置表-分页列表查询", notes="公共配置表-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(CommonConfig commonConfig, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(commonConfig, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = commonConfigService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param commonConfig + * @return + */ + @AutoLog(value = "公共配置表-添加") + @ApiOperation(value="公共配置表-添加", notes="公共配置表-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody CommonConfig commonConfig) { + commonConfigService.save(commonConfig); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param commonConfig + * @return + */ + @AutoLog(value = "公共配置表-编辑") + @ApiOperation(value="公共配置表-编辑", notes="公共配置表-编辑") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody CommonConfig commonConfig) { + commonConfigService.updateById(commonConfig); + 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) { + commonConfigService.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.commonConfigService.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) { + CommonConfig commonConfig = commonConfigService.getById(id); + if(commonConfig==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(commonConfig); + } + + /** + * 导出excel + * + * @param request + * @param commonConfig + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, CommonConfig commonConfig) { + return super.exportXls(request, commonConfig, CommonConfig.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, CommonConfig.class); + } + +} diff --git a/module-common/src/main/java/org/jeecg/modules/commonConfig/entity/CommonConfig.java b/module-common/src/main/java/org/jeecg/modules/commonConfig/entity/CommonConfig.java new file mode 100644 index 0000000..c6a1571 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonConfig/entity/CommonConfig.java @@ -0,0 +1,67 @@ +package org.jeecg.modules.commonConfig.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: 2025-05-14 + * @Version: V1.0 + */ +@Data +@TableName("common_config") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="common_config对象", description="公共配置表") +public class CommonConfig 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.String keyName; + /**说明*/ + @Excel(name = "说明", width = 15) + @ApiModelProperty(value = "说明") + private java.lang.String keyValue; + /**内容*/ + @Excel(name = "内容", width = 15) + @ApiModelProperty(value = "内容") + private java.lang.String keyContent; + /**类型*/ + @Excel(name = "类型", width = 15, dicCode = "common_config_type") + @Dict(dicCode = "common_config_type") + @ApiModelProperty(value = "类型") + private java.lang.Integer type; +} diff --git a/module-common/src/main/java/org/jeecg/modules/commonConfig/mapper/CommonConfigMapper.java b/module-common/src/main/java/org/jeecg/modules/commonConfig/mapper/CommonConfigMapper.java new file mode 100644 index 0000000..ff70420 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonConfig/mapper/CommonConfigMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.commonConfig.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.commonConfig.entity.CommonConfig; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 公共配置表 + * @Author: jeecg-boot + * @Date: 2025-05-14 + * @Version: V1.0 + */ +public interface CommonConfigMapper extends BaseMapper { + +} diff --git a/module-common/src/main/java/org/jeecg/modules/commonConfig/mapper/xml/CommonConfigMapper.xml b/module-common/src/main/java/org/jeecg/modules/commonConfig/mapper/xml/CommonConfigMapper.xml new file mode 100644 index 0000000..045f19c --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonConfig/mapper/xml/CommonConfigMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonConfig/service/ICommonConfigService.java b/module-common/src/main/java/org/jeecg/modules/commonConfig/service/ICommonConfigService.java new file mode 100644 index 0000000..6e544a3 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonConfig/service/ICommonConfigService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.commonConfig.service; + +import org.jeecg.modules.commonConfig.entity.CommonConfig; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 公共配置表 + * @Author: jeecg-boot + * @Date: 2025-05-14 + * @Version: V1.0 + */ +public interface ICommonConfigService extends IService { + +} diff --git a/module-common/src/main/java/org/jeecg/modules/commonConfig/service/impl/CommonConfigServiceImpl.java b/module-common/src/main/java/org/jeecg/modules/commonConfig/service/impl/CommonConfigServiceImpl.java new file mode 100644 index 0000000..5830d5c --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonConfig/service/impl/CommonConfigServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.commonConfig.service.impl; + +import org.jeecg.modules.commonConfig.entity.CommonConfig; +import org.jeecg.modules.commonConfig.mapper.CommonConfigMapper; +import org.jeecg.modules.commonConfig.service.ICommonConfigService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 公共配置表 + * @Author: jeecg-boot + * @Date: 2025-05-14 + * @Version: V1.0 + */ +@Service +public class CommonConfigServiceImpl extends ServiceImpl implements ICommonConfigService { + +} diff --git a/module-common/src/main/java/org/jeecg/modules/commonConfig/vue/CommonConfigList.vue b/module-common/src/main/java/org/jeecg/modules/commonConfig/vue/CommonConfigList.vue new file mode 100644 index 0000000..c1fad50 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonConfig/vue/CommonConfigList.vue @@ -0,0 +1,190 @@ + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonConfig/vue/modules/CommonConfigForm.vue b/module-common/src/main/java/org/jeecg/modules/commonConfig/vue/modules/CommonConfigForm.vue new file mode 100644 index 0000000..4c9556c --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonConfig/vue/modules/CommonConfigForm.vue @@ -0,0 +1,119 @@ + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonConfig/vue/modules/CommonConfigModal.Style#Drawer.vue b/module-common/src/main/java/org/jeecg/modules/commonConfig/vue/modules/CommonConfigModal.Style#Drawer.vue new file mode 100644 index 0000000..767ae9a --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonConfig/vue/modules/CommonConfigModal.Style#Drawer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonConfig/vue/modules/CommonConfigModal.vue b/module-common/src/main/java/org/jeecg/modules/commonConfig/vue/modules/CommonConfigModal.vue new file mode 100644 index 0000000..a4b0829 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonConfig/vue/modules/CommonConfigModal.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonConfig/vue3/CommonConfig.api.ts b/module-common/src/main/java/org/jeecg/modules/commonConfig/vue3/CommonConfig.api.ts new file mode 100644 index 0000000..122a60c --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonConfig/vue3/CommonConfig.api.ts @@ -0,0 +1,61 @@ +import {defHttp} from '/@/utils/http/axios'; +import {Modal} from 'ant-design-vue'; + +enum Api { + list = '/commonConfig/commonConfig/list', + save='/commonConfig/commonConfig/add', + edit='/commonConfig/commonConfig/edit', + deleteOne = '/commonConfig/commonConfig/delete', + deleteBatch = '/commonConfig/commonConfig/deleteBatch', + importExcel = '/commonConfig/commonConfig/importExcel', + exportXls = '/commonConfig/commonConfig/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/module-common/src/main/java/org/jeecg/modules/commonConfig/vue3/CommonConfig.data.ts b/module-common/src/main/java/org/jeecg/modules/commonConfig/vue3/CommonConfig.data.ts new file mode 100644 index 0000000..3dfb2fc --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonConfig/vue3/CommonConfig.data.ts @@ -0,0 +1,56 @@ +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: 'keyName' + }, + { + title: '说明', + align:"center", + dataIndex: 'keyValue' + }, + { + title: '内容', + align:"center", + dataIndex: 'keyContent' + }, + { + title: '类型', + align:"center", + dataIndex: 'type_dictText' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '标识', + field: 'keyName', + component: 'Input', + }, + { + label: '说明', + field: 'keyValue', + component: 'Input', + }, + { + label: '内容', + field: 'keyContent', + component: 'Input', + }, + { + label: '类型', + field: 'type', + component: 'JDictSelectTag', + componentProps:{ + dictCode:"common_config_type" + }, + }, +]; diff --git a/module-common/src/main/java/org/jeecg/modules/commonConfig/vue3/CommonConfigList.vue b/module-common/src/main/java/org/jeecg/modules/commonConfig/vue3/CommonConfigList.vue new file mode 100644 index 0000000..68dcabf --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonConfig/vue3/CommonConfigList.vue @@ -0,0 +1,162 @@ + + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonConfig/vue3/components/CommonConfigModal.vue b/module-common/src/main/java/org/jeecg/modules/commonConfig/vue3/components/CommonConfigModal.vue new file mode 100644 index 0000000..f9425b0 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonConfig/vue3/components/CommonConfigModal.vue @@ -0,0 +1,58 @@ + + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonNotice/controller/CommonNoticeController.java b/module-common/src/main/java/org/jeecg/modules/commonNotice/controller/CommonNoticeController.java new file mode 100644 index 0000000..504aece --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonNotice/controller/CommonNoticeController.java @@ -0,0 +1,171 @@ +package org.jeecg.modules.commonNotice.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.commonNotice.entity.CommonNotice; +import org.jeecg.modules.commonNotice.service.ICommonNoticeService; + +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: 2025-05-14 + * @Version: V1.0 + */ +@Api(tags="公告") +@RestController +@RequestMapping("/commonNotice/commonNotice") +@Slf4j +public class CommonNoticeController extends JeecgController { + @Autowired + private ICommonNoticeService commonNoticeService; + + /** + * 分页列表查询 + * + * @param commonNotice + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "公告-分页列表查询") + @ApiOperation(value="公告-分页列表查询", notes="公告-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(CommonNotice commonNotice, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(commonNotice, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = commonNoticeService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param commonNotice + * @return + */ + @AutoLog(value = "公告-添加") + @ApiOperation(value="公告-添加", notes="公告-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody CommonNotice commonNotice) { + commonNoticeService.save(commonNotice); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param commonNotice + * @return + */ + @AutoLog(value = "公告-编辑") + @ApiOperation(value="公告-编辑", notes="公告-编辑") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody CommonNotice commonNotice) { + commonNoticeService.updateById(commonNotice); + 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) { + commonNoticeService.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.commonNoticeService.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) { + CommonNotice commonNotice = commonNoticeService.getById(id); + if(commonNotice==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(commonNotice); + } + + /** + * 导出excel + * + * @param request + * @param commonNotice + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, CommonNotice commonNotice) { + return super.exportXls(request, commonNotice, CommonNotice.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, CommonNotice.class); + } + +} diff --git a/module-common/src/main/java/org/jeecg/modules/commonNotice/entity/CommonNotice.java b/module-common/src/main/java/org/jeecg/modules/commonNotice/entity/CommonNotice.java new file mode 100644 index 0000000..7190b68 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonNotice/entity/CommonNotice.java @@ -0,0 +1,66 @@ +package org.jeecg.modules.commonNotice.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: 2025-05-14 + * @Version: V1.0 + */ +@Data +@TableName("common_notice") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="common_notice对象", description="公告") +public class CommonNotice 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.String icon; + /**公告标题*/ + @Excel(name = "公告标题", width = 15) + @ApiModelProperty(value = "公告标题") + private java.lang.String title; + /**公告小标题*/ + @Excel(name = "公告小标题", width = 15) + @ApiModelProperty(value = "公告小标题") + private java.lang.String titleText; + /**公共内容*/ + @Excel(name = "公共内容", width = 15) + @ApiModelProperty(value = "公共内容") + private java.lang.String details; +} diff --git a/module-common/src/main/java/org/jeecg/modules/commonNotice/mapper/CommonNoticeMapper.java b/module-common/src/main/java/org/jeecg/modules/commonNotice/mapper/CommonNoticeMapper.java new file mode 100644 index 0000000..de2583a --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonNotice/mapper/CommonNoticeMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.commonNotice.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.commonNotice.entity.CommonNotice; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 公告 + * @Author: jeecg-boot + * @Date: 2025-05-14 + * @Version: V1.0 + */ +public interface CommonNoticeMapper extends BaseMapper { + +} diff --git a/module-common/src/main/java/org/jeecg/modules/commonNotice/mapper/xml/CommonNoticeMapper.xml b/module-common/src/main/java/org/jeecg/modules/commonNotice/mapper/xml/CommonNoticeMapper.xml new file mode 100644 index 0000000..e86d39d --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonNotice/mapper/xml/CommonNoticeMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonNotice/service/ICommonNoticeService.java b/module-common/src/main/java/org/jeecg/modules/commonNotice/service/ICommonNoticeService.java new file mode 100644 index 0000000..eeb06b8 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonNotice/service/ICommonNoticeService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.commonNotice.service; + +import org.jeecg.modules.commonNotice.entity.CommonNotice; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 公告 + * @Author: jeecg-boot + * @Date: 2025-05-14 + * @Version: V1.0 + */ +public interface ICommonNoticeService extends IService { + +} diff --git a/module-common/src/main/java/org/jeecg/modules/commonNotice/service/impl/CommonNoticeServiceImpl.java b/module-common/src/main/java/org/jeecg/modules/commonNotice/service/impl/CommonNoticeServiceImpl.java new file mode 100644 index 0000000..701fa9a --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonNotice/service/impl/CommonNoticeServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.commonNotice.service.impl; + +import org.jeecg.modules.commonNotice.entity.CommonNotice; +import org.jeecg.modules.commonNotice.mapper.CommonNoticeMapper; +import org.jeecg.modules.commonNotice.service.ICommonNoticeService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 公告 + * @Author: jeecg-boot + * @Date: 2025-05-14 + * @Version: V1.0 + */ +@Service +public class CommonNoticeServiceImpl extends ServiceImpl implements ICommonNoticeService { + +} diff --git a/module-common/src/main/java/org/jeecg/modules/commonNotice/vue/CommonNoticeList.vue b/module-common/src/main/java/org/jeecg/modules/commonNotice/vue/CommonNoticeList.vue new file mode 100644 index 0000000..b41a85d --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonNotice/vue/CommonNoticeList.vue @@ -0,0 +1,197 @@ + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonNotice/vue/modules/CommonNoticeForm.vue b/module-common/src/main/java/org/jeecg/modules/commonNotice/vue/modules/CommonNoticeForm.vue new file mode 100644 index 0000000..55487c9 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonNotice/vue/modules/CommonNoticeForm.vue @@ -0,0 +1,119 @@ + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonNotice/vue/modules/CommonNoticeModal.Style#Drawer.vue b/module-common/src/main/java/org/jeecg/modules/commonNotice/vue/modules/CommonNoticeModal.Style#Drawer.vue new file mode 100644 index 0000000..4da6d64 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonNotice/vue/modules/CommonNoticeModal.Style#Drawer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonNotice/vue/modules/CommonNoticeModal.vue b/module-common/src/main/java/org/jeecg/modules/commonNotice/vue/modules/CommonNoticeModal.vue new file mode 100644 index 0000000..7f3a7ee --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonNotice/vue/modules/CommonNoticeModal.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonNotice/vue3/CommonNotice.api.ts b/module-common/src/main/java/org/jeecg/modules/commonNotice/vue3/CommonNotice.api.ts new file mode 100644 index 0000000..10b521d --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonNotice/vue3/CommonNotice.api.ts @@ -0,0 +1,61 @@ +import {defHttp} from '/@/utils/http/axios'; +import {Modal} from 'ant-design-vue'; + +enum Api { + list = '/commonNotice/commonNotice/list', + save='/commonNotice/commonNotice/add', + edit='/commonNotice/commonNotice/edit', + deleteOne = '/commonNotice/commonNotice/delete', + deleteBatch = '/commonNotice/commonNotice/deleteBatch', + importExcel = '/commonNotice/commonNotice/importExcel', + exportXls = '/commonNotice/commonNotice/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/module-common/src/main/java/org/jeecg/modules/commonNotice/vue3/CommonNotice.data.ts b/module-common/src/main/java/org/jeecg/modules/commonNotice/vue3/CommonNotice.data.ts new file mode 100644 index 0000000..edfbee1 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonNotice/vue3/CommonNotice.data.ts @@ -0,0 +1,62 @@ +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: 'createTime' + }, + { + title: '公告图标', + align:"center", + dataIndex: 'icon', + customRender:render.renderAvatar, + }, + { + title: '公告标题', + align:"center", + dataIndex: 'title' + }, + { + title: '公告小标题', + align:"center", + dataIndex: 'titleText' + }, + { + title: '公共内容', + align:"center", + dataIndex: 'details', + slots: { customRender: 'htmlSlot' }, + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '公告图标', + field: 'icon', + component: 'JImageUpload', + componentProps:{ + }, + }, + { + label: '公告标题', + field: 'title', + component: 'Input', + }, + { + label: '公告小标题', + field: 'titleText', + component: 'InputTextArea',//TODO 注意string转换问题 + }, + { + label: '公共内容', + field: 'details', + component: 'JCodeEditor', //TODO String后缀暂未添加 + }, +]; diff --git a/module-common/src/main/java/org/jeecg/modules/commonNotice/vue3/CommonNoticeList.vue b/module-common/src/main/java/org/jeecg/modules/commonNotice/vue3/CommonNoticeList.vue new file mode 100644 index 0000000..3956157 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonNotice/vue3/CommonNoticeList.vue @@ -0,0 +1,162 @@ + + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonNotice/vue3/components/CommonNoticeModal.vue b/module-common/src/main/java/org/jeecg/modules/commonNotice/vue3/components/CommonNoticeModal.vue new file mode 100644 index 0000000..f20283c --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commonNotice/vue3/components/CommonNoticeModal.vue @@ -0,0 +1,58 @@ + + + + + \ No newline at end of file