From 86688647cd1ada4bcfa9e7557ca9df4b98f9263b Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Sun, 22 Jun 2025 19:16:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E8=AE=A2=E9=98=85=E7=AB=A0?= =?UTF-8?q?=E8=8A=82=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jeecg/api/controller/AppletBookController.java | 7 - .../api/controller/AppletIndexController.java | 4 - .../api/service/impl/AppletIndexServiceImpl.java | 36 ++-- .../api/service/impl/AppletMyBookServiceImpl.java | 13 +- .../api/service/impl/AppletOrderServiceImpl.java | 107 ++++++++-- .../CommonChapterSubscribeController.java | 171 ++++++++++++++++ .../entity/CommonChapterSubscribe.java | 79 ++++++++ .../mapper/CommonChapterSubscribeMapper.java | 17 ++ .../mapper/xml/CommonChapterSubscribeMapper.xml | 5 + .../service/ICommonChapterSubscribeService.java | 14 ++ .../impl/CommonChapterSubscribeServiceImpl.java | 19 ++ .../vue/CommonChapterSubscribeList.vue | 223 +++++++++++++++++++++ .../vue/modules/CommonChapterSubscribeForm.vue | 124 ++++++++++++ .../CommonChapterSubscribeModal.Style#Drawer.vue | 84 ++++++++ .../vue/modules/CommonChapterSubscribeModal.vue | 60 ++++++ .../vue3/CommonChapterSubscribe.api.ts | 61 ++++++ .../vue3/CommonChapterSubscribe.data.ts | 102 ++++++++++ .../vue3/CommonChapterSubscribeList.vue | 162 +++++++++++++++ .../components/CommonChapterSubscribeModal.vue | 58 ++++++ .../commonMoneyLog/entity/CommonMoneyLog.java | 8 +- .../commonShop/service/ICommonShopService.java | 1 - .../service/impl/CommonShopServiceImpl.java | 1 - 22 files changed, 1313 insertions(+), 43 deletions(-) create mode 100644 module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/controller/CommonChapterSubscribeController.java create mode 100644 module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/entity/CommonChapterSubscribe.java create mode 100644 module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/mapper/CommonChapterSubscribeMapper.java create mode 100644 module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/mapper/xml/CommonChapterSubscribeMapper.xml create mode 100644 module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/service/ICommonChapterSubscribeService.java create mode 100644 module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/service/impl/CommonChapterSubscribeServiceImpl.java create mode 100644 module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue/CommonChapterSubscribeList.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue/modules/CommonChapterSubscribeForm.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue/modules/CommonChapterSubscribeModal.Style#Drawer.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue/modules/CommonChapterSubscribeModal.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue3/CommonChapterSubscribe.api.ts create mode 100644 module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue3/CommonChapterSubscribe.data.ts create mode 100644 module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue3/CommonChapterSubscribeList.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue3/components/CommonChapterSubscribeModal.vue diff --git a/module-common/src/main/java/org/jeecg/api/controller/AppletBookController.java b/module-common/src/main/java/org/jeecg/api/controller/AppletBookController.java index 4db1c04..06318d8 100644 --- a/module-common/src/main/java/org/jeecg/api/controller/AppletBookController.java +++ b/module-common/src/main/java/org/jeecg/api/controller/AppletBookController.java @@ -40,13 +40,6 @@ public class AppletBookController { return appletBookService.saveOrUpdateReadBook(token, commonBook); } - - - - - - - //增加我的书架阅读记录 @ApiOperation(value="增加我的书架记录", notes="增加我的书架阅读记录") @PostMapping(value = "/addReadBook") 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 2f3ed8f..ae8c355 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 @@ -106,7 +106,6 @@ public class AppletIndexController { return appletIndexService.vote(token,bookId,num); } - //根据书本标识获取书本目录列表 @ApiOperation(value="根据书本标识获取书本目录列表", notes="根据书本标识获取书本目录列表") @GetMapping(value = "/getBookCatalogList") @@ -115,7 +114,6 @@ public class AppletIndexController { } - //根据目录查询章节小说信息明细 @ApiOperation(value="根据目录查询章节小说信息明细", notes="根据目录查询章节小说信息明细") @GetMapping(value = "/getBookCatalogDetail") @@ -125,8 +123,6 @@ public class AppletIndexController { - - //获取亲密度排行版 @ApiOperation(value="获取亲密度排行版", notes="获取亲密度排行版") @GetMapping(value = "/getIntimacyRankList") 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 29aaf2c..803eed2 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 @@ -134,6 +134,13 @@ public class AppletIndexServiceImpl implements AppletIndexService { .eq(CommonShop::getToolStatus,1) .orderByDesc(CommonShop::getCreateTime) .page(page); + + //添加作者 + commonBooks.getRecords().forEach(book -> { + HanHaiMember member = hanHaiMemberService.getById(book.getUserId()); + book.setAuthor(member.getName()); + }); + return Result.OK("首页精品推荐小说列表",commonBooks); } @@ -150,6 +157,14 @@ public class AppletIndexServiceImpl implements AppletIndexService { .eq(CommonShop::getToolStatus,1) .orderByDesc(CommonShop::getCreateTime) .page(page); + + + //添加作者 + commonBooks.getRecords().forEach(book -> { + HanHaiMember member = hanHaiMemberService.getById(book.getUserId()); + book.setAuthor(member.getName()); + }); + return Result.OK("首页最新小说列表",commonBooks); } @@ -171,20 +186,12 @@ public class AppletIndexServiceImpl implements AppletIndexService { //获取书籍详情 @Override - public Result getBookDetail(String id,String token){ - Map map = new HashMap<>(); + public Result getBookDetail(String id, String token){ CommonShop commonShop = commonShopService.getById(id); - map.put("bookDetails", commonShop); - map.put("book", new CommonBook()); - if(StringUtils.isNotBlank(token)){ - HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); - //查询是否加入书架 - CommonBook commonBook = commonBookService.lambdaQuery() - .eq(CommonBook::getShopId,id) - .eq(CommonBook::getUserId,hanHaiMember.getId()) - .one(); - map.put("book", commonBook); - } + + //添加作者 + HanHaiMember member = hanHaiMemberService.getById(commonShop.getUserId()); + commonShop.setAuthor(member.getName()); return Result.OK("书籍详情",commonShop); } @@ -211,9 +218,12 @@ public class AppletIndexServiceImpl implements AppletIndexService { if(Integer.parseInt(num) <= (hanHaiMember.getMoney() == null ? 0 : hanHaiMember.getMoney().intValue())){ return Result.error("票数不够"); } + + //给书籍增加票数 commonShop.setTuiNum(commonShop.getTuiNum()+Integer.parseInt(num)); commonShopService.updateById(commonShop); + //给用户扣减票数 hanHaiMember.setMoney(hanHaiMember.getMoney().subtract(new BigDecimal(num))); hanHaiMemberService.updateById(hanHaiMember); return Result.OK("投票成功"); diff --git a/module-common/src/main/java/org/jeecg/api/service/impl/AppletMyBookServiceImpl.java b/module-common/src/main/java/org/jeecg/api/service/impl/AppletMyBookServiceImpl.java index fa60b94..a8c840c 100644 --- a/module-common/src/main/java/org/jeecg/api/service/impl/AppletMyBookServiceImpl.java +++ b/module-common/src/main/java/org/jeecg/api/service/impl/AppletMyBookServiceImpl.java @@ -2,11 +2,14 @@ package org.jeecg.api.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.jeecg.api.bean.PageBean; import org.jeecg.api.service.AppletMyBookService; import org.jeecg.common.api.vo.Result; import org.jeecg.config.shiro.ShiroRealm; +import org.jeecg.modules.CommonChapterSubscribe.entity.CommonChapterSubscribe; +import org.jeecg.modules.CommonChapterSubscribe.service.ICommonChapterSubscribeService; import org.jeecg.modules.commonBook.entity.CommonBook; import org.jeecg.modules.commonBookNovel.entity.CommonBookNovel; import org.jeecg.modules.commonBookNovel.service.ICommonBookNovelService; @@ -31,6 +34,8 @@ public class AppletMyBookServiceImpl implements AppletMyBookService { private ICommonShopService commonShopService; @Autowired private ICommonBookNovelService commonBookNovelService; + @Autowired + private ICommonChapterSubscribeService commonChapterSubscribeService; //获取我的作品带分页 @Override @@ -119,7 +124,13 @@ public class AppletMyBookServiceImpl implements AppletMyBookService { public Result getMyShopNovel(String token, String bookId, String novelId){ HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); - return Result.OK("您已订阅该章节",true); + CommonChapterSubscribe one = commonChapterSubscribeService.lambdaQuery() + .eq(CommonChapterSubscribe::getBookId, bookId) + .eq(CommonChapterSubscribe::getUserId, hanHaiMember.getId()) + .eq(CommonChapterSubscribe::getChapterId, novelId) + .one(); + + return Result.OK("您已订阅该章节", ObjectUtils.isNotEmpty(one)); } diff --git a/module-common/src/main/java/org/jeecg/api/service/impl/AppletOrderServiceImpl.java b/module-common/src/main/java/org/jeecg/api/service/impl/AppletOrderServiceImpl.java index 342ba8e..e55c1cb 100644 --- a/module-common/src/main/java/org/jeecg/api/service/impl/AppletOrderServiceImpl.java +++ b/module-common/src/main/java/org/jeecg/api/service/impl/AppletOrderServiceImpl.java @@ -5,15 +5,20 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.jeecg.api.bean.PageBean; +import org.jeecg.api.service.AppletMoneyLogService; import org.jeecg.api.service.AppletOrderService; import org.jeecg.common.api.vo.Result; import org.jeecg.config.shiro.ShiroRealm; +import org.jeecg.modules.CommonChapterSubscribe.entity.CommonChapterSubscribe; +import org.jeecg.modules.CommonChapterSubscribe.service.ICommonChapterSubscribeService; import org.jeecg.modules.GiveGifts.entity.GiveGifts; import org.jeecg.modules.GiveGifts.service.IGiveGiftsService; +import org.jeecg.modules.commonBookNovel.entity.CommonBookNovel; import org.jeecg.modules.commonBookNovel.service.ICommonBookNovelService; import org.jeecg.modules.commonGift.entity.CommonGift; import org.jeecg.modules.commonGift.service.ICommonGiftService; import org.jeecg.modules.commonGiftBack.service.ICommonGiftBackService; +import org.jeecg.modules.commonMoneyLog.entity.CommonMoneyLog; import org.jeecg.modules.commonMoneyLog.service.ICommonMoneyLogService; import org.jeecg.modules.commonMyBook.service.ICommonMyBookService; import org.jeecg.modules.commonMyGift.entity.CommonMyGift; @@ -26,14 +31,18 @@ import org.jeecg.modules.commonShop.entity.CommonShop; import org.jeecg.modules.commonShop.service.ICommonShopService; import org.jeecg.modules.hanHaiMember.entity.HanHaiMember; import org.jeecg.modules.hanHaiMember.service.IHanHaiMemberService; +import org.jeecg.modules.online.auth.b.a; import org.jeecg.modules.pay.MpWxPayService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.math.BigDecimal; import java.util.List; +import static org.jeecg.modules.online.auth.b.a.i; + @Service public class AppletOrderServiceImpl implements AppletOrderService { @@ -67,6 +76,12 @@ public class AppletOrderServiceImpl implements AppletOrderService { @Autowired private ICommonRankingService commonRankingService; + @Autowired + private AppletMoneyLogService appletMoneyLogService; + + @Autowired + private ICommonChapterSubscribeService commonChapterSubscribeService; + //查询互动打赏礼物信息列表 @Override public Result getInteractionGiftList(PageBean pageBean) { @@ -138,22 +153,13 @@ public class AppletOrderServiceImpl implements AppletOrderService { } - - - - - - - - BigDecimal totalPrice = new BigDecimal(0.01); //吊起微信支付 - String s = totalPrice.multiply(new BigDecimal(100)).toString(); - int i1 = Double.valueOf(1).intValue(); + int i = commonPackage.getMoney().multiply(new BigDecimal(100)).intValue(); Object appOrder = mpWxPayService.createOrder( "测试支付" , "127.0.0.1", System.currentTimeMillis()+"", - i1, + i, System.currentTimeMillis()+"", member.getAppletOpenid(), "{}"); @@ -175,6 +181,7 @@ public class AppletOrderServiceImpl implements AppletOrderService { //根据书籍id,礼物id赠送礼物 @Override + @Transactional public Result giveGift(String token, String bookId, String giftId, Integer num){ HanHaiMember member = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); @@ -198,7 +205,8 @@ public class AppletOrderServiceImpl implements AppletOrderService { } // 消耗豆豆 - member.setIntegerPrice(member.getIntegerPrice().subtract(new BigDecimal(gift.getIntegerPrice() * num))); + BigDecimal integerPrice = member.getIntegerPrice(); + member.setIntegerPrice(integerPrice.subtract(new BigDecimal(gift.getIntegerPrice() * num))); hanHaiMemberService.updateById(member); // 添加送礼记录 @@ -216,7 +224,21 @@ public class AppletOrderServiceImpl implements AppletOrderService { giveGiftsService.save(build); //增加亲密值 - commonRankingService.addIntimacy(member.getId(), bookId, gift.getIntimacyValue() == null ? 0 : gift.getIntimacyValue().intValue()); + int i = gift.getIntimacyValue() == null ? 0 : gift.getIntimacyValue().intValue(); + commonRankingService.addIntimacy(member.getId(), bookId, i); + shop.setQmNum(shop.getQmNum() + i); + commonShopService.updateById(shop); + + // 添加消费记录 + commonMoneyLogService.save(CommonMoneyLog.builder() + .title("赠送礼物" + gift.getTitle() + "给" + shop.getName()) + .oldMoney(integerPrice) + .money(new BigDecimal(gift.getIntegerPrice() * num)) + .type(1)//支付豆豆 + .state(0) + .build()); + + // TODO 这里需要给作者分钱 return Result.OK("赠送礼物成功"); } @@ -224,8 +246,67 @@ public class AppletOrderServiceImpl implements AppletOrderService { //购买章节 @Override + @Transactional public Result buyNovel(String token, String bookId, String novelId){ HanHaiMember member = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); + + CommonShop book = commonShopService.getById(bookId); + CommonBookNovel chapter = commonBookNovelService.getById(novelId); + + if(ObjectUtils.isEmpty(book)){ + Result.error("书籍不存在"); + } + if(ObjectUtils.isEmpty(chapter)){ + Result.error("章节不存在"); + } + + CommonChapterSubscribe one = commonChapterSubscribeService.lambdaQuery() + .eq(CommonChapterSubscribe::getBookId, bookId) + .eq(CommonChapterSubscribe::getUserId, member.getId()) + .eq(CommonChapterSubscribe::getChapterId, novelId) + .one(); + + if (ObjectUtils.isEmpty(one)){ + //消耗的豆豆 + // TODO 这里需要计算豆豆 + Integer i = chapter.getNum() / 200; + + if (member.getIntegerPrice().intValue() < i){ + Result.error("豆豆不足"); + } + + // 添加订阅记录 + CommonChapterSubscribe subscribe = CommonChapterSubscribe.builder() + .authorId(book.getUserId()) + .bookId(bookId) + .userId(member.getId()) + .chapterId(novelId) + .build(); + commonChapterSubscribeService.save(subscribe); + + + // 减去豆豆 + BigDecimal integerPrice = member.getIntegerPrice(); + member.setIntegerPrice(integerPrice.subtract(new BigDecimal(i))); + hanHaiMemberService.updateById(member); + + //增加亲密值 + commonRankingService.addIntimacy(member.getId(), bookId, i); + book.setQmNum(book.getQmNum() + i); + commonShopService.updateById(book); + + // 添加消费记录 + commonMoneyLogService.save(CommonMoneyLog.builder() + .title("订阅" + book.getName() + "的章节" + chapter.getTitle()) + .oldMoney(integerPrice) + .money(new BigDecimal(i)) + .type(1)//支付豆豆 + .state(0) + .build()); + + // TODO 这里需要给作者分钱 + } + return Result.OK("购买成功"); } } diff --git a/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/controller/CommonChapterSubscribeController.java b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/controller/CommonChapterSubscribeController.java new file mode 100644 index 0000000..01c8205 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/controller/CommonChapterSubscribeController.java @@ -0,0 +1,171 @@ +package org.jeecg.modules.CommonChapterSubscribe.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.CommonChapterSubscribe.entity.CommonChapterSubscribe; +import org.jeecg.modules.CommonChapterSubscribe.service.ICommonChapterSubscribeService; + +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-06-22 + * @Version: V1.0 + */ +@Api(tags="章节订阅记录") +@RestController +@RequestMapping("/CommonChapterSubscribe/commonChapterSubscribe") +@Slf4j +public class CommonChapterSubscribeController extends JeecgController { + @Autowired + private ICommonChapterSubscribeService commonChapterSubscribeService; + + /** + * 分页列表查询 + * + * @param commonChapterSubscribe + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "章节订阅记录-分页列表查询") + @ApiOperation(value="章节订阅记录-分页列表查询", notes="章节订阅记录-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(CommonChapterSubscribe commonChapterSubscribe, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(commonChapterSubscribe, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = commonChapterSubscribeService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param commonChapterSubscribe + * @return + */ + @AutoLog(value = "章节订阅记录-添加") + @ApiOperation(value="章节订阅记录-添加", notes="章节订阅记录-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody CommonChapterSubscribe commonChapterSubscribe) { + commonChapterSubscribeService.save(commonChapterSubscribe); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param commonChapterSubscribe + * @return + */ + @AutoLog(value = "章节订阅记录-编辑") + @ApiOperation(value="章节订阅记录-编辑", notes="章节订阅记录-编辑") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody CommonChapterSubscribe commonChapterSubscribe) { + commonChapterSubscribeService.updateById(commonChapterSubscribe); + 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) { + commonChapterSubscribeService.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.commonChapterSubscribeService.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) { + CommonChapterSubscribe commonChapterSubscribe = commonChapterSubscribeService.getById(id); + if(commonChapterSubscribe==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(commonChapterSubscribe); + } + + /** + * 导出excel + * + * @param request + * @param commonChapterSubscribe + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, CommonChapterSubscribe commonChapterSubscribe) { + return super.exportXls(request, commonChapterSubscribe, CommonChapterSubscribe.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, CommonChapterSubscribe.class); + } + +} diff --git a/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/entity/CommonChapterSubscribe.java b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/entity/CommonChapterSubscribe.java new file mode 100644 index 0000000..7188433 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/entity/CommonChapterSubscribe.java @@ -0,0 +1,79 @@ +package org.jeecg.modules.CommonChapterSubscribe.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.*; +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.experimental.Accessors; + +/** + * @Description: 章节订阅记录 + * @Author: jeecg-boot + * @Date: 2025-06-22 + * @Version: V1.0 + */ +@Data +@TableName("common_chapter_subscribe") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="common_chapter_subscribe对象", description="章节订阅记录") +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class CommonChapterSubscribe 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; + /**所属部门*/ + @ApiModelProperty(value = "所属部门") + private java.lang.String sysOrgCode; + /**用户*/ + @Excel(name = "用户", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") + @Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") + @ApiModelProperty(value = "用户") + private java.lang.String userId; + /**书籍*/ + @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 bookId; + /**章节*/ + @Excel(name = "章节", width = 15, dictTable = "common_book_novel", dicText = "title", dicCode = "id") + @Dict(dictTable = "common_book_novel", dicText = "title", dicCode = "id") + @ApiModelProperty(value = "章节") + private java.lang.String chapterId; + /**作者*/ + @Excel(name = "作者", width = 15, dictTable = "han_hai_member", dicText = "name", dicCode = "id") + @Dict(dictTable = "han_hai_member", dicText = "name", dicCode = "id") + @ApiModelProperty(value = "作者") + private java.lang.String authorId; + /**豆豆*/ + @Excel(name = "豆豆", width = 15) + @ApiModelProperty(value = "豆豆") + private java.lang.Integer integerPrice; +} diff --git a/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/mapper/CommonChapterSubscribeMapper.java b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/mapper/CommonChapterSubscribeMapper.java new file mode 100644 index 0000000..11578b7 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/mapper/CommonChapterSubscribeMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.CommonChapterSubscribe.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.CommonChapterSubscribe.entity.CommonChapterSubscribe; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 章节订阅记录 + * @Author: jeecg-boot + * @Date: 2025-06-22 + * @Version: V1.0 + */ +public interface CommonChapterSubscribeMapper extends BaseMapper { + +} diff --git a/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/mapper/xml/CommonChapterSubscribeMapper.xml b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/mapper/xml/CommonChapterSubscribeMapper.xml new file mode 100644 index 0000000..8c97e6d --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/mapper/xml/CommonChapterSubscribeMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/service/ICommonChapterSubscribeService.java b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/service/ICommonChapterSubscribeService.java new file mode 100644 index 0000000..1dcf19c --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/service/ICommonChapterSubscribeService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.CommonChapterSubscribe.service; + +import org.jeecg.modules.CommonChapterSubscribe.entity.CommonChapterSubscribe; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 章节订阅记录 + * @Author: jeecg-boot + * @Date: 2025-06-22 + * @Version: V1.0 + */ +public interface ICommonChapterSubscribeService extends IService { + +} diff --git a/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/service/impl/CommonChapterSubscribeServiceImpl.java b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/service/impl/CommonChapterSubscribeServiceImpl.java new file mode 100644 index 0000000..4de6be9 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/service/impl/CommonChapterSubscribeServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.CommonChapterSubscribe.service.impl; + +import org.jeecg.modules.CommonChapterSubscribe.entity.CommonChapterSubscribe; +import org.jeecg.modules.CommonChapterSubscribe.mapper.CommonChapterSubscribeMapper; +import org.jeecg.modules.CommonChapterSubscribe.service.ICommonChapterSubscribeService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 章节订阅记录 + * @Author: jeecg-boot + * @Date: 2025-06-22 + * @Version: V1.0 + */ +@Service +public class CommonChapterSubscribeServiceImpl extends ServiceImpl implements ICommonChapterSubscribeService { + +} diff --git a/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue/CommonChapterSubscribeList.vue b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue/CommonChapterSubscribeList.vue new file mode 100644 index 0000000..2e5afbf --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue/CommonChapterSubscribeList.vue @@ -0,0 +1,223 @@ + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue/modules/CommonChapterSubscribeForm.vue b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue/modules/CommonChapterSubscribeForm.vue new file mode 100644 index 0000000..b2adc85 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue/modules/CommonChapterSubscribeForm.vue @@ -0,0 +1,124 @@ + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue/modules/CommonChapterSubscribeModal.Style#Drawer.vue b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue/modules/CommonChapterSubscribeModal.Style#Drawer.vue new file mode 100644 index 0000000..5cc58ee --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue/modules/CommonChapterSubscribeModal.Style#Drawer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue/modules/CommonChapterSubscribeModal.vue b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue/modules/CommonChapterSubscribeModal.vue new file mode 100644 index 0000000..16689ea --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue/modules/CommonChapterSubscribeModal.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue3/CommonChapterSubscribe.api.ts b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue3/CommonChapterSubscribe.api.ts new file mode 100644 index 0000000..648d043 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue3/CommonChapterSubscribe.api.ts @@ -0,0 +1,61 @@ +import {defHttp} from '/@/utils/http/axios'; +import {Modal} from 'ant-design-vue'; + +enum Api { + list = '/CommonChapterSubscribe/commonChapterSubscribe/list', + save='/CommonChapterSubscribe/commonChapterSubscribe/add', + edit='/CommonChapterSubscribe/commonChapterSubscribe/edit', + deleteOne = '/CommonChapterSubscribe/commonChapterSubscribe/delete', + deleteBatch = '/CommonChapterSubscribe/commonChapterSubscribe/deleteBatch', + importExcel = '/CommonChapterSubscribe/commonChapterSubscribe/importExcel', + exportXls = '/CommonChapterSubscribe/commonChapterSubscribe/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/CommonChapterSubscribe/vue3/CommonChapterSubscribe.data.ts b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue3/CommonChapterSubscribe.data.ts new file mode 100644 index 0000000..abe908e --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue3/CommonChapterSubscribe.data.ts @@ -0,0 +1,102 @@ +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_dictText' + }, + { + title: '书籍', + align:"center", + dataIndex: 'bookId_dictText' + }, + { + title: '章节', + align:"center", + dataIndex: 'chapterId_dictText' + }, + { + title: '作者', + align:"center", + dataIndex: 'authorId_dictText' + }, + { + title: '豆豆', + align:"center", + dataIndex: 'integerPrice' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ + { + label: "用户", + field: "userId", + component: 'JSearchSelect', + componentProps:{ + dict:"han_hai_member,nick_name,id" + }, + colProps: {span: 6}, + }, + { + label: "书籍", + field: "bookId", + component: 'JSearchSelect', + componentProps:{ + dict:"common_shop,name,id" + }, + colProps: {span: 6}, + }, + { + label: "章节", + field: "chapterId", + component: 'JSearchSelect', + componentProps:{ + dict:"common_book_novel,title,id" + }, + colProps: {span: 6}, + }, +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '用户', + field: 'userId', + component: 'JSearchSelect', + componentProps:{ + dict:"han_hai_member,nick_name,id" + }, + }, + { + label: '书籍', + field: 'bookId', + component: 'JSearchSelect', + componentProps:{ + dict:"common_shop,name,id" + }, + }, + { + label: '章节', + field: 'chapterId', + component: 'JSearchSelect', + componentProps:{ + dict:"common_book_novel,title,id" + }, + }, + { + label: '作者', + field: 'authorId', + component: 'JSearchSelect', + componentProps:{ + dict:"han_hai_member,name,id" + }, + }, + { + label: '豆豆', + field: 'integerPrice', + component: 'InputNumber', + }, +]; diff --git a/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue3/CommonChapterSubscribeList.vue b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue3/CommonChapterSubscribeList.vue new file mode 100644 index 0000000..1e679d7 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue3/CommonChapterSubscribeList.vue @@ -0,0 +1,162 @@ + + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue3/components/CommonChapterSubscribeModal.vue b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue3/components/CommonChapterSubscribeModal.vue new file mode 100644 index 0000000..1d35f8d --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/CommonChapterSubscribe/vue3/components/CommonChapterSubscribeModal.vue @@ -0,0 +1,58 @@ + + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commonMoneyLog/entity/CommonMoneyLog.java b/module-common/src/main/java/org/jeecg/modules/commonMoneyLog/entity/CommonMoneyLog.java index 102cad6..bb0c113 100644 --- a/module-common/src/main/java/org/jeecg/modules/commonMoneyLog/entity/CommonMoneyLog.java +++ b/module-common/src/main/java/org/jeecg/modules/commonMoneyLog/entity/CommonMoneyLog.java @@ -7,14 +7,13 @@ 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 lombok.*; 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; /** @@ -24,6 +23,9 @@ import lombok.experimental.Accessors; * @Version: V1.0 */ @Data +@AllArgsConstructor +@NoArgsConstructor +@Builder @TableName("common_money_log") @Accessors(chain = true) @EqualsAndHashCode(callSuper = false) @@ -65,7 +67,7 @@ public class CommonMoneyLog implements Serializable { /**类型*/ @Excel(name = "类型", width = 15, dicCode = "pay_type") @Dict(dicCode = "pay_type") - @ApiModelProperty(value = "类型") + @ApiModelProperty(value = "类型 0微信充值 1支付豆豆") private java.lang.Integer type; /**状态*/ @Excel(name = "状态", width = 15, dicCode = "pay_state") diff --git a/module-common/src/main/java/org/jeecg/modules/commonShop/service/ICommonShopService.java b/module-common/src/main/java/org/jeecg/modules/commonShop/service/ICommonShopService.java index 885d776..8f34622 100644 --- a/module-common/src/main/java/org/jeecg/modules/commonShop/service/ICommonShopService.java +++ b/module-common/src/main/java/org/jeecg/modules/commonShop/service/ICommonShopService.java @@ -10,5 +10,4 @@ import com.baomidou.mybatisplus.extension.service.IService; * @Version: V1.0 */ public interface ICommonShopService extends IService { - } diff --git a/module-common/src/main/java/org/jeecg/modules/commonShop/service/impl/CommonShopServiceImpl.java b/module-common/src/main/java/org/jeecg/modules/commonShop/service/impl/CommonShopServiceImpl.java index 93edd51..40feeb8 100644 --- a/module-common/src/main/java/org/jeecg/modules/commonShop/service/impl/CommonShopServiceImpl.java +++ b/module-common/src/main/java/org/jeecg/modules/commonShop/service/impl/CommonShopServiceImpl.java @@ -15,5 +15,4 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; */ @Service public class CommonShopServiceImpl extends ServiceImpl implements ICommonShopService { - }