主管理员 6 months ago
parent
commit
ba87f5f7a5
89 changed files with 5907 additions and 152 deletions
  1. +3
    -0
      .trae/rules/project_rules.md
  2. +1
    -4
      jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/vo/AppletUser.java
  3. +6
    -6
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiBooksController.java
  4. +5
    -4
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiLoginController.java
  5. +10
    -2
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiMemberController.java
  6. +3
    -3
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiPromotionController.java
  7. +7
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/entity/SendCouponEntity.java
  8. +4
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/AppletApiCouponService.java
  9. +7
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/AppletApiVipService.java
  10. +1
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/AppletApiWaterService.java
  11. +63
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiBooksServiceImpl.java
  12. +12
    -2
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiCouponServiceImpl.java
  13. +30
    -6
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiVipServiceImpl.java
  14. +12
    -2
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiWaterServiceImpl.java
  15. +1
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/controller/AppletBooksController.java
  16. +48
    -9
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/entity/AppletBooks.java
  17. +1
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/mapper/AppletBooksMapper.java
  18. +1
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/service/IAppletBooksService.java
  19. +1
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/service/impl/AppletBooksServiceImpl.java
  20. +46
    -4
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/uniapp/AppletBooksForm.vue
  21. +35
    -9
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/uniapp3/AppletBooksData.ts
  22. +109
    -31
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/uniapp3/AppletBooksForm.vue
  23. +101
    -23
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/vue3/AppletBooks.data.ts
  24. +8
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/vue3/AppletBooksList.vue
  25. +26
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/vue3/V20250917_1__menu_insert_AppletBooks.sql
  26. +26
    -3
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoupon/controller/AppletCouponController.java
  27. +3
    -3
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoupon/entity/AppletCoupon.java
  28. +1
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoupon/mapper/AppletCouponMapper.java
  29. +15
    -3
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoupon/service/IAppletCouponService.java
  30. +110
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoupon/service/impl/AppletCouponServiceImpl.java
  31. +26
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoupon/vue3/V20250917_1__menu_insert_AppletCoupon.sql
  32. +186
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/controller/AppletCouponRecordController.java
  33. +85
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/entity/AppletCouponRecord.java
  34. +17
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/mapper/AppletCouponRecordMapper.java
  35. +5
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/mapper/xml/AppletCouponRecordMapper.xml
  36. +14
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/service/IAppletCouponRecordService.java
  37. +19
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/service/impl/AppletCouponRecordServiceImpl.java
  38. +102
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/uniapp/AppletCouponRecordForm.vue
  39. +44
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/uniapp/AppletCouponRecordList.vue
  40. +29
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/uniapp3/AppletCouponRecordData.ts
  41. +253
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/uniapp3/AppletCouponRecordForm.vue
  42. +148
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/uniapp3/AppletCouponRecordList.vue
  43. +64
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/vue3/AppletCouponRecord.api.ts
  44. +109
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/vue3/AppletCouponRecord.data.ts
  45. +206
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/vue3/AppletCouponRecordList.vue
  46. +26
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/vue3/V20250917_1__menu_insert_AppletCouponRecord.sql
  47. +70
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/vue3/components/AppletCouponRecordForm.vue
  48. +99
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/vue3/components/AppletCouponRecordModal.vue
  49. +8
    -2
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/controller/AppletCourseController.java
  50. +9
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/entity/AppletCourse.java
  51. +1
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/mapper/AppletCourseMapper.java
  52. +1
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/service/IAppletCourseService.java
  53. +1
    -1
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/service/impl/AppletCourseServiceImpl.java
  54. +12
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/uniapp/AppletCourseForm.vue
  55. +14
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/uniapp3/AppletCourseData.ts
  56. +32
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/uniapp3/AppletCourseForm.vue
  57. +47
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/vue3/AppletCourse.data.ts
  58. +26
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/vue3/V20250918_1__menu_insert_AppletCourse.sql
  59. +182
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/controller/AppletCoursePageController.java
  60. +83
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/entity/AppletCoursePage.java
  61. +17
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/mapper/AppletCoursePageMapper.java
  62. +5
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/mapper/xml/AppletCoursePageMapper.xml
  63. +14
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/service/IAppletCoursePageService.java
  64. +19
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/service/impl/AppletCoursePageServiceImpl.java
  65. +113
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/uniapp/AppletCoursePageForm.vue
  66. +44
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/uniapp/AppletCoursePageList.vue
  67. +40
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/uniapp3/AppletCoursePageData.ts
  68. +285
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/uniapp3/AppletCoursePageForm.vue
  69. +148
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/uniapp3/AppletCoursePageList.vue
  70. +64
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/vue3/AppletCoursePage.api.ts
  71. +110
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/vue3/AppletCoursePage.data.ts
  72. +206
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/vue3/AppletCoursePageList.vue
  73. +26
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/vue3/V20250918_1__menu_insert_AppletCoursePage.sql
  74. +70
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/vue3/components/AppletCoursePageForm.vue
  75. +99
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/vue3/components/AppletCoursePageModal.vue
  76. +9
    -4
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletWater/entity/AppletWater.java
  77. +71
    -0
      jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/job/CouponExpireJob.java
  78. +20
    -1
      jeecgboot-vue3/src/router/routes/staticRouter.ts
  79. +11
    -11
      jeecgboot-vue3/src/views/applet/coupon/AppletCoupon.data.ts
  80. +24
    -4
      jeecgboot-vue3/src/views/applet/coupon/AppletCouponList.vue
  81. +365
    -0
      jeecgboot-vue3/src/views/applet/coupon/components/AppletCouponDistributeModal.vue
  82. +1
    -1
      jeecgboot-vue3/src/views/applet/coupon/components/AppletCouponModal.vue
  83. +68
    -0
      jeecgboot-vue3/src/views/applet/course-page/AppletCoursePage.api.ts
  84. +111
    -0
      jeecgboot-vue3/src/views/applet/course-page/AppletCoursePage.data.ts
  85. +1217
    -0
      jeecgboot-vue3/src/views/applet/course-page/AppletCoursePageList.vue
  86. +37
    -0
      jeecgboot-vue3/src/views/applet/course-page/components/AppletCoursePageForm.vue
  87. +59
    -0
      jeecgboot-vue3/src/views/applet/course-page/components/AppletCoursePageModal.vue
  88. +19
    -0
      jeecgboot-vue3/src/views/applet/course/AppletCourse.data.ts
  89. +21
    -2
      jeecgboot-vue3/src/views/applet/course/AppletCourseList.vue

+ 3
- 0
.trae/rules/project_rules.md View File

@ -5,3 +5,6 @@
5. 项目使用的是vue3+element-plus前端框架
POST接口也不要使用@RequestBody接收参数,不使用参数注解
不需要帮我运行项目

+ 1
- 4
jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/vo/AppletUser.java View File

@ -5,10 +5,7 @@ import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.*;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;


+ 6
- 6
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiBooksController.java View File

@ -44,8 +44,8 @@ public class AppletApiBooksController {
@GetMapping(value = "/list")
@IgnoreAuth
public Result<IPage<AppletBooks>> list(@Parameter(description = "搜素关键字") String title,
@Parameter(description = "搜素关键字") String category,
@Parameter(description = "搜素关键字") String label,
@Parameter(description = "分类") String category,
@Parameter(description = "标签") String label,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
log.info("查询书籍列表");
@ -62,9 +62,9 @@ public class AppletApiBooksController {
* @return 查询书籍详情
*/
@Operation(summary = "查询书籍详情", description = "查询书籍详情")
@GetMapping(value = "/list")
@GetMapping(value = "/detail")
@IgnoreAuth
public Result<AppletBooks> list(@Parameter(description = "书籍id") String id) {
public Result<AppletBooks> detail(@Parameter(description = "书籍id") @RequestParam String id) {
log.info("查询书籍详情");
return Result.OK(appletApiBooksService.detail(id));
}
@ -124,7 +124,7 @@ public class AppletApiBooksController {
*/
@Operation(summary = "加入书桌", description = "加入书桌")
@PostMapping(value = "/addStand")
public Result<?> addStand(@Parameter(description = "书籍id") String id) {
public Result<?> addStand(@Parameter(description = "书籍id") @RequestParam String id) {
appletApiBooksService.addStand(id);
return Result.OK();
}
@ -137,7 +137,7 @@ public class AppletApiBooksController {
@IgnoreAuth
@Operation(summary = "删除书桌", description = "删除书桌,批量删除用,分割")
@PostMapping(value = "/delStand")
public Result<?> delStand(@Parameter(description = "书籍id") String id) {
public Result<?> delStand(@Parameter(description = "书籍id") @RequestParam String id) {
appletApiBooksService.delStand(id);
return Result.OK();
}


+ 5
- 4
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiLoginController.java View File

@ -39,8 +39,8 @@ public class AppletApiLoginController {
@Operation(summary = "微信小程序登录", description = "通过微信code进行小程序登录")
@IgnoreAuth
public Result<Map<String, Object>> wxLogin(
@Parameter(description = "微信登录code", required = true) String code,
@Parameter(description = "邀请人") String inviter) {
@Parameter(description = "微信登录code", required = true) @RequestParam String code,
@Parameter(description = "邀请人") @RequestParam(required = false) String inviter) {
if (StringUtils.isBlank(code)) {
return Result.error("微信登录code不能为空");
@ -60,7 +60,7 @@ public class AppletApiLoginController {
@Operation(summary = "获取用户手机号", description = "通过微信code获取用户手机号")
@IgnoreAuth
public Result<String> getPhoneNumber(
@Parameter(description = "手机号获取code", required = true) String code) {
@Parameter(description = "手机号获取code", required = true) @RequestParam String code) {
if (StringUtils.isBlank(code)) {
return Result.error("手机号获取code不能为空");
}
@ -113,7 +113,8 @@ public class AppletApiLoginController {
if (userInfo == null) {
return Result.error("用户信息不能为空");
}
log.info("收到更新用户信息请求");
return appletApiLoginService.updateUserInfo(userInfo);
}

+ 10
- 2
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiMemberController.java View File

@ -11,6 +11,7 @@ import org.jeecg.config.shiro.IgnoreAuth;
import org.jeecg.modules.applet.service.AppletApiCouponService;
import org.jeecg.modules.applet.service.AppletApiVipService;
import org.jeecg.modules.demo.appletCoupon.entity.AppletCoupon;
import org.jeecg.modules.demo.appletCouponRecord.entity.AppletCouponRecord;
import org.jeecg.modules.demo.appletMemberOrder.entity.AppletMemberOrder;
import org.jeecg.modules.demo.appletVip.entity.AppletVip;
import org.springframework.beans.factory.annotation.Autowired;
@ -52,12 +53,19 @@ public class AppletApiMemberController {
@Operation(summary = "获取优惠劵", description = "获取优惠劵")
@GetMapping(value = "/coupon")
public Result<IPage<AppletCoupon>> coupon(
public Result<IPage<AppletCouponRecord>> coupon(
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
String status) {
Page<AppletCoupon> page = new Page<>(pageNo, pageSize);
Page<AppletCouponRecord> page = new Page<>(pageNo, pageSize);
return Result.OK(appletCouponService.getCoupon(page, status));
}
@Operation(summary = "获取当前用户会员信息", description = "获取当前用户拥有的会员信息列表")
@GetMapping(value = "/userMemberInfo")
public Result<List<AppletMemberOrder>> getUserMemberInfo() {
List<AppletMemberOrder> memberOrders = appletApiVipService.getUserMemberInfo();
return Result.OK(memberOrders);
}
}

+ 3
- 3
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiPromotionController.java View File

@ -37,13 +37,13 @@ public class AppletApiPromotionController {
@Operation(summary = "我的团队", description = "我的团队")
@GetMapping(value = "/team")
public Result<IPage<AppletUser>> team(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
@RequestParam(required = false) @Parameter String name) {
Page<AppletUser> page = new Page<>(pageNo, pageSize);
IPage<AppletUser> UserList = appletApiWaterService.getTeam(page);
IPage<AppletUser> UserList = appletApiWaterService.getTeam(page, name);
return Result.OK(UserList);
}
@IgnoreAuth
@Operation(summary = "佣金流水", description = "佣金流水")
@GetMapping(value = "/water")
public Result<IPage<AppletWater>> water(


+ 7
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/entity/SendCouponEntity.java View File

@ -1,4 +1,11 @@
package org.jeecg.modules.applet.entity;
import lombok.Data;
@Data
public class SendCouponEntity {
private String couponId;
private String userIds;
}

+ 4
- 1
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/AppletApiCouponService.java View File

@ -3,9 +3,12 @@ package org.jeecg.modules.applet.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.demo.appletCoupon.entity.AppletCoupon;
import org.jeecg.modules.demo.appletCouponRecord.entity.AppletCouponRecord;
import java.util.List;
public interface AppletApiCouponService {
IPage<AppletCoupon> getCoupon(Page<AppletCoupon> page, String type);
IPage<AppletCouponRecord> getCoupon(Page<AppletCouponRecord> page, String type);
}

+ 7
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/AppletApiVipService.java View File

@ -24,4 +24,11 @@ public interface AppletApiVipService {
Object getOpe(AppletMemberOrder appletMemberOrder);
Object payNotify(String requestBody);
/**
* 获取当前用户拥有的会员信息
*
* @return 用户会员订单列表
*/
List<AppletMemberOrder> getUserMemberInfo();
}

+ 1
- 1
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/AppletApiWaterService.java View File

@ -25,7 +25,7 @@ public interface AppletApiWaterService {
* @param page
* @return
*/
IPage<AppletUser> getTeam(Page<AppletUser> page);
IPage<AppletUser> getTeam(Page<AppletUser> page, String name);
/**
* 提现


+ 63
- 1
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiBooksServiceImpl.java View File

@ -20,9 +20,11 @@ import org.jeecg.modules.demo.appletCourse.entity.AppletCourse;
import org.jeecg.modules.demo.appletCourse.service.IAppletCourseService;
import org.jeecg.modules.demo.appletLabel.entity.AppletLabel;
import org.jeecg.modules.demo.appletLabel.service.IAppletLabelService;
import org.jeecg.modules.demo.appletVip.service.IAppletVipService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@ -41,6 +43,8 @@ public class AppletApiBooksServiceImpl implements AppletApiBooksService {
private IAppletLabelService appletLabelService;
@Autowired
private IAppletCategorizeService appletCategorizeService;
@Autowired
private IAppletVipService appletVipService;
/**
* 查询书籍列表
@ -56,12 +60,33 @@ public class AppletApiBooksServiceImpl implements AppletApiBooksService {
Page<AppletBooks> list = appletBooksService
.lambdaQuery()
.like(StringUtil.isNotEmpty(title), AppletBooks::getBooksName, title)
// .like(StringUtil.isNotEmpty(title), AppletBooks::getBooksName, title)
.and(StringUtil.isNotEmpty(title), e -> {
e.like(AppletBooks::getBooksName, title)
.or()
.like(AppletBooks::getBooksAuthor, title)
.or()
.like(AppletBooks::getTranslate, title)
.or()
.like(AppletBooks::getBooksIntro, title)
.or()
.like(AppletBooks::getKnowledge, title)
.or()
.like(AppletBooks::getEnAuthor, title);
})
.eq(StringUtil.isNotEmpty(category), AppletBooks::getBooksClassification, category)
.like(StringUtil.isNotEmpty(label), AppletBooks::getBooksLabel, label)
.eq(AppletBooks::getStatus, "Y")
.page(page);
list.getRecords().forEach(book -> {
book.setVipInfo(appletVipService.getById(book.getVip()));
AppletCategorize categorize = appletCategorizeService.getById(book.getBooksClassification());
if (categorize != null){
book.setCategoryName(categorize.getTitle());
}
});
return list;
}
@ -74,10 +99,33 @@ public class AppletApiBooksServiceImpl implements AppletApiBooksService {
*/
@Override
public IPage<AppletBookStand> getBooksStand(Page<AppletBookStand> booksPage, String title) {
List<String> ids = new ArrayList<>();
if (StringUtil.isNotEmpty(title)){
ids = appletBooksService.lambdaQuery()
.select(AppletBooks::getId)
.and(e -> {
e.like(AppletBooks::getBooksName, title)
.or()
.like(AppletBooks::getBooksAuthor, title)
.or()
.like(AppletBooks::getTranslate, title)
.or()
.like(AppletBooks::getBooksIntro, title)
.or()
.like(AppletBooks::getKnowledge, title)
.or()
.like(AppletBooks::getEnAuthor, title);
})
.list()
.stream().map(AppletBooks::getId)
.collect(Collectors.toList());
}
String userId = AppletUserUtil.getCurrentAppletUserId();
Page<AppletBookStand> page = appletBookStandService
.lambdaQuery()
.eq(AppletBookStand::getUserId, userId)
.in(ids.size() > 0, AppletBookStand::getBookId, ids)
.orderByDesc(AppletBookStand::getUpdateTime,
AppletBookStand::getCreateTime)
.page(booksPage);
@ -86,6 +134,11 @@ public class AppletApiBooksServiceImpl implements AppletApiBooksService {
AppletBooks book = appletBooksService.getById(stand.getBookId());
if ("Y".equals(book.getStatus())){
stand.setBook(book);
book.setVipInfo(appletVipService.getById(book.getVip()));
AppletCategorize categorize = appletCategorizeService.getById(book.getBooksClassification());
if (categorize != null){
book.setCategoryName(categorize.getTitle());
}
}
}
@ -144,6 +197,7 @@ public class AppletApiBooksServiceImpl implements AppletApiBooksService {
IPage<AppletCourse> pageResult = appletCourseService
.lambdaQuery()
.eq(AppletCourse::getBookId, id)
.orderByAsc(AppletCourse::getSort)
.page(coursePage);
return pageResult;
}
@ -171,6 +225,14 @@ public class AppletApiBooksServiceImpl implements AppletApiBooksService {
.eq(AppletBookStand::getUserId, user.getId())
.one() != null);
}
AppletCategorize categorize = appletCategorizeService.getById(book.getBooksClassification());
if (categorize != null){
book.setCategoryName(categorize.getTitle());
}
book.setVipInfo(appletVipService.getById(book.getVip()));
return book;
}


+ 12
- 2
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiCouponServiceImpl.java View File

@ -2,9 +2,12 @@ package org.jeecg.modules.applet.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.common.system.util.AppletUserUtil;
import org.jeecg.modules.applet.service.AppletApiCouponService;
import org.jeecg.modules.demo.appletCoupon.entity.AppletCoupon;
import org.jeecg.modules.demo.appletCoupon.service.IAppletCouponService;
import org.jeecg.modules.demo.appletCouponRecord.entity.AppletCouponRecord;
import org.jeecg.modules.demo.appletCouponRecord.service.IAppletCouponRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.objenesis.SpringObjenesis;
import org.springframework.stereotype.Service;
@ -16,6 +19,8 @@ public class AppletApiCouponServiceImpl implements AppletApiCouponService {
@Autowired
private IAppletCouponService appletCouponService;
@Autowired
private IAppletCouponRecordService appletCouponRecordService;
/**
* 获取优惠卷
@ -23,7 +28,12 @@ public class AppletApiCouponServiceImpl implements AppletApiCouponService {
* @return
*/
@Override
public IPage<AppletCoupon> getCoupon(Page<AppletCoupon> page, String status) {
return appletCouponService.page(page);
public IPage<AppletCouponRecord> getCoupon(Page<AppletCouponRecord> page, String status) {
String currentAppletUserId = AppletUserUtil.getCurrentAppletUserId();
return appletCouponRecordService
.lambdaQuery()
.eq(AppletCouponRecord::getUserId, currentAppletUserId)
.eq(AppletCouponRecord::getStatus, status)
.page(page);
}
}

+ 30
- 6
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiVipServiceImpl.java View File

@ -11,6 +11,8 @@ import org.jeecg.modules.applet.service.AppletApiVipService;
import org.jeecg.modules.common.IdUtils;
import org.jeecg.modules.demo.appletCoupon.entity.AppletCoupon;
import org.jeecg.modules.demo.appletCoupon.service.IAppletCouponService;
import org.jeecg.modules.demo.appletCouponRecord.entity.AppletCouponRecord;
import org.jeecg.modules.demo.appletCouponRecord.service.IAppletCouponRecordService;
import org.jeecg.modules.demo.appletMemberOrder.entity.AppletMemberOrder;
import org.jeecg.modules.demo.appletMemberOrder.service.IAppletMemberOrderService;
import org.jeecg.modules.demo.appletVip.entity.AppletSetmeal;
@ -42,6 +44,8 @@ public class AppletApiVipServiceImpl implements AppletApiVipService {
@Autowired
private IAppletCouponService appletCouponService;
@Autowired
private IAppletCouponRecordService appletCouponRecordService;
@Autowired
private IAppletWaterService appletWaterService;
@Autowired
private IAppletUserService appletUserService;
@ -130,12 +134,7 @@ public class AppletApiVipServiceImpl implements AppletApiVipService {
if (StringUtil.isNotEmpty(order.getCouponId())) {
// 计算优惠
AppletCoupon coupon = appletCouponService.getById(order.getCouponId());
if (coupon == null) {
throw new JeecgBootException("优惠卷不存在");
}
// TODO 需要判断忧患卷的状态等
AppletCouponRecord coupon = appletCouponService.useCoupon(order.getCouponId(), userId);
order.setDiscount(coupon.getMoney());
@ -225,4 +224,29 @@ public class AppletApiVipServiceImpl implements AppletApiVipService {
" </xml>";
}
/**
* 获取当前用户拥有的会员信息
*
* @return 用户会员订单列表
*/
@Override
public List<AppletMemberOrder> getUserMemberInfo() {
// 获取当前用户ID
String userId = AppletUserUtil.getCurrentAppletUserId();
if (StringUtil.isEmpty(userId)) {
throw new JeecgBootException("用户未登录");
}
// 查询用户的会员订单只返回已支付且未到期的订单按创建时间倒序
List<AppletMemberOrder> memberOrders = appletMemberOrderService.lambdaQuery()
.eq(AppletMemberOrder::getUserId, userId)
.eq(AppletMemberOrder::getStatus, "1") // 只查询已支付的订单
.gt(AppletMemberOrder::getEndTime, new Date()) // 只查询未到期的订单
.orderByDesc(AppletMemberOrder::getCreateTime)
.list();
return memberOrders;
}
}

+ 12
- 2
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/service/impl/AppletApiWaterServiceImpl.java View File

@ -2,6 +2,7 @@ package org.jeecg.modules.applet.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.api.IAppletUserService;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.util.AppletUserUtil;
@ -38,10 +39,18 @@ public class AppletApiWaterServiceImpl implements AppletApiWaterService {
@Override
public IPage<AppletWater> getWater(Page<AppletWater> waterPage) {
String userId = AppletUserUtil.getCurrentAppletUserId();
return appletWaterService.lambdaQuery()
Page<AppletWater> page = appletWaterService.lambdaQuery()
.eq(AppletWater::getUser, userId)
.page(waterPage);
for (AppletWater record : page.getRecords()) {
record.setUserInfo(appletUserService.getById(record.getUser()));
record.setWithdrawal(appletWithdrawalService.list().get(0));
}
return page;
}
/**
@ -51,10 +60,11 @@ public class AppletApiWaterServiceImpl implements AppletApiWaterService {
* @return
*/
@Override
public IPage<AppletUser> getTeam(Page<AppletUser> page) {
public IPage<AppletUser> getTeam(Page<AppletUser> page, String name) {
String userId = AppletUserUtil.getCurrentAppletUserId();
return appletUserService.lambdaQuery()
.eq(AppletUser::getInviter, userId)
.like(StringUtils.isNotBlank(name), AppletUser::getName, name)
.page(page);
}


+ 1
- 1
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/controller/AppletBooksController.java View File

@ -41,7 +41,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: 书籍表
* @Author: jeecg-boot
* @Date: 2025-09-09
* @Date: 2025-09-17
* @Version: V1.0
*/
@Tag(name="书籍表")


+ 48
- 9
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/entity/AppletBooks.java View File

@ -10,6 +10,7 @@ import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.modules.demo.appletVip.entity.AppletVip;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
@ -20,7 +21,7 @@ import lombok.experimental.Accessors;
/**
* @Description: 书籍表
* @Author: jeecg-boot
* @Date: 2025-09-09
* @Date: 2025-09-17
* @Version: V1.0
*/
@Data
@ -58,36 +59,74 @@ public class AppletBooks implements Serializable {
@Excel(name = "书籍名称", width = 15)
@Schema(description = "书籍名称")
private java.lang.String booksName;
/**英文书名*/
@Excel(name = "英文书名", width = 15)
@Schema(description = "英文书名")
private java.lang.String translate;
/**书籍封面*/
@Excel(name = "书籍封面", width = 15)
@Schema(description = "书籍封面")
private java.lang.String booksImg;
/**书籍作者*/
@Excel(name = "书籍作者", width = 15)
@Schema(description = "书籍作者")
private java.lang.String booksAuthor;
/**书籍简介*/
@Excel(name = "书籍简介", width = 15)
@Schema(description = "书籍简介")
private java.lang.String booksIntro;
/**书籍分类*/
@Excel(name = "书籍分类", width = 15)
@Excel(name = "书籍分类", width = 15, dictTable = "applet_categorize", dicText = "title", dicCode = "id")
@Dict(dictTable = "applet_categorize", dicText = "title", dicCode = "id")
@Schema(description = "书籍分类")
private java.lang.String booksClassification;
/**书籍标签*/
@Excel(name = "书籍标签", width = 15)
@Excel(name = "书籍标签", width = 15, dictTable = "applet_label", dicText = "lable", dicCode = "id")
@Dict(dictTable = "applet_label", dicText = "lable", dicCode = "id")
@Schema(description = "书籍标签")
private java.lang.String booksLabel;
/**书籍作者*/
@Excel(name = "书籍作者", width = 15)
@Schema(description = "书籍作者")
private java.lang.String booksAuthor;
/**作者英文名称*/
@Excel(name = "作者英文名称", width = 15)
@Schema(description = "作者英文名称")
private java.lang.String enAuthor;
/**作者简介*/
@Excel(name = "作者简介", width = 15)
@Schema(description = "作者简介")
private java.lang.String aouthorIntro;
/**作者头像*/
@Excel(name = "作者头像", width = 15)
@Schema(description = "作者头像")
private java.lang.String aouthorImg;
/**上架*/
@Excel(name = "上架", width = 15,replace = {"上架_Y","下架_N"} )
@Excel(name = "上架", width = 15,replace = {"是_Y","否_N"} )
@Schema(description = "上架")
private java.lang.String status;
/**会员*/
@Excel(name = "会员", width = 15)
@Excel(name = "会员", width = 15, dictTable = "applet_vip", dicText = "title", dicCode = "id")
@Dict(dictTable = "applet_vip", dicText = "title", dicCode = "id")
@Schema(description = "会员")
private java.lang.String vip;
/**时长*/
@Excel(name = "时长", width = 15)
@Schema(description = "时长")
private java.lang.String duration;
/**词汇量范围*/
@Excel(name = "词汇量范围", width = 15)
@Schema(description = "词汇量范围")
private java.lang.String vocabularyRange;
/**知识收获*/
@Excel(name = "知识收获", width = 15)
@Schema(description = "知识收获")
private java.lang.String knowledge;
@TableField(exist = false)
@Schema(description = "是否加入书桌")
private Boolean isStand;
@TableField(exist = false)
@Schema(description = "分类名称")
private String categoryName;
@TableField(exist = false)
private AppletVip vipInfo;
}

+ 1
- 1
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/mapper/AppletBooksMapper.java View File

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 书籍表
* @Author: jeecg-boot
* @Date: 2025-09-09
* @Date: 2025-09-17
* @Version: V1.0
*/
public interface AppletBooksMapper extends BaseMapper<AppletBooks> {


+ 1
- 1
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/service/IAppletBooksService.java View File

@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 书籍表
* @Author: jeecg-boot
* @Date: 2025-09-09
* @Date: 2025-09-17
* @Version: V1.0
*/
public interface IAppletBooksService extends IService<AppletBooks> {


+ 1
- 1
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/service/impl/AppletBooksServiceImpl.java View File

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 书籍表
* @Author: jeecg-boot
* @Date: 2025-09-09
* @Date: 2025-09-17
* @Version: V1.0
*/
@Service


+ 46
- 4
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/uniapp/AppletBooksForm.vue View File

@ -16,14 +16,14 @@
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">书籍封面</text></view>
<input placeholder="请输入书籍封面" v-model="model.booksImg"/>
<view class="title"><text space="ensp">英文书名</text></view>
<input placeholder="请输入英文书名" v-model="model.translate"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">书籍作者</text></view>
<input placeholder="请输入书籍作者" v-model="model.booksAuthor"/>
<view class="title"><text space="ensp">书籍封面</text></view>
<input placeholder="请输入书籍封面" v-model="model.booksImg"/>
</view>
</view>
<view class="cu-form-group">
@ -44,6 +44,30 @@
<input placeholder="请输入书籍标签" v-model="model.booksLabel"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">书籍作者</text></view>
<input placeholder="请输入书籍作者" v-model="model.booksAuthor"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">作者英文名称</text></view>
<input placeholder="请输入作者英文名称" v-model="model.enAuthor"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">作者简介</text></view>
<input placeholder="请输入作者简介" v-model="model.aouthorIntro"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">作者头像</text></view>
<input placeholder="请输入作者头像" v-model="model.aouthorImg"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">上架</text></view>
@ -55,6 +79,24 @@
<view class="title"><text space="ensp">会员</text></view>
<input placeholder="请输入会员" v-model="model.vip"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">时长</text></view>
<input placeholder="请输入时长" v-model="model.duration"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">词汇量范围</text></view>
<input placeholder="请输入词汇量范围" v-model="model.vocabularyRange"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">知识收获</text></view>
<input placeholder="请输入知识收获" v-model="model.knowledge"/>
</view>
</view>
<view class="padding">
<button class="cu-btn block bg-blue margin-tb-sm lg" @click="onSubmit">


+ 35
- 9
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/uniapp3/AppletBooksData.ts View File

@ -6,6 +6,11 @@ export const columns = [
align:"center",
dataIndex: 'booksName'
},
{
title: '英文书名',
align:"center",
dataIndex: 'translate'
},
{
title: '书籍封面',
align:"center",
@ -13,24 +18,30 @@ export const columns = [
customRender:render.renderImage,
},
{
title: '书籍作者',
title: '书籍分类',
align:"center",
dataIndex: 'booksAuthor'
dataIndex: 'booksClassification_dictText'
},
{
title: '书籍简介',
title: '书籍标签',
align:"center",
dataIndex: 'booksIntro'
dataIndex: 'booksLabel_dictText'
},
{
title: '书籍分类',
title: '书籍作者',
align:"center",
dataIndex: 'booksClassification'
dataIndex: 'booksAuthor'
},
{
title: '书籍标签',
title: '作者英文名称',
align:"center",
dataIndex: 'enAuthor'
},
{
title: '作者头像',
align:"center",
dataIndex: 'booksLabel'
dataIndex: 'aouthorImg',
customRender:render.renderImage,
},
{
title: '上架',
@ -43,6 +54,21 @@ export const columns = [
{
title: '会员',
align:"center",
dataIndex: 'vip'
dataIndex: 'vip_dictText'
},
{
title: '时长',
align:"center",
dataIndex: 'duration'
},
{
title: '词汇量范围',
align:"center",
dataIndex: 'vocabularyRange'
},
{
title: '知识收获',
align:"center",
dataIndex: 'knowledge'
},
];

+ 109
- 31
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/uniapp3/AppletBooksForm.vue View File

@ -27,6 +27,19 @@ navigationBarTitleText: '书籍表',
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['translate']"
:label="get4Label('英文书名')"
name='translate'
prop='translate'
placeholder="请选择英文书名"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<!-- 图片 -->
<wd-cell
:title="get4Label('书籍封面')"
@ -37,6 +50,38 @@ navigationBarTitleText: '书籍表',
name='booksImg'
/>
</wd-cell>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<wd-textarea
:label="get4Label('书籍简介')"
labelWidth="100px"
type="umeditor"
name='booksIntro'
prop='booksIntro'
clearable
:maxlength="300"
v-model="myFormData['booksIntro']"
></wd-textarea>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<online-select
:label="get4Label('书籍分类')"
labelWidth="100px"
type="sel_search"
name='booksClassification'
dict="applet_categorize,title,id"
v-model="myFormData['booksClassification']"
></online-select>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<online-multi
:label="get4Label('书籍标签')"
labelWidth="100px"
type="list_multi"
name='booksLabel'
dict="applet_label,lable,id"
v-model="myFormData['booksLabel']"
></online-multi>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
@ -54,41 +99,39 @@ navigationBarTitleText: '书籍表',
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['booksIntro']"
:label="get4Label('书籍简介')"
name='booksIntro'
prop='booksIntro'
placeholder="请选择书籍简介"
v-model="myFormData['enAuthor']"
:label="get4Label('作者英文名称')"
name='enAuthor'
prop='enAuthor'
placeholder="请选择作者英文名称"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['booksClassification']"
:label="get4Label('书籍分类')"
name='booksClassification'
prop='booksClassification'
placeholder="请选择书籍分类"
:rules="[
]"
clearable
/>
<wd-textarea
:label="get4Label('作者简介')"
labelWidth="100px"
type="umeditor"
name='aouthorIntro'
prop='aouthorIntro'
clearable
:maxlength="300"
v-model="myFormData['aouthorIntro']"
></wd-textarea>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['booksLabel']"
:label="get4Label('书籍标签')"
name='booksLabel'
prop='booksLabel'
placeholder="请选择书籍标签"
:rules="[
]"
clearable
<!-- 图片 -->
<wd-cell
:title="get4Label('作者头像')"
title-width="100px"
>
<online-image
v-model:value="myFormData['aouthorImg']"
name='aouthorImg'
/>
</wd-cell>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<!-- 开关 -->
@ -109,17 +152,52 @@ navigationBarTitleText: '书籍表',
</wd-cell>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<online-select
:label="get4Label('会员')"
labelWidth="100px"
type="list"
name='vip'
dict="applet_vip,title,id"
v-model="myFormData['vip']"
></online-select>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['vip']"
:label="get4Label('会员')"
name='vip'
prop='vip'
placeholder="请选择会员"
v-model="myFormData['duration']"
:label="get4Label('时长')"
name='duration'
prop='duration'
placeholder="请选择时长"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['vocabularyRange']"
:label="get4Label('词汇量范围')"
name='vocabularyRange'
prop='vocabularyRange'
placeholder="请选择词汇量范围"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-textarea
:label="get4Label('知识收获')"
labelWidth="100px"
type="textarea"
name='knowledge'
prop='knowledge'
clearable
:maxlength="300"
v-model="myFormData['knowledge']"
></wd-textarea>
</view>
</wd-cell-group>
</wd-form>


+ 101
- 23
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/vue3/AppletBooks.data.ts View File

@ -10,6 +10,11 @@ export const columns: BasicColumn[] = [
align:"center",
dataIndex: 'booksName'
},
{
title: '英文书名',
align:"center",
dataIndex: 'translate'
},
{
title: '书籍封面',
align:"center",
@ -17,24 +22,30 @@ export const columns: BasicColumn[] = [
customRender:render.renderImage,
},
{
title: '书籍作者',
title: '书籍分类',
align:"center",
dataIndex: 'booksAuthor'
dataIndex: 'booksClassification_dictText'
},
{
title: '书籍简介',
title: '书籍标签',
align:"center",
dataIndex: 'booksIntro'
dataIndex: 'booksLabel_dictText'
},
{
title: '书籍分类',
title: '书籍作者',
align:"center",
dataIndex: 'booksClassification'
dataIndex: 'booksAuthor'
},
{
title: '书籍标签',
title: '作者英文名称',
align:"center",
dataIndex: 'booksLabel'
dataIndex: 'enAuthor'
},
{
title: '作者头像',
align:"center",
dataIndex: 'aouthorImg',
customRender:render.renderImage,
},
{
title: '上架',
@ -47,7 +58,22 @@ export const columns: BasicColumn[] = [
{
title: '会员',
align:"center",
dataIndex: 'vip'
dataIndex: 'vip_dictText'
},
{
title: '时长',
align:"center",
dataIndex: 'duration'
},
{
title: '词汇量范围',
align:"center",
dataIndex: 'vocabularyRange'
},
{
title: '知识收获',
align:"center",
dataIndex: 'knowledge'
},
];
//查询数据
@ -60,6 +86,11 @@ export const formSchema: FormSchema[] = [
field: 'booksName',
component: 'Input',
},
{
label: '英文书名',
field: 'translate',
component: 'Input',
},
{
label: '书籍封面',
field: 'booksImg',
@ -68,26 +99,50 @@ export const formSchema: FormSchema[] = [
fileMax: 0
},
},
{
label: '书籍作者',
field: 'booksAuthor',
component: 'Input',
},
{
label: '书籍简介',
field: 'booksIntro',
component: 'Input',
component: 'JEditor',
},
{
label: '书籍分类',
field: 'booksClassification',
component: 'Input',
component: 'JSearchSelect',
componentProps:{
dict:"applet_categorize,title,id"
},
},
{
label: '书籍标签',
field: 'booksLabel',
component: 'JSelectMultiple',
componentProps:{
dictCode:"applet_label,lable,id"
},
},
{
label: '书籍作者',
field: 'booksAuthor',
component: 'Input',
},
{
label: '作者英文名称',
field: 'enAuthor',
component: 'Input',
},
{
label: '作者简介',
field: 'aouthorIntro',
component: 'JEditor',
},
{
label: '作者头像',
field: 'aouthorImg',
component: 'JImageUpload',
componentProps:{
fileMax: 0
},
},
{
label: '上架',
field: 'status',
@ -98,7 +153,25 @@ export const formSchema: FormSchema[] = [
{
label: '会员',
field: 'vip',
component: 'JDictSelectTag',
componentProps:{
dictCode:"applet_vip,title,id"
},
},
{
label: '时长',
field: 'duration',
component: 'Input',
},
{
label: '词汇量范围',
field: 'vocabularyRange',
component: 'Input',
},
{
label: '知识收获',
field: 'knowledge',
component: 'InputTextArea',
},
// TODO 主键隐藏字段,目前写死为ID
{
@ -112,13 +185,18 @@ export const formSchema: FormSchema[] = [
// 高级查询数据
export const superQuerySchema = {
booksName: {title: '书籍名称',order: 0,view: 'text', type: 'string',},
booksImg: {title: '书籍封面',order: 1,view: 'image', type: 'string',},
booksAuthor: {title: '书籍作者',order: 2,view: 'text', type: 'string',},
booksIntro: {title: '书籍简介',order: 3,view: 'text', type: 'string',},
booksClassification: {title: '书籍分类',order: 4,view: 'text', type: 'string',},
booksLabel: {title: '书籍标签',order: 5,view: 'text', type: 'string',},
status: {title: '上架',order: 6,view: 'switch', type: 'string',},
vip: {title: '会员',order: 7,view: 'text', type: 'string',},
translate: {title: '英文书名',order: 1,view: 'text', type: 'string',},
booksImg: {title: '书籍封面',order: 2,view: 'image', type: 'string',},
booksClassification: {title: '书籍分类',order: 4,view: 'sel_search', type: 'string',dictTable: "applet_categorize", dictCode: 'id', dictText: 'title',},
booksLabel: {title: '书籍标签',order: 5,view: 'list_multi', type: 'string',dictTable: "applet_label", dictCode: 'id', dictText: 'lable',},
booksAuthor: {title: '书籍作者',order: 6,view: 'text', type: 'string',},
enAuthor: {title: '作者英文名称',order: 7,view: 'text', type: 'string',},
aouthorImg: {title: '作者头像',order: 9,view: 'image', type: 'string',},
status: {title: '上架',order: 10,view: 'switch', type: 'string',},
vip: {title: '会员',order: 11,view: 'list', type: 'string',dictTable: "applet_vip", dictCode: 'id', dictText: 'title',},
duration: {title: '时长',order: 12,view: 'text', type: 'string',},
vocabularyRange: {title: '词汇量范围',order: 13,view: 'text', type: 'string',},
knowledge: {title: '知识收获',order: 14,view: 'textarea', type: 'string',},
};
/**


+ 8
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/vue3/AppletBooksList.vue View File

@ -30,6 +30,14 @@
</template>
<!--字段回显插槽-->
<template v-slot:bodyCell="{ column, record, index, text }">
<template v-if="column.dataIndex==='booksIntro'">
<!--富文本件字段回显插槽-->
<div v-html="text"></div>
</template>
<template v-if="column.dataIndex==='aouthorIntro'">
<!--富文本件字段回显插槽-->
<div v-html="text"></div>
</template>
</template>
</BasicTable>
<!-- 表单区域 -->


+ 26
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletBooks/vue3/V20250917_1__menu_insert_AppletBooks.sql View File

@ -0,0 +1,26 @@
-- 注意:该页面对应的前台目录为views/appletBooks文件夹下
-- 如果你想更改到其他目录,请修改sql中component字段对应的值
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('2025091704483130190', NULL, '书籍表', '/appletBooks/appletBooksList', 'appletBooks/AppletBooksList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-09-17 16:48:19', NULL, NULL, 0);
-- 权限控制sql
-- 新增
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091704483130191', '2025091704483130190', '添加书籍表', NULL, NULL, 0, NULL, NULL, 2, 'appletBooks:applet_books:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-17 16:48:19', NULL, NULL, 0, 0, '1', 0);
-- 编辑
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091704483130192', '2025091704483130190', '编辑书籍表', NULL, NULL, 0, NULL, NULL, 2, 'appletBooks:applet_books:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-17 16:48:19', NULL, NULL, 0, 0, '1', 0);
-- 删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091704483130193', '2025091704483130190', '删除书籍表', NULL, NULL, 0, NULL, NULL, 2, 'appletBooks:applet_books:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-17 16:48:19', NULL, NULL, 0, 0, '1', 0);
-- 批量删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091704483140194', '2025091704483130190', '批量删除书籍表', NULL, NULL, 0, NULL, NULL, 2, 'appletBooks:applet_books:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-17 16:48:19', NULL, NULL, 0, 0, '1', 0);
-- 导出excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091704483140195', '2025091704483130190', '导出excel_书籍表', NULL, NULL, 0, NULL, NULL, 2, 'appletBooks:applet_books:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-17 16:48:19', NULL, NULL, 0, 0, '1', 0);
-- 导入excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091704483140196', '2025091704483130190', '导入excel_书籍表', NULL, NULL, 0, NULL, NULL, 2, 'appletBooks:applet_books:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-17 16:48:19', NULL, NULL, 0, 0, '1', 0);

+ 26
- 3
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoupon/controller/AppletCouponController.java View File

@ -14,6 +14,7 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.applet.entity.SendCouponEntity;
import org.jeecg.modules.demo.appletCoupon.entity.AppletCoupon;
import org.jeecg.modules.demo.appletCoupon.service.IAppletCouponService;
@ -41,7 +42,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: 优惠卷
* @Author: jeecg-boot
* @Date: 2025-09-11
* @Date: 2025-09-17
* @Version: V1.0
*/
@Tag(name="优惠卷")
@ -69,8 +70,11 @@ public class AppletCouponController extends JeecgController<AppletCoupon, IApple
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AppletCoupon> queryWrapper = QueryGenerator.initQueryWrapper(appletCoupon, req.getParameterMap());
// 自定义查询规则
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
// 自定义name字段的查询规则为LIKE模糊搜索
customeRuleMap.put("name", QueryRuleEnum.LIKE);
QueryWrapper<AppletCoupon> queryWrapper = QueryGenerator.initQueryWrapper(appletCoupon, req.getParameterMap(), customeRuleMap);
Page<AppletCoupon> page = new Page<AppletCoupon>(pageNo, pageSize);
IPage<AppletCoupon> pageList = appletCouponService.page(page, queryWrapper);
return Result.OK(pageList);
@ -179,4 +183,23 @@ public class AppletCouponController extends JeecgController<AppletCoupon, IApple
return super.importExcel(request, response, AppletCoupon.class);
}
/**
* 优惠券发放
*
* @return
*/
@AutoLog(value = "优惠券-发放")
@Operation(summary="优惠券-发放")
@RequiresPermissions("appletCoupon:applet_coupon:distribute")
@PostMapping(value = "/distribute")
public Result<String> distributeCoupon(@RequestBody SendCouponEntity entity) {
try {
appletCouponService.distributeCoupon(entity.getCouponId(), entity.getUserIds());
return Result.OK("优惠券发放成功!");
} catch (Exception e) {
log.error("优惠券发放失败", e);
return Result.error("优惠券发放失败:" + e.getMessage());
}
}
}

+ 3
- 3
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoupon/entity/AppletCoupon.java View File

@ -22,7 +22,7 @@ import lombok.experimental.Accessors;
/**
* @Description: 优惠卷
* @Author: jeecg-boot
* @Date: 2025-09-11
* @Date: 2025-09-17
* @Version: V1.0
*/
@Data
@ -73,9 +73,9 @@ public class AppletCoupon implements Serializable {
/**发放数量*/
@Excel(name = "发放数量", width = 15)
@Schema(description = "发放数量")
private java.lang.String count;
private java.lang.Integer count;
/**已使用数量*/
@Excel(name = "已使用数量", width = 15)
@Schema(description = "已使用数量")
private java.lang.String quantityused;
private java.lang.Integer quantityused;
}

+ 1
- 1
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoupon/mapper/AppletCouponMapper.java View File

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 优惠卷
* @Author: jeecg-boot
* @Date: 2025-09-11
* @Date: 2025-09-17
* @Version: V1.0
*/
public interface AppletCouponMapper extends BaseMapper<AppletCoupon> {


+ 15
- 3
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoupon/service/IAppletCouponService.java View File

@ -2,16 +2,28 @@ package org.jeecg.modules.demo.appletCoupon.service;
import org.jeecg.modules.demo.appletCoupon.entity.AppletCoupon;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
import org.jeecg.modules.demo.appletCouponRecord.entity.AppletCouponRecord;
/**
* @Description: 优惠卷
* @Author: jeecg-boot
* @Date: 2025-09-11
* @Date: 2025-09-17
* @Version: V1.0
*/
public interface IAppletCouponService extends IService<AppletCoupon> {
/**
* 优惠券发放
* @param couponId 优惠券ID
* @param userIds 用户ID列表为空表示发放给所有用户
*/
void distributeCoupon(String couponId, String userIds);
/**
* 优惠券核销
* @param recordId 优惠券记录ID
* @param userId 用户ID
*/
AppletCouponRecord useCoupon(String recordId, String userId);
}

+ 110
- 1
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoupon/service/impl/AppletCouponServiceImpl.java View File

@ -1,19 +1,128 @@
package org.jeecg.modules.demo.appletCoupon.service.impl;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.modules.demo.appletCoupon.entity.AppletCoupon;
import org.jeecg.modules.demo.appletCoupon.mapper.AppletCouponMapper;
import org.jeecg.modules.demo.appletCoupon.service.IAppletCouponService;
import org.jeecg.modules.demo.appletCouponRecord.entity.AppletCouponRecord;
import org.jeecg.modules.demo.appletCouponRecord.service.IAppletCouponRecordService;
import org.jeecg.common.system.vo.AppletUser;
import org.jeecg.common.api.IAppletUserService;
import org.jeecg.common.util.oConvertUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* @Description: 优惠卷
* @Author: jeecg-boot
* @Date: 2025-09-11
* @Date: 2025-09-17
* @Version: V1.0
*/
@Service
public class AppletCouponServiceImpl extends ServiceImpl<AppletCouponMapper, AppletCoupon> implements IAppletCouponService {
@Autowired
private IAppletCouponRecordService appletCouponRecordService;
@Autowired
private IAppletUserService appletUserService;
@Override
@Transactional(rollbackFor = Exception.class)
public void distributeCoupon(String couponId, String userIds) {
// 获取优惠券信息
AppletCoupon coupon = this.getById(couponId);
if (coupon == null) {
throw new RuntimeException("优惠券不存在");
}
List<AppletUser> targetUsers;
// 如果userIds为空发放给所有用户
if (oConvertUtils.isEmpty(userIds)) {
targetUsers = appletUserService.list();
} else {
// 发放给指定用户
List<String> userIdList = Arrays.asList(userIds.split(","));
targetUsers = appletUserService.listByIds(userIdList);
}
if (targetUsers.isEmpty()) {
throw new RuntimeException("没有找到目标用户");
}
// 批量创建发放记录
for (AppletUser user : targetUsers) {
// 检查用户是否已经领取过该优惠券
// long existCount = appletCouponRecordService.lambdaQuery()
// .eq(AppletCouponRecord::getName, coupon.getName())
// .eq(AppletCouponRecord::getUserId, user.getId())
// .count();
//
// if (existCount > 0) {
// continue; // 已经领取过跳过
// }
AppletCouponRecord record = new AppletCouponRecord();
record.setName(coupon.getName());
record.setMoney(coupon.getMoney());
record.setEndTime(coupon.getEndTime());
record.setUserId(user.getId());
record.setStatus("0"); // 0-未使用
record.setCreateTime(new Date());
record.setCouponId(couponId);
appletCouponRecordService.save(record);
}
coupon.setCount(coupon.getCount() + targetUsers.size());
updateById(coupon);
}
@Override
@Transactional(rollbackFor = Exception.class)
public AppletCouponRecord useCoupon(String recordId, String userId) {
// 获取优惠券记录
AppletCouponRecord record = appletCouponRecordService.getById(recordId);
if (record == null) {
throw new JeecgBootException("优惠券不存在");
}
// 验证用户是否有权限使用该优惠券
if (!userId.equals(record.getUserId())) {
throw new JeecgBootException("无权限使用该优惠券");
}
// 检查优惠券状态
if (!"0".equals(record.getStatus())) {
throw new JeecgBootException("优惠券已使用或已过期");
}
// 检查优惠券是否过期
if (record.getEndTime() != null && record.getEndTime().before(new Date())) {
throw new JeecgBootException("优惠券已过期");
}
// 更新优惠券记录状态为已使用
record.setStatus("1"); // 1-已使用
record.setUpdateTime(new Date());
appletCouponRecordService.updateById(record);
// 更新优惠券的已使用数量
AppletCoupon coupon = this.getById(record.getCouponId());
if (coupon != null) {
coupon.setQuantityused(coupon.getQuantityused() == null ? 1 : coupon.getQuantityused() + 1);
this.updateById(coupon);
}
return record;
}
}

+ 26
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoupon/vue3/V20250917_1__menu_insert_AppletCoupon.sql View File

@ -0,0 +1,26 @@
-- 注意:该页面对应的前台目录为views/appletCoupon文件夹下
-- 如果你想更改到其他目录,请修改sql中component字段对应的值
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('2025091705509840420', NULL, '优惠卷', '/appletCoupon/appletCouponList', 'appletCoupon/AppletCouponList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-09-17 17:50:42', NULL, NULL, 0);
-- 权限控制sql
-- 新增
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091705509840421', '2025091705509840420', '添加优惠卷', NULL, NULL, 0, NULL, NULL, 2, 'appletCoupon:applet_coupon:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-17 17:50:42', NULL, NULL, 0, 0, '1', 0);
-- 编辑
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091705509840422', '2025091705509840420', '编辑优惠卷', NULL, NULL, 0, NULL, NULL, 2, 'appletCoupon:applet_coupon:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-17 17:50:42', NULL, NULL, 0, 0, '1', 0);
-- 删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091705509840423', '2025091705509840420', '删除优惠卷', NULL, NULL, 0, NULL, NULL, 2, 'appletCoupon:applet_coupon:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-17 17:50:42', NULL, NULL, 0, 0, '1', 0);
-- 批量删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091705509840424', '2025091705509840420', '批量删除优惠卷', NULL, NULL, 0, NULL, NULL, 2, 'appletCoupon:applet_coupon:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-17 17:50:42', NULL, NULL, 0, 0, '1', 0);
-- 导出excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091705509840425', '2025091705509840420', '导出excel_优惠卷', NULL, NULL, 0, NULL, NULL, 2, 'appletCoupon:applet_coupon:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-17 17:50:42', NULL, NULL, 0, 0, '1', 0);
-- 导入excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091705509840426', '2025091705509840420', '导入excel_优惠卷', NULL, NULL, 0, NULL, NULL, 2, 'appletCoupon:applet_coupon:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-17 17:50:42', NULL, NULL, 0, 0, '1', 0);

+ 186
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/controller/AppletCouponRecordController.java View File

@ -0,0 +1,186 @@
package org.jeecg.modules.demo.appletCouponRecord.controller;
import java.util.Arrays;
import java.util.HashMap;
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.system.query.QueryRuleEnum;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.appletCouponRecord.entity.AppletCouponRecord;
import org.jeecg.modules.demo.appletCouponRecord.service.IAppletCouponRecordService;
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.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: 优惠卷领取记录
* @Author: jeecg-boot
* @Date: 2025-09-17
* @Version: V1.0
*/
@Tag(name="优惠卷领取记录")
@RestController
@RequestMapping("/appletCouponRecord/appletCouponRecord")
@Slf4j
public class AppletCouponRecordController extends JeecgController<AppletCouponRecord, IAppletCouponRecordService> {
@Autowired
private IAppletCouponRecordService appletCouponRecordService;
/**
* 分页列表查询
*
* @param appletCouponRecord
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "优惠卷领取记录-分页列表查询")
@Operation(summary="优惠卷领取记录-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AppletCouponRecord>> queryPageList(AppletCouponRecord appletCouponRecord,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
// 自定义查询规则
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
// 自定义多选的查询规则为LIKE_WITH_OR
customeRuleMap.put("status", QueryRuleEnum.LIKE_WITH_OR);
QueryWrapper<AppletCouponRecord> queryWrapper = QueryGenerator.initQueryWrapper(appletCouponRecord, req.getParameterMap(),customeRuleMap);
Page<AppletCouponRecord> page = new Page<AppletCouponRecord>(pageNo, pageSize);
IPage<AppletCouponRecord> pageList = appletCouponRecordService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param appletCouponRecord
* @return
*/
@AutoLog(value = "优惠卷领取记录-添加")
@Operation(summary="优惠卷领取记录-添加")
@RequiresPermissions("appletCouponRecord:applet_coupon_record:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AppletCouponRecord appletCouponRecord) {
appletCouponRecordService.save(appletCouponRecord);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param appletCouponRecord
* @return
*/
@AutoLog(value = "优惠卷领取记录-编辑")
@Operation(summary="优惠卷领取记录-编辑")
@RequiresPermissions("appletCouponRecord:applet_coupon_record:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody AppletCouponRecord appletCouponRecord) {
appletCouponRecordService.updateById(appletCouponRecord);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "优惠卷领取记录-通过id删除")
@Operation(summary="优惠卷领取记录-通过id删除")
@RequiresPermissions("appletCouponRecord:applet_coupon_record:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
appletCouponRecordService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "优惠卷领取记录-批量删除")
@Operation(summary="优惠卷领取记录-批量删除")
@RequiresPermissions("appletCouponRecord:applet_coupon_record:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.appletCouponRecordService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "优惠卷领取记录-通过id查询")
@Operation(summary="优惠卷领取记录-通过id查询")
@GetMapping(value = "/queryById")
public Result<AppletCouponRecord> queryById(@RequestParam(name="id",required=true) String id) {
AppletCouponRecord appletCouponRecord = appletCouponRecordService.getById(id);
if(appletCouponRecord==null) {
return Result.error("未找到对应数据");
}
return Result.OK(appletCouponRecord);
}
/**
* 导出excel
*
* @param request
* @param appletCouponRecord
*/
@RequiresPermissions("appletCouponRecord:applet_coupon_record:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, AppletCouponRecord appletCouponRecord) {
return super.exportXls(request, appletCouponRecord, AppletCouponRecord.class, "优惠卷领取记录");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("appletCouponRecord:applet_coupon_record:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, AppletCouponRecord.class);
}
}

+ 85
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/entity/AppletCouponRecord.java View File

@ -0,0 +1,85 @@
package org.jeecg.modules.demo.appletCouponRecord.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
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.v3.oas.annotations.media.Schema;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 优惠卷领取记录
* @Author: jeecg-boot
* @Date: 2025-09-17
* @Version: V1.0
*/
@Data
@TableName("applet_coupon_record")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description="优惠卷领取记录")
public class AppletCouponRecord implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private java.lang.String id;
/**创建人*/
@Schema(description = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建日期")
private java.util.Date createTime;
/**更新人*/
@Schema(description = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@Schema(description = "所属部门")
private java.lang.String sysOrgCode;
/**优惠券名称*/
@Excel(name = "优惠券名称", width = 15)
@Schema(description = "优惠券名称")
private java.lang.String name;
/**面额*/
@Excel(name = "面额", width = 15)
@Schema(description = "面额")
private java.math.BigDecimal money;
/**有效期*/
@Excel(name = "有效期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "有效期")
private java.util.Date endTime;
/**领取用户*/
@Excel(name = "领取用户", width = 15)
@Schema(description = "领取用户")
private java.lang.String userId;
/**状态*/
@Excel(name = "状态", width = 15, dicCode = "applet_coupon_record_status")
@Dict(dicCode = "applet_coupon_record_status")
@Schema(description = "状态")
private java.lang.String status;
/**优惠卷*/
@Schema(description = "优惠卷")
private java.lang.String couponId;
}

+ 17
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/mapper/AppletCouponRecordMapper.java View File

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.appletCouponRecord.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.appletCouponRecord.entity.AppletCouponRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 优惠卷领取记录
* @Author: jeecg-boot
* @Date: 2025-09-17
* @Version: V1.0
*/
public interface AppletCouponRecordMapper extends BaseMapper<AppletCouponRecord> {
}

+ 5
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/mapper/xml/AppletCouponRecordMapper.xml View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.appletCouponRecord.mapper.AppletCouponRecordMapper">
</mapper>

+ 14
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/service/IAppletCouponRecordService.java View File

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.appletCouponRecord.service;
import org.jeecg.modules.demo.appletCouponRecord.entity.AppletCouponRecord;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 优惠卷领取记录
* @Author: jeecg-boot
* @Date: 2025-09-17
* @Version: V1.0
*/
public interface IAppletCouponRecordService extends IService<AppletCouponRecord> {
}

+ 19
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/service/impl/AppletCouponRecordServiceImpl.java View File

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.appletCouponRecord.service.impl;
import org.jeecg.modules.demo.appletCouponRecord.entity.AppletCouponRecord;
import org.jeecg.modules.demo.appletCouponRecord.mapper.AppletCouponRecordMapper;
import org.jeecg.modules.demo.appletCouponRecord.service.IAppletCouponRecordService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 优惠卷领取记录
* @Author: jeecg-boot
* @Date: 2025-09-17
* @Version: V1.0
*/
@Service
public class AppletCouponRecordServiceImpl extends ServiceImpl<AppletCouponRecordMapper, AppletCouponRecord> implements IAppletCouponRecordService {
}

+ 102
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/uniapp/AppletCouponRecordForm.vue View File

@ -0,0 +1,102 @@
<template>
<view>
<!--标题和返回-->
<cu-custom :bgColor="NavBarColor" isBack :backRouterName="backRouteName">
<block slot="backText">返回</block>
<block slot="content">优惠卷领取记录</block>
</cu-custom>
<!--表单区域-->
<view>
<form>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">优惠券名称</text></view>
<input placeholder="请输入优惠券名称" v-model="model.name"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">面额</text></view>
<input type="number" placeholder="请输入面额" v-model="model.money"/>
</view>
</view>
<my-date label="有效期:" v-model="model.endTime" placeholder="请输入有效期"></my-date>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">领取用户</text></view>
<input placeholder="请输入领取用户" v-model="model.userId"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">状态</text></view>
<input placeholder="请输入状态" v-model="model.status"/>
</view>
</view>
<view class="padding">
<button class="cu-btn block bg-blue margin-tb-sm lg" @click="onSubmit">
<text v-if="loading" class="cuIcon-loading2 cuIconfont-spin"></text>提交
</button>
</view>
</form>
</view>
</view>
</template>
<script>
import myDate from '@/components/my-componets/my-date.vue'
export default {
name: "AppletCouponRecordForm",
components:{ myDate },
props:{
formData:{
type:Object,
default:()=>{},
required:false
}
},
data(){
return {
CustomBar: this.CustomBar,
NavBarColor: this.NavBarColor,
loading:false,
model: {},
backRouteName:'index',
url: {
queryById: "/appletCouponRecord/appletCouponRecord/queryById",
add: "/appletCouponRecord/appletCouponRecord/add",
edit: "/appletCouponRecord/appletCouponRecord/edit",
},
}
},
created(){
this.initFormData();
},
methods:{
initFormData(){
if(this.formData){
let dataId = this.formData.dataId;
this.$http.get(this.url.queryById,{params:{id:dataId}}).then((res)=>{
if(res.data.success){
console.log("表单数据",res);
this.model = res.data.result;
}
})
}
},
onSubmit() {
let myForm = {...this.model};
this.loading = true;
let url = myForm.id?this.url.edit:this.url.add;
this.$http.post(url,myForm).then(res=>{
console.log("res",res)
this.loading = false
this.$Router.push({name:this.backRouteName})
}).catch(()=>{
this.loading = false
});
}
}
}
</script>

+ 44
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/uniapp/AppletCouponRecordList.vue View File

@ -0,0 +1,44 @@
<template>
<view>
<!--标题和返回-->
<cu-custom :bgColor="NavBarColor" isBack>
<block slot="backText">返回</block>
<block slot="content">优惠卷领取记录</block>
</cu-custom>
<!--滚动加载列表-->
<mescroll-body ref="mescrollRef" bottom="88" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback" @up="upCallback">
<view class="cu-list menu">
<view class="cu-item" v-for="(item,index) in list" :key="index" @click="goHome">
<view class="flex" style="width:100%">
<text class="text-lg" style="color: #000;">
{{ item.createBy}}
</text>
</view>
</view>
</view>
</mescroll-body>
</view>
</template>
<script>
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import Mixin from "@/common/mixin/Mixin.js";
export default {
name: '优惠卷领取记录',
mixins: [MescrollMixin,Mixin],
data() {
return {
CustomBar:this.CustomBar,
NavBarColor:this.NavBarColor,
url: "/appletCouponRecord/appletCouponRecord/list",
};
},
methods: {
goHome(){
this.$Router.push({name: "index"})
}
}
}
</script>

+ 29
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/uniapp3/AppletCouponRecordData.ts View File

@ -0,0 +1,29 @@
import { render } from '@/common/renderUtils';
//列表数据
export const columns = [
{
title: '优惠券名称',
align:"center",
dataIndex: 'name'
},
{
title: '面额',
align:"center",
dataIndex: 'money'
},
{
title: '有效期',
align:"center",
dataIndex: 'endTime'
},
{
title: '领取用户',
align:"center",
dataIndex: 'userId_dictText'
},
{
title: '状态',
align:"center",
dataIndex: 'status_dictText'
},
];

+ 253
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/uniapp3/AppletCouponRecordForm.vue View File

@ -0,0 +1,253 @@
<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationStyle: 'custom',
navigationBarTitleText: '优惠卷领取记录',
},
}
</route>
<template>
<PageLayout :navTitle="navTitle" :backRouteName="backRouteName">
<scroll-view class="scrollArea" scroll-y>
<view class="form-container">
<wd-form ref="form" :model="myFormData">
<wd-cell-group border>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['name']"
:label="get4Label('优惠券名称')"
name='name'
prop='name'
placeholder="请选择优惠券名称"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['money']"
:label="get4Label('面额')"
name='money'
prop='money'
placeholder="请选择面额"
inputMode="numeric"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<DateTime
:label="get4Label('有效期')"
labelWidth="100px"
type="datetime"
format="YYYY-MM-DD HH:mm:ss"
name='endTime'
v-model="myFormData['endTime']"
></DateTime>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<online-select
:label="get4Label('领取用户')"
labelWidth="100px"
type="sel_search"
name='userId'
dict=""
v-model="myFormData['userId']"
></online-select>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<online-radio
:label="get4Label('状态')"
labelWidth="100px"
type="radio"
name='status'
dict="applet_coupon_record_status"
v-model="myFormData['status']"
></online-radio>
</view>
</wd-cell-group>
</wd-form>
</view>
</scroll-view>
<view class="footer">
<wd-button :disabled="loading" block :loading="loading" @click="handleSubmit">提交</wd-button>
</view>
</PageLayout>
</template>
<script lang="ts" setup>
import { onLoad } from '@dcloudio/uni-app'
import { http } from '@/utils/http'
import { useToast } from 'wot-design-uni'
import { useRouter } from '@/plugin/uni-mini-router'
import { ref, onMounted, computed,reactive } from 'vue'
import OnlineImage from '@/components/online/view/online-image.vue'
import OnlineFile from '@/components/online/view/online-file.vue'
import OnlineFileCustom from '@/components/online/view/online-file-custom.vue'
import OnlineSelect from '@/components/online/view/online-select.vue'
import OnlineTime from '@/components/online/view/online-time.vue'
import OnlineDate from '@/components/online/view/online-date.vue'
import OnlineRadio from '@/components/online/view/online-radio.vue'
import OnlineCheckbox from '@/components/online/view/online-checkbox.vue'
import OnlineMulti from '@/components/online/view/online-multi.vue'
import OnlinePopupLinkRecord from '@/components/online/view/online-popup-link-record.vue'
import OnlinePca from '@/components/online/view/online-pca.vue'
import SelectDept from '@/components/SelectDept/SelectDept.vue'
import SelectUser from '@/components/SelectUser/SelectUser.vue'
import {duplicateCheck} from "@/service/api";
defineOptions({
name: 'AppletCouponRecordForm',
options: {
styleIsolation: 'shared',
},
})
const toast = useToast()
const router = useRouter()
const form = ref(null)
//
const myFormData = reactive({})
const loading = ref(false)
const navTitle = ref('新增')
const dataId = ref('')
const backRouteName = ref('AppletCouponRecordList')
// initForm
const initForm = (item) => {
console.log('initForm item', item)
if(item?.dataId){
dataId.value = item.dataId;
navTitle.value = item.dataId?'编辑':'新增';
initData();
}
}
//
const initData = () => {
http.get("/appletCouponRecord/appletCouponRecord/queryById",{id:dataId.value}).then((res) => {
if (res.success) {
let obj = res.result
Object.assign(myFormData, { ...obj })
}else{
toast.error(res?.message || '表单加载失败!')
}
})
}
const handleSuccess = () => {
uni.$emit('refreshList');
router.back()
}
/**
* 校验唯一
* @param values
* @returns {boolean}
*/
async function fieldCheck(values: any) {
const onlyField = [
];
for (const field of onlyField) {
if (values[field]) {
//
const res: any = await duplicateCheck({
tableName: 'applet_coupon_record',
fieldName: field, // 使
fieldVal: values[field],
dataId: values.id,
});
if (!res.success) {
toast.warning(res.message);
return true; //
}
}
}
return false; //
}
//
const handleSubmit = async () => {
//
if (await fieldCheck(myFormData)) {
return
}
let url = dataId.value?'/appletCouponRecord/appletCouponRecord/edit':'/appletCouponRecord/appletCouponRecord/add';
form.value
.validate()
.then(({ valid, errors }) => {
if (valid) {
loading.value = true;
http.post(url,myFormData).then((res) => {
loading.value = false;
if (res.success) {
toast.success('保存成功');
handleSuccess()
}else{
toast.error(res?.message || '表单保存失败!')
}
})
}
})
.catch((error) => {
console.log(error, 'error')
loading.value = false;
})
}
//
const get4Label = computed(() => {
return (label) => {
return label && label.length > 4 ? label.substring(0, 4) : label;
}
})
//
const getFormSchema = computed(() => {
return (dictTable,dictCode,dictText) => {
return {
dictCode,
dictTable,
dictText
};
}
})
/**
* 获取日期控件的扩展类型
* @param picker
* @returns {string}
*/
const getDateExtendType = (picker: string) => {
let mapField = {
month: 'year-month',
year: 'year',
quarter: 'quarter',
week: 'week',
day: 'date',
}
return picker && mapField[picker]
? mapField[picker]
: 'date'
}
//pop
const setFieldsValue = (data) => {
Object.assign(myFormData, {...data })
}
// onLoad
onLoad((option) => {
initForm(option)
})
</script>
<style lang="scss" scoped>
.footer {
width: 100%;
padding: 10px 20px;
padding-bottom: calc(constant(safe-area-inset-bottom) + 10px);
padding-bottom: calc(env(safe-area-inset-bottom) + 10px);
}
:deep(.wd-cell__label) {
font-size: 14px;
color: #444;
}
:deep(.wd-cell__value) {
text-align: left;
}
</style>

+ 148
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/uniapp3/AppletCouponRecordList.vue View File

@ -0,0 +1,148 @@
<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationBarTitleText: '优惠卷领取记录',
navigationStyle: 'custom',
},
}
</route>
<template>
<PageLayout navTitle="优惠卷领取记录" backRouteName="index" routeMethod="pushTab">
<view class="wrap">
<z-paging
ref="paging"
:fixed="false"
v-model="dataList"
@query="queryList"
:default-page-size="15"
>
<template v-for="item in dataList" :key="item.id">
<wd-swipe-action>
<view class="list" @click="handleEdit(item)">
<template v-for="(cItem, cIndex) in columns" :key="cIndex">
<view v-if="cIndex < 3" class="box" :style="getBoxStyle">
<view class="field ellipsis">{{ cItem.title }}</view>
<view class="value cu-text-grey">{{ item[cItem.dataIndex] }}</view>
</view>
</template>
</view>
<template #right>
<view class="action">
<view class="button" @click="handleAction('del', item)">删除</view>
</view>
</template>
</wd-swipe-action>
</template>
</z-paging>
<view class="add u-iconfont u-icon-add" @click="handleAdd"></view>
</view>
</PageLayout>
</template>
<script setup lang="ts">
import { ref, onMounted, computed } from 'vue'
import { http } from '@/utils/http'
import usePageList from '@/hooks/usePageList'
import {columns} from './AppletCouponRecordData';
defineOptions({
name: 'AppletCouponRecordList',
options: {
styleIsolation: 'shared',
}
})
//
let { toast, router, paging, dataList, queryList } = usePageList('/appletCouponRecord/appletCouponRecord/list');
//
const getBoxStyle = computed(() => {
return { width: "calc(33% - 5px)" }
})
//
const handleAction = (val, item) => {
if (val == 'del') {
http.delete("/appletCouponRecord/appletCouponRecord/delete?id="+item.id,{id:item.id}).then((res) => {
toast.success('删除成功~')
paging.value.reload()
})
}
}
// go
const handleAdd = () => {
router.push({
name: 'AppletCouponRecordForm'
})
}
//go
const handleEdit = (record) => {
router.push({
name: 'AppletCouponRecordForm',
params: {dataId: record.id},
})
}
onMounted(() => {
//
uni.$on('refreshList', () => {
queryList(1,10)
})
})
</script>
<style lang="scss" scoped>
.wrap {
height: 100%;
}
:deep(.wd-swipe-action) {
margin-top: 10px;
background-color: #fff;
}
.list {
padding: 10px 10px;
width: 100%;
text-align: left;
display: flex;
justify-content: space-between;
.box {
width: 33%;
.field {
margin-bottom: 10px;
line-height: 20px;
}
}
}
.action {
width: 60px;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
.button {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
height: 100%;
color: #fff;
&:first-child {
background-color: #fa4350;
}
}
}
.add {
height: 70upx;
width: 70upx;
text-align: center;
line-height: 70upx;
background-color: #fff;
border-radius: 50%;
position: fixed;
bottom: 80upx;
right: 30upx;
box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1);
color: #666;
}
</style>

+ 64
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/vue3/AppletCouponRecord.api.ts View File

@ -0,0 +1,64 @@
import {defHttp} from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/appletCouponRecord/appletCouponRecord/list',
save='/appletCouponRecord/appletCouponRecord/add',
edit='/appletCouponRecord/appletCouponRecord/edit',
deleteOne = '/appletCouponRecord/appletCouponRecord/delete',
deleteBatch = '/appletCouponRecord/appletCouponRecord/deleteBatch',
importExcel = '/appletCouponRecord/appletCouponRecord/importExcel',
exportXls = '/appletCouponRecord/appletCouponRecord/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) => {
createConfirm({
iconType: 'warning',
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});
}

+ 109
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/vue3/AppletCouponRecord.data.ts View File

@ -0,0 +1,109 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '优惠券名称',
align:"center",
dataIndex: 'name'
},
{
title: '面额',
align:"center",
dataIndex: 'money'
},
{
title: '有效期',
align:"center",
dataIndex: 'endTime'
},
{
title: '领取用户',
align:"center",
dataIndex: 'userId_dictText'
},
{
title: '状态',
align:"center",
dataIndex: 'status_dictText'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "状态",
field: 'status',
component: 'JSelectMultiple',
componentProps:{
dictCode:"applet_coupon_record_status"
},
//colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '优惠券名称',
field: 'name',
component: 'Input',
},
{
label: '面额',
field: 'money',
component: 'InputNumber',
},
{
label: '有效期',
field: 'endTime',
component: 'DatePicker',
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '领取用户',
field: 'userId',
component: 'JSearchSelect',
componentProps:{
dict:""
},
},
{
label: '状态',
field: 'status',
component: 'JDictSelectTag',
componentProps:{
dictCode:"applet_coupon_record_status",
type: "radio"
},
},
// TODO 主键隐藏字段,目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
];
// 高级查询数据
export const superQuerySchema = {
name: {title: '优惠券名称',order: 0,view: 'text', type: 'string',},
money: {title: '面额',order: 1,view: 'number', type: 'number',},
endTime: {title: '有效期',order: 2,view: 'datetime', type: 'string',},
userId: {title: '领取用户',order: 3,view: 'sel_search', type: 'string',dictCode: '',},
status: {title: '状态',order: 4,view: 'radio', type: 'string',dictCode: 'applet_coupon_record_status',},
};
/**
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
return formSchema;
}

+ 206
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/vue3/AppletCouponRecordList.vue View File

@ -0,0 +1,206 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'appletCouponRecord:applet_coupon_record:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="'appletCouponRecord:applet_coupon_record:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'appletCouponRecord:applet_coupon_record:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button v-auth="'appletCouponRecord:applet_coupon_record:deleteBatch'">批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
<!-- 高级查询 -->
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<AppletCouponRecordModal @register="registerModal" @success="handleSuccess"></AppletCouponRecordModal>
</div>
</template>
<script lang="ts" name="appletCouponRecord-appletCouponRecord" setup>
import {ref, reactive, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import AppletCouponRecordModal from './components/AppletCouponRecordModal.vue'
import {columns, searchFormSchema, superQuerySchema} from './AppletCouponRecord.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './AppletCouponRecord.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import { useUserStore } from '/@/store/modules/user';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
//
const fieldPickers = reactive({
});
const queryParam = reactive<any>({});
const checkedKeys = ref<Array<string | number>>([]);
const userStore = useUserStore();
const { createMessage } = useMessage();
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '优惠卷领取记录',
api: list,
columns,
canResize:true,
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToNumber: [
],
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
fixed:'right'
},
beforeFetch: (params) => {
if (params && fieldPickers) {
for (let key in fieldPickers) {
if (params[key]) {
params[key] = getDateByPicker(params[key], fieldPickers[key]);
}
}
}
return Object.assign(params, queryParam);
},
},
exportConfig: {
name:"优惠卷领取记录",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
reload();
}
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'appletCouponRecord:applet_coupon_record:edit'
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'appletCouponRecord:applet_coupon_record:delete'
}
]
}
</script>
<style lang="less" scoped>
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
</style>

+ 26
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/vue3/V20250917_1__menu_insert_AppletCouponRecord.sql View File

@ -0,0 +1,26 @@
-- 注意:该页面对应的前台目录为views/appletCouponRecord文件夹下
-- 如果你想更改到其他目录,请修改sql中component字段对应的值
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('2025091705446840090', NULL, '优惠卷领取记录', '/appletCouponRecord/appletCouponRecordList', 'appletCouponRecord/AppletCouponRecordList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-09-17 17:44:09', NULL, NULL, 0);
-- 权限控制sql
-- 新增
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091705446840091', '2025091705446840090', '添加优惠卷领取记录', NULL, NULL, 0, NULL, NULL, 2, 'appletCouponRecord:applet_coupon_record:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-17 17:44:09', NULL, NULL, 0, 0, '1', 0);
-- 编辑
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091705446840092', '2025091705446840090', '编辑优惠卷领取记录', NULL, NULL, 0, NULL, NULL, 2, 'appletCouponRecord:applet_coupon_record:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-17 17:44:09', NULL, NULL, 0, 0, '1', 0);
-- 删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091705446840093', '2025091705446840090', '删除优惠卷领取记录', NULL, NULL, 0, NULL, NULL, 2, 'appletCouponRecord:applet_coupon_record:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-17 17:44:09', NULL, NULL, 0, 0, '1', 0);
-- 批量删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091705446840094', '2025091705446840090', '批量删除优惠卷领取记录', NULL, NULL, 0, NULL, NULL, 2, 'appletCouponRecord:applet_coupon_record:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-17 17:44:09', NULL, NULL, 0, 0, '1', 0);
-- 导出excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091705446840095', '2025091705446840090', '导出excel_优惠卷领取记录', NULL, NULL, 0, NULL, NULL, 2, 'appletCouponRecord:applet_coupon_record:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-17 17:44:09', NULL, NULL, 0, 0, '1', 0);
-- 导入excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091705446850096', '2025091705446840090', '导入excel_优惠卷领取记录', NULL, NULL, 0, NULL, NULL, 2, 'appletCouponRecord:applet_coupon_record:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-17 17:44:09', NULL, NULL, 0, 0, '1', 0);

+ 70
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/vue3/components/AppletCouponRecordForm.vue View File

@ -0,0 +1,70 @@
<template>
<div style="min-height: 400px">
<BasicForm @register="registerForm"></BasicForm>
<div style="width: 100%;text-align: center" v-if="!formDisabled">
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary"> </a-button>
</div>
</div>
</template>
<script lang="ts">
import {BasicForm, useForm} from '/@/components/Form/index';
import {computed, defineComponent} from 'vue';
import {defHttp} from '/@/utils/http/axios';
import { propTypes } from '/@/utils/propTypes';
import {getBpmFormSchema} from '../AppletCouponRecord.data';
import {saveOrUpdate} from '../AppletCouponRecord.api';
export default defineComponent({
name: "AppletCouponRecordForm",
components:{
BasicForm
},
props:{
formData: propTypes.object.def({}),
formBpm: propTypes.bool.def(true),
},
setup(props){
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
labelWidth: 150,
schemas: getBpmFormSchema(props.formData),
showActionButtonGroup: false,
baseColProps: {span: 24}
});
const formDisabled = computed(()=>{
if(props.formData.disabled === false){
return false;
}
return true;
});
let formData = {};
const queryByIdUrl = '/appletCouponRecord/appletCouponRecord/queryById';
async function initFormData(){
let params = {id: props.formData.dataId};
const data = await defHttp.get({url: queryByIdUrl, params});
formData = {...data}
//
await setFieldsValue(formData);
//
await setProps({disabled: formDisabled.value})
}
async function submitForm() {
let data = getFieldsValue();
let params = Object.assign({}, formData, data);
console.log('表单数据', params)
await saveOrUpdate(params, true)
}
initFormData();
return {
registerForm,
formDisabled,
submitForm,
}
}
});
</script>

+ 99
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCouponRecord/vue3/components/AppletCouponRecordModal.vue View File

@ -0,0 +1,99 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
<BasicForm @register="registerForm" name="AppletCouponRecordForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref, reactive} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../AppletCouponRecord.data';
import {saveOrUpdate} from '../AppletCouponRecord.api';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
const { createMessage } = useMessage();
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
const isDetail = ref(false);
//
const [registerForm, { setProps,resetFields, setFieldsValue, validate, scrollToField }] = useForm({
labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: {span: 24}
});
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
isUpdate.value = !!data?.isUpdate;
isDetail.value = !!data?.showFooter;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const fieldPickers = reactive({
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
//
changeDateValue(values);
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
} finally {
setModalProps({confirmLoading: false});
}
}
/**
* 处理日期值
* @param formData 表单数据
*/
const changeDateValue = (formData) => {
if (formData && fieldPickers) {
for (let key in fieldPickers) {
if (formData[key]) {
formData[key] = getDateByPicker(formData[key], fieldPickers[key]);
}
}
}
};
</script>
<style lang="less" scoped>
/** 时间和数字输入框样式 */
:deep(.ant-input-number) {
width: 100%;
}
:deep(.ant-calendar-picker) {
width: 100%;
}
</style>

+ 8
- 2
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/controller/AppletCourseController.java View File

@ -41,7 +41,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: 课程
* @Author: jeecg-boot
* @Date: 2025-09-12
* @Date: 2025-09-18
* @Version: V1.0
*/
@Tag(name="课程")
@ -70,7 +70,13 @@ public class AppletCourseController extends JeecgController<AppletCourse, IApple
HttpServletRequest req) {
QueryWrapper<AppletCourse> queryWrapper = QueryGenerator.initQueryWrapper(appletCourse, req.getParameterMap());
// 自定义查询规则
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
// 自定义多选的查询规则为LIKE_WITH_OR
customeRuleMap.put("bookId", QueryRuleEnum.LIKE_WITH_OR);
customeRuleMap.put("chinese", QueryRuleEnum.LIKE_WITH_OR);
customeRuleMap.put("english", QueryRuleEnum.LIKE_WITH_OR);
QueryWrapper<AppletCourse> queryWrapper = QueryGenerator.initQueryWrapper(appletCourse, req.getParameterMap(),customeRuleMap);
Page<AppletCourse> page = new Page<AppletCourse>(pageNo, pageSize);
IPage<AppletCourse> pageList = appletCourseService.page(page, queryWrapper);
return Result.OK(pageList);


+ 9
- 1
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/entity/AppletCourse.java View File

@ -22,7 +22,7 @@ import lombok.experimental.Accessors;
/**
* @Description: 课程
* @Author: jeecg-boot
* @Date: 2025-09-12
* @Date: 2025-09-18
* @Version: V1.0
*/
@Data
@ -69,4 +69,12 @@ public class AppletCourse implements Serializable {
@Excel(name = "英文课程名", width = 15)
@Schema(description = "英文课程名")
private java.lang.String english;
/**上架*/
@Excel(name = "上架", width = 15,replace = {"是_Y","否_N"} )
@Schema(description = "上架")
private java.lang.String status;
/**排序*/
@Excel(name = "排序", width = 15)
@Schema(description = "排序")
private java.lang.Integer sort;
}

+ 1
- 1
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/mapper/AppletCourseMapper.java View File

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 课程
* @Author: jeecg-boot
* @Date: 2025-09-12
* @Date: 2025-09-18
* @Version: V1.0
*/
public interface AppletCourseMapper extends BaseMapper<AppletCourse> {


+ 1
- 1
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/service/IAppletCourseService.java View File

@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 课程
* @Author: jeecg-boot
* @Date: 2025-09-12
* @Date: 2025-09-18
* @Version: V1.0
*/
public interface IAppletCourseService extends IService<AppletCourse> {


+ 1
- 1
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/service/impl/AppletCourseServiceImpl.java View File

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 课程
* @Author: jeecg-boot
* @Date: 2025-09-12
* @Date: 2025-09-18
* @Version: V1.0
*/
@Service


+ 12
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/uniapp/AppletCourseForm.vue View File

@ -25,6 +25,18 @@
<view class="title"><text space="ensp">英文课程名</text></view>
<input placeholder="请输入英文课程名" v-model="model.english"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">上架</text></view>
<input placeholder="请输入上架" v-model="model.status"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">排序</text></view>
<input type="number" placeholder="请输入排序" v-model="model.sort"/>
</view>
</view>
<view class="padding">
<button class="cu-btn block bg-blue margin-tb-sm lg" @click="onSubmit">


+ 14
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/uniapp3/AppletCourseData.ts View File

@ -16,4 +16,18 @@ export const columns = [
align:"center",
dataIndex: 'english'
},
{
title: '上架',
align:"center",
dataIndex: 'status',
customRender:({text}) => {
return render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
},
},
{
title: '排序',
align:"center",
sorter: true,
dataIndex: 'sort'
},
];

+ 32
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/uniapp3/AppletCourseForm.vue View File

@ -48,6 +48,38 @@ navigationBarTitleText: '课程',
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<!-- 开关 -->
<wd-cell
:label="get4Label('上架')"
name='status'
title-width="100px"
center
>
<wd-switch
:label="get4Label('上架')"
name='status'
size="18px"
v-model="myFormData['status']"
active-value="Y"
inactive-value="N"
/>
</wd-cell>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['sort']"
:label="get4Label('排序')"
name='sort'
prop='sort'
placeholder="请选择排序"
inputMode="numeric"
:rules="[
]"
clearable
/>
</view>
</wd-cell-group>
</wd-form>


+ 47
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/vue3/AppletCourse.data.ts View File

@ -20,9 +20,42 @@ export const columns: BasicColumn[] = [
align:"center",
dataIndex: 'english'
},
{
title: '上架',
align:"center",
dataIndex: 'status',
customRender:({text}) => {
return render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
},
},
{
title: '排序',
align:"center",
sorter: true,
dataIndex: 'sort'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "书籍",
field: 'bookId',
component: 'JSelectMultiple',
componentProps:{
dictCode:"applet_books,books_name,id"
},
//colProps: {span: 6},
},
{
label: "中文课程名",
field: "chinese",
component: 'JInput',
},
{
label: "英文课程名",
field: "english",
component: 'JInput',
},
];
//表单数据
export const formSchema: FormSchema[] = [
@ -43,6 +76,18 @@ export const formSchema: FormSchema[] = [
label: '英文课程名',
field: 'english',
component: 'Input',
},
{
label: '上架',
field: 'status',
component: 'JSwitch',
componentProps:{
},
},
{
label: '排序',
field: 'sort',
component: 'InputNumber',
},
// TODO 主键隐藏字段,目前写死为ID
{
@ -58,6 +103,8 @@ export const superQuerySchema = {
bookId: {title: '书籍',order: 0,view: 'list', type: 'string',dictTable: "applet_books", dictCode: 'id', dictText: 'books_name',},
chinese: {title: '中文课程名',order: 1,view: 'text', type: 'string',},
english: {title: '英文课程名',order: 2,view: 'text', type: 'string',},
status: {title: '上架',order: 3,view: 'switch', type: 'string',},
sort: {title: '排序',order: 4,view: 'number', type: 'number',},
};
/**


+ 26
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCourse/vue3/V20250918_1__menu_insert_AppletCourse.sql View File

@ -0,0 +1,26 @@
-- 注意:该页面对应的前台目录为views/appletCourse文件夹下
-- 如果你想更改到其他目录,请修改sql中component字段对应的值
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('2025091801545760180', NULL, '课程', '/appletCourse/appletCourseList', 'appletCourse/AppletCourseList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-09-18 13:54:18', NULL, NULL, 0);
-- 权限控制sql
-- 新增
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091801545760181', '2025091801545760180', '添加课程', NULL, NULL, 0, NULL, NULL, 2, 'appletCourse:applet_course:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-18 13:54:18', NULL, NULL, 0, 0, '1', 0);
-- 编辑
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091801545760182', '2025091801545760180', '编辑课程', NULL, NULL, 0, NULL, NULL, 2, 'appletCourse:applet_course:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-18 13:54:18', NULL, NULL, 0, 0, '1', 0);
-- 删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091801545760183', '2025091801545760180', '删除课程', NULL, NULL, 0, NULL, NULL, 2, 'appletCourse:applet_course:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-18 13:54:18', NULL, NULL, 0, 0, '1', 0);
-- 批量删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091801545760184', '2025091801545760180', '批量删除课程', NULL, NULL, 0, NULL, NULL, 2, 'appletCourse:applet_course:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-18 13:54:18', NULL, NULL, 0, 0, '1', 0);
-- 导出excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091801545760185', '2025091801545760180', '导出excel_课程', NULL, NULL, 0, NULL, NULL, 2, 'appletCourse:applet_course:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-18 13:54:18', NULL, NULL, 0, 0, '1', 0);
-- 导入excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091801545760186', '2025091801545760180', '导入excel_课程', NULL, NULL, 0, NULL, NULL, 2, 'appletCourse:applet_course:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-18 13:54:18', NULL, NULL, 0, 0, '1', 0);

+ 182
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/controller/AppletCoursePageController.java View File

@ -0,0 +1,182 @@
package org.jeecg.modules.demo.appletCoursePage.controller;
import java.util.Arrays;
import java.util.HashMap;
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.system.query.QueryRuleEnum;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.appletCoursePage.entity.AppletCoursePage;
import org.jeecg.modules.demo.appletCoursePage.service.IAppletCoursePageService;
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.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: 课程分页
* @Author: jeecg-boot
* @Date: 2025-09-18
* @Version: V1.0
*/
@Tag(name="课程分页")
@RestController
@RequestMapping("/appletCoursePage/appletCoursePage")
@Slf4j
public class AppletCoursePageController extends JeecgController<AppletCoursePage, IAppletCoursePageService> {
@Autowired
private IAppletCoursePageService appletCoursePageService;
/**
* 分页列表查询
*
* @param appletCoursePage
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "课程分页-分页列表查询")
@Operation(summary="课程分页-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AppletCoursePage>> queryPageList(AppletCoursePage appletCoursePage,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AppletCoursePage> queryWrapper = QueryGenerator.initQueryWrapper(appletCoursePage, req.getParameterMap());
Page<AppletCoursePage> page = new Page<AppletCoursePage>(pageNo, pageSize);
IPage<AppletCoursePage> pageList = appletCoursePageService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param appletCoursePage
* @return
*/
@AutoLog(value = "课程分页-添加")
@Operation(summary="课程分页-添加")
@RequiresPermissions("appletCoursePage:applet_course_page:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AppletCoursePage appletCoursePage) {
appletCoursePageService.save(appletCoursePage);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param appletCoursePage
* @return
*/
@AutoLog(value = "课程分页-编辑")
@Operation(summary="课程分页-编辑")
@RequiresPermissions("appletCoursePage:applet_course_page:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody AppletCoursePage appletCoursePage) {
appletCoursePageService.updateById(appletCoursePage);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "课程分页-通过id删除")
@Operation(summary="课程分页-通过id删除")
@RequiresPermissions("appletCoursePage:applet_course_page:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
appletCoursePageService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "课程分页-批量删除")
@Operation(summary="课程分页-批量删除")
@RequiresPermissions("appletCoursePage:applet_course_page:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.appletCoursePageService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "课程分页-通过id查询")
@Operation(summary="课程分页-通过id查询")
@GetMapping(value = "/queryById")
public Result<AppletCoursePage> queryById(@RequestParam(name="id",required=true) String id) {
AppletCoursePage appletCoursePage = appletCoursePageService.getById(id);
if(appletCoursePage==null) {
return Result.error("未找到对应数据");
}
return Result.OK(appletCoursePage);
}
/**
* 导出excel
*
* @param request
* @param appletCoursePage
*/
@RequiresPermissions("appletCoursePage:applet_course_page:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, AppletCoursePage appletCoursePage) {
return super.exportXls(request, appletCoursePage, AppletCoursePage.class, "课程分页");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("appletCoursePage:applet_course_page:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, AppletCoursePage.class);
}
}

+ 83
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/entity/AppletCoursePage.java View File

@ -0,0 +1,83 @@
package org.jeecg.modules.demo.appletCoursePage.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
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.v3.oas.annotations.media.Schema;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 课程分页
* @Author: jeecg-boot
* @Date: 2025-09-18
* @Version: V1.0
*/
@Data
@TableName("applet_course_page")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description="课程分页")
public class AppletCoursePage implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private java.lang.String id;
/**创建人*/
@Schema(description = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建日期")
private java.util.Date createTime;
/**更新人*/
@Schema(description = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@Schema(description = "所属部门")
private java.lang.String sysOrgCode;
/**排序*/
@Excel(name = "排序", width = 15)
@Schema(description = "排序")
private java.lang.Integer sort;
/**付费*/
@Excel(name = "付费", width = 15,replace = {"是_Y","否_N"} )
@Schema(description = "付费")
private java.lang.String pay;
/**内容*/
@Excel(name = "内容", width = 15)
@Schema(description = "内容")
private java.lang.String content;
/**类型*/
@Excel(name = "类型", width = 15)
@Schema(description = "类型")
private java.lang.String type;
/**课程*/
@Excel(name = "课程", width = 15)
@Schema(description = "课程")
private java.lang.String courseId;
/**上架*/
@Excel(name = "上架", width = 15,replace = {"是_Y","否_N"} )
@Schema(description = "上架")
private java.lang.String status;
}

+ 17
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/mapper/AppletCoursePageMapper.java View File

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.appletCoursePage.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.appletCoursePage.entity.AppletCoursePage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 课程分页
* @Author: jeecg-boot
* @Date: 2025-09-18
* @Version: V1.0
*/
public interface AppletCoursePageMapper extends BaseMapper<AppletCoursePage> {
}

+ 5
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/mapper/xml/AppletCoursePageMapper.xml View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.appletCoursePage.mapper.AppletCoursePageMapper">
</mapper>

+ 14
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/service/IAppletCoursePageService.java View File

@ -0,0 +1,14 @@
package org.jeecg.modules.demo.appletCoursePage.service;
import org.jeecg.modules.demo.appletCoursePage.entity.AppletCoursePage;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 课程分页
* @Author: jeecg-boot
* @Date: 2025-09-18
* @Version: V1.0
*/
public interface IAppletCoursePageService extends IService<AppletCoursePage> {
}

+ 19
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/service/impl/AppletCoursePageServiceImpl.java View File

@ -0,0 +1,19 @@
package org.jeecg.modules.demo.appletCoursePage.service.impl;
import org.jeecg.modules.demo.appletCoursePage.entity.AppletCoursePage;
import org.jeecg.modules.demo.appletCoursePage.mapper.AppletCoursePageMapper;
import org.jeecg.modules.demo.appletCoursePage.service.IAppletCoursePageService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 课程分页
* @Author: jeecg-boot
* @Date: 2025-09-18
* @Version: V1.0
*/
@Service
public class AppletCoursePageServiceImpl extends ServiceImpl<AppletCoursePageMapper, AppletCoursePage> implements IAppletCoursePageService {
}

+ 113
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/uniapp/AppletCoursePageForm.vue View File

@ -0,0 +1,113 @@
<template>
<view>
<!--标题和返回-->
<cu-custom :bgColor="NavBarColor" isBack :backRouterName="backRouteName">
<block slot="backText">返回</block>
<block slot="content">课程分页</block>
</cu-custom>
<!--表单区域-->
<view>
<form>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">排序</text></view>
<input type="number" placeholder="请输入排序" v-model="model.sort"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">付费</text></view>
<input placeholder="请输入付费" v-model="model.pay"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">内容</text></view>
<input placeholder="请输入内容" v-model="model.content"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">类型</text></view>
<input placeholder="请输入类型" v-model="model.type"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">课程</text></view>
<input placeholder="请输入课程" v-model="model.courseId"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">上架</text></view>
<input placeholder="请输入上架" v-model="model.status"/>
</view>
</view>
<view class="padding">
<button class="cu-btn block bg-blue margin-tb-sm lg" @click="onSubmit">
<text v-if="loading" class="cuIcon-loading2 cuIconfont-spin"></text>提交
</button>
</view>
</form>
</view>
</view>
</template>
<script>
import myDate from '@/components/my-componets/my-date.vue'
export default {
name: "AppletCoursePageForm",
components:{ myDate },
props:{
formData:{
type:Object,
default:()=>{},
required:false
}
},
data(){
return {
CustomBar: this.CustomBar,
NavBarColor: this.NavBarColor,
loading:false,
model: {},
backRouteName:'index',
url: {
queryById: "/appletCoursePage/appletCoursePage/queryById",
add: "/appletCoursePage/appletCoursePage/add",
edit: "/appletCoursePage/appletCoursePage/edit",
},
}
},
created(){
this.initFormData();
},
methods:{
initFormData(){
if(this.formData){
let dataId = this.formData.dataId;
this.$http.get(this.url.queryById,{params:{id:dataId}}).then((res)=>{
if(res.data.success){
console.log("表单数据",res);
this.model = res.data.result;
}
})
}
},
onSubmit() {
let myForm = {...this.model};
this.loading = true;
let url = myForm.id?this.url.edit:this.url.add;
this.$http.post(url,myForm).then(res=>{
console.log("res",res)
this.loading = false
this.$Router.push({name:this.backRouteName})
}).catch(()=>{
this.loading = false
});
}
}
}
</script>

+ 44
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/uniapp/AppletCoursePageList.vue View File

@ -0,0 +1,44 @@
<template>
<view>
<!--标题和返回-->
<cu-custom :bgColor="NavBarColor" isBack>
<block slot="backText">返回</block>
<block slot="content">课程分页</block>
</cu-custom>
<!--滚动加载列表-->
<mescroll-body ref="mescrollRef" bottom="88" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback" @up="upCallback">
<view class="cu-list menu">
<view class="cu-item" v-for="(item,index) in list" :key="index" @click="goHome">
<view class="flex" style="width:100%">
<text class="text-lg" style="color: #000;">
{{ item.createBy}}
</text>
</view>
</view>
</view>
</mescroll-body>
</view>
</template>
<script>
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
import Mixin from "@/common/mixin/Mixin.js";
export default {
name: '课程分页',
mixins: [MescrollMixin,Mixin],
data() {
return {
CustomBar:this.CustomBar,
NavBarColor:this.NavBarColor,
url: "/appletCoursePage/appletCoursePage/list",
};
},
methods: {
goHome(){
this.$Router.push({name: "index"})
}
}
}
</script>

+ 40
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/uniapp3/AppletCoursePageData.ts View File

@ -0,0 +1,40 @@
import { render } from '@/common/renderUtils';
//列表数据
export const columns = [
{
title: '排序',
align:"center",
dataIndex: 'sort'
},
{
title: '付费',
align:"center",
dataIndex: 'pay',
customRender:({text}) => {
return render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
},
},
{
title: '内容',
align:"center",
dataIndex: 'content'
},
{
title: '类型',
align:"center",
dataIndex: 'type'
},
{
title: '课程',
align:"center",
dataIndex: 'courseId'
},
{
title: '上架',
align:"center",
dataIndex: 'status',
customRender:({text}) => {
return render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
},
},
];

+ 285
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/uniapp3/AppletCoursePageForm.vue View File

@ -0,0 +1,285 @@
<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationStyle: 'custom',
navigationBarTitleText: '课程分页',
},
}
</route>
<template>
<PageLayout :navTitle="navTitle" :backRouteName="backRouteName">
<scroll-view class="scrollArea" scroll-y>
<view class="form-container">
<wd-form ref="form" :model="myFormData">
<wd-cell-group border>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['sort']"
:label="get4Label('排序')"
name='sort'
prop='sort'
placeholder="请选择排序"
inputMode="numeric"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<!-- 开关 -->
<wd-cell
:label="get4Label('付费')"
name='pay'
title-width="100px"
center
>
<wd-switch
:label="get4Label('付费')"
name='pay'
size="18px"
v-model="myFormData['pay']"
active-value="Y"
inactive-value="N"
/>
</wd-cell>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['content']"
:label="get4Label('内容')"
name='content'
prop='content'
placeholder="请选择内容"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['type']"
:label="get4Label('类型')"
name='type'
prop='type'
placeholder="请选择类型"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 0 == 0 }">
<wd-input
label-width="100px"
v-model="myFormData['courseId']"
:label="get4Label('课程')"
name='courseId'
prop='courseId'
placeholder="请选择课程"
:rules="[
]"
clearable
/>
</view>
<view class="{ 'mt-14px': 1 == 0 }">
<!-- 开关 -->
<wd-cell
:label="get4Label('上架')"
name='status'
title-width="100px"
center
>
<wd-switch
:label="get4Label('上架')"
name='status'
size="18px"
v-model="myFormData['status']"
active-value="Y"
inactive-value="N"
/>
</wd-cell>
</view>
</wd-cell-group>
</wd-form>
</view>
</scroll-view>
<view class="footer">
<wd-button :disabled="loading" block :loading="loading" @click="handleSubmit">提交</wd-button>
</view>
</PageLayout>
</template>
<script lang="ts" setup>
import { onLoad } from '@dcloudio/uni-app'
import { http } from '@/utils/http'
import { useToast } from 'wot-design-uni'
import { useRouter } from '@/plugin/uni-mini-router'
import { ref, onMounted, computed,reactive } from 'vue'
import OnlineImage from '@/components/online/view/online-image.vue'
import OnlineFile from '@/components/online/view/online-file.vue'
import OnlineFileCustom from '@/components/online/view/online-file-custom.vue'
import OnlineSelect from '@/components/online/view/online-select.vue'
import OnlineTime from '@/components/online/view/online-time.vue'
import OnlineDate from '@/components/online/view/online-date.vue'
import OnlineRadio from '@/components/online/view/online-radio.vue'
import OnlineCheckbox from '@/components/online/view/online-checkbox.vue'
import OnlineMulti from '@/components/online/view/online-multi.vue'
import OnlinePopupLinkRecord from '@/components/online/view/online-popup-link-record.vue'
import OnlinePca from '@/components/online/view/online-pca.vue'
import SelectDept from '@/components/SelectDept/SelectDept.vue'
import SelectUser from '@/components/SelectUser/SelectUser.vue'
import {duplicateCheck} from "@/service/api";
defineOptions({
name: 'AppletCoursePageForm',
options: {
styleIsolation: 'shared',
},
})
const toast = useToast()
const router = useRouter()
const form = ref(null)
//
const myFormData = reactive({})
const loading = ref(false)
const navTitle = ref('新增')
const dataId = ref('')
const backRouteName = ref('AppletCoursePageList')
// initForm
const initForm = (item) => {
console.log('initForm item', item)
if(item?.dataId){
dataId.value = item.dataId;
navTitle.value = item.dataId?'编辑':'新增';
initData();
}
}
//
const initData = () => {
http.get("/appletCoursePage/appletCoursePage/queryById",{id:dataId.value}).then((res) => {
if (res.success) {
let obj = res.result
Object.assign(myFormData, { ...obj })
}else{
toast.error(res?.message || '表单加载失败!')
}
})
}
const handleSuccess = () => {
uni.$emit('refreshList');
router.back()
}
/**
* 校验唯一
* @param values
* @returns {boolean}
*/
async function fieldCheck(values: any) {
const onlyField = [
];
for (const field of onlyField) {
if (values[field]) {
//
const res: any = await duplicateCheck({
tableName: 'applet_course_page',
fieldName: field, // 使
fieldVal: values[field],
dataId: values.id,
});
if (!res.success) {
toast.warning(res.message);
return true; //
}
}
}
return false; //
}
//
const handleSubmit = async () => {
//
if (await fieldCheck(myFormData)) {
return
}
let url = dataId.value?'/appletCoursePage/appletCoursePage/edit':'/appletCoursePage/appletCoursePage/add';
form.value
.validate()
.then(({ valid, errors }) => {
if (valid) {
loading.value = true;
http.post(url,myFormData).then((res) => {
loading.value = false;
if (res.success) {
toast.success('保存成功');
handleSuccess()
}else{
toast.error(res?.message || '表单保存失败!')
}
})
}
})
.catch((error) => {
console.log(error, 'error')
loading.value = false;
})
}
//
const get4Label = computed(() => {
return (label) => {
return label && label.length > 4 ? label.substring(0, 4) : label;
}
})
//
const getFormSchema = computed(() => {
return (dictTable,dictCode,dictText) => {
return {
dictCode,
dictTable,
dictText
};
}
})
/**
* 获取日期控件的扩展类型
* @param picker
* @returns {string}
*/
const getDateExtendType = (picker: string) => {
let mapField = {
month: 'year-month',
year: 'year',
quarter: 'quarter',
week: 'week',
day: 'date',
}
return picker && mapField[picker]
? mapField[picker]
: 'date'
}
//pop
const setFieldsValue = (data) => {
Object.assign(myFormData, {...data })
}
// onLoad
onLoad((option) => {
initForm(option)
})
</script>
<style lang="scss" scoped>
.footer {
width: 100%;
padding: 10px 20px;
padding-bottom: calc(constant(safe-area-inset-bottom) + 10px);
padding-bottom: calc(env(safe-area-inset-bottom) + 10px);
}
:deep(.wd-cell__label) {
font-size: 14px;
color: #444;
}
:deep(.wd-cell__value) {
text-align: left;
}
</style>

+ 148
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/uniapp3/AppletCoursePageList.vue View File

@ -0,0 +1,148 @@
<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationBarTitleText: '课程分页',
navigationStyle: 'custom',
},
}
</route>
<template>
<PageLayout navTitle="课程分页" backRouteName="index" routeMethod="pushTab">
<view class="wrap">
<z-paging
ref="paging"
:fixed="false"
v-model="dataList"
@query="queryList"
:default-page-size="15"
>
<template v-for="item in dataList" :key="item.id">
<wd-swipe-action>
<view class="list" @click="handleEdit(item)">
<template v-for="(cItem, cIndex) in columns" :key="cIndex">
<view v-if="cIndex < 3" class="box" :style="getBoxStyle">
<view class="field ellipsis">{{ cItem.title }}</view>
<view class="value cu-text-grey">{{ item[cItem.dataIndex] }}</view>
</view>
</template>
</view>
<template #right>
<view class="action">
<view class="button" @click="handleAction('del', item)">删除</view>
</view>
</template>
</wd-swipe-action>
</template>
</z-paging>
<view class="add u-iconfont u-icon-add" @click="handleAdd"></view>
</view>
</PageLayout>
</template>
<script setup lang="ts">
import { ref, onMounted, computed } from 'vue'
import { http } from '@/utils/http'
import usePageList from '@/hooks/usePageList'
import {columns} from './AppletCoursePageData';
defineOptions({
name: 'AppletCoursePageList',
options: {
styleIsolation: 'shared',
}
})
//
let { toast, router, paging, dataList, queryList } = usePageList('/appletCoursePage/appletCoursePage/list');
//
const getBoxStyle = computed(() => {
return { width: "calc(33% - 5px)" }
})
//
const handleAction = (val, item) => {
if (val == 'del') {
http.delete("/appletCoursePage/appletCoursePage/delete?id="+item.id,{id:item.id}).then((res) => {
toast.success('删除成功~')
paging.value.reload()
})
}
}
// go
const handleAdd = () => {
router.push({
name: 'AppletCoursePageForm'
})
}
//go
const handleEdit = (record) => {
router.push({
name: 'AppletCoursePageForm',
params: {dataId: record.id},
})
}
onMounted(() => {
//
uni.$on('refreshList', () => {
queryList(1,10)
})
})
</script>
<style lang="scss" scoped>
.wrap {
height: 100%;
}
:deep(.wd-swipe-action) {
margin-top: 10px;
background-color: #fff;
}
.list {
padding: 10px 10px;
width: 100%;
text-align: left;
display: flex;
justify-content: space-between;
.box {
width: 33%;
.field {
margin-bottom: 10px;
line-height: 20px;
}
}
}
.action {
width: 60px;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
.button {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
height: 100%;
color: #fff;
&:first-child {
background-color: #fa4350;
}
}
}
.add {
height: 70upx;
width: 70upx;
text-align: center;
line-height: 70upx;
background-color: #fff;
border-radius: 50%;
position: fixed;
bottom: 80upx;
right: 30upx;
box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1);
color: #666;
}
</style>

+ 64
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/vue3/AppletCoursePage.api.ts View File

@ -0,0 +1,64 @@
import {defHttp} from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/appletCoursePage/appletCoursePage/list',
save='/appletCoursePage/appletCoursePage/add',
edit='/appletCoursePage/appletCoursePage/edit',
deleteOne = '/appletCoursePage/appletCoursePage/delete',
deleteBatch = '/appletCoursePage/appletCoursePage/deleteBatch',
importExcel = '/appletCoursePage/appletCoursePage/importExcel',
exportXls = '/appletCoursePage/appletCoursePage/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) => {
createConfirm({
iconType: 'warning',
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});
}

+ 110
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/vue3/AppletCoursePage.data.ts View File

@ -0,0 +1,110 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '排序',
align:"center",
dataIndex: 'sort'
},
{
title: '付费',
align:"center",
dataIndex: 'pay',
customRender:({text}) => {
return render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
},
},
{
title: '内容',
align:"center",
dataIndex: 'content'
},
{
title: '类型',
align:"center",
dataIndex: 'type'
},
{
title: '课程',
align:"center",
dataIndex: 'courseId'
},
{
title: '上架',
align:"center",
dataIndex: 'status',
customRender:({text}) => {
return render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
},
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '排序',
field: 'sort',
component: 'InputNumber',
},
{
label: '付费',
field: 'pay',
component: 'JSwitch',
componentProps:{
},
},
{
label: '内容',
field: 'content',
component: 'Input',
},
{
label: '类型',
field: 'type',
component: 'Input',
},
{
label: '课程',
field: 'courseId',
component: 'Input',
},
{
label: '上架',
field: 'status',
component: 'JSwitch',
componentProps:{
},
},
// TODO 主键隐藏字段,目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
];
// 高级查询数据
export const superQuerySchema = {
sort: {title: '排序',order: 0,view: 'number', type: 'number',},
pay: {title: '付费',order: 1,view: 'switch', type: 'string',},
content: {title: '内容',order: 2,view: 'text', type: 'string',},
type: {title: '类型',order: 3,view: 'text', type: 'string',},
courseId: {title: '课程',order: 4,view: 'text', type: 'string',},
status: {title: '上架',order: 5,view: 'switch', type: 'string',},
};
/**
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
return formSchema;
}

+ 206
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/vue3/AppletCoursePageList.vue View File

@ -0,0 +1,206 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'appletCoursePage:applet_course_page:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="'appletCoursePage:applet_course_page:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'appletCoursePage:applet_course_page:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button v-auth="'appletCoursePage:applet_course_page:deleteBatch'">批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
<!-- 高级查询 -->
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<AppletCoursePageModal @register="registerModal" @success="handleSuccess"></AppletCoursePageModal>
</div>
</template>
<script lang="ts" name="appletCoursePage-appletCoursePage" setup>
import {ref, reactive, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import AppletCoursePageModal from './components/AppletCoursePageModal.vue'
import {columns, searchFormSchema, superQuerySchema} from './AppletCoursePage.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './AppletCoursePage.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import { useUserStore } from '/@/store/modules/user';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
//
const fieldPickers = reactive({
});
const queryParam = reactive<any>({});
const checkedKeys = ref<Array<string | number>>([]);
const userStore = useUserStore();
const { createMessage } = useMessage();
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '课程分页',
api: list,
columns,
canResize:true,
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToNumber: [
],
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
fixed:'right'
},
beforeFetch: (params) => {
if (params && fieldPickers) {
for (let key in fieldPickers) {
if (params[key]) {
params[key] = getDateByPicker(params[key], fieldPickers[key]);
}
}
}
return Object.assign(params, queryParam);
},
},
exportConfig: {
name:"课程分页",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
reload();
}
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'appletCoursePage:applet_course_page:edit'
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'appletCoursePage:applet_course_page:delete'
}
]
}
</script>
<style lang="less" scoped>
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
</style>

+ 26
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/vue3/V20250918_1__menu_insert_AppletCoursePage.sql View File

@ -0,0 +1,26 @@
-- 注意:该页面对应的前台目录为views/appletCoursePage文件夹下
-- 如果你想更改到其他目录,请修改sql中component字段对应的值
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('2025091802001670560', NULL, '课程分页', '/appletCoursePage/appletCoursePageList', 'appletCoursePage/AppletCoursePageList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-09-18 14:00:56', NULL, NULL, 0);
-- 权限控制sql
-- 新增
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091802001670561', '2025091802001670560', '添加课程分页', NULL, NULL, 0, NULL, NULL, 2, 'appletCoursePage:applet_course_page:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-18 14:00:56', NULL, NULL, 0, 0, '1', 0);
-- 编辑
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091802001670562', '2025091802001670560', '编辑课程分页', NULL, NULL, 0, NULL, NULL, 2, 'appletCoursePage:applet_course_page:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-18 14:00:56', NULL, NULL, 0, 0, '1', 0);
-- 删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091802001670563', '2025091802001670560', '删除课程分页', NULL, NULL, 0, NULL, NULL, 2, 'appletCoursePage:applet_course_page:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-18 14:00:56', NULL, NULL, 0, 0, '1', 0);
-- 批量删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091802001670564', '2025091802001670560', '批量删除课程分页', NULL, NULL, 0, NULL, NULL, 2, 'appletCoursePage:applet_course_page:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-18 14:00:56', NULL, NULL, 0, 0, '1', 0);
-- 导出excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091802001670565', '2025091802001670560', '导出excel_课程分页', NULL, NULL, 0, NULL, NULL, 2, 'appletCoursePage:applet_course_page:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-18 14:00:56', NULL, NULL, 0, 0, '1', 0);
-- 导入excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('2025091802001670566', '2025091802001670560', '导入excel_课程分页', NULL, NULL, 0, NULL, NULL, 2, 'appletCoursePage:applet_course_page:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-09-18 14:00:56', NULL, NULL, 0, 0, '1', 0);

+ 70
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/vue3/components/AppletCoursePageForm.vue View File

@ -0,0 +1,70 @@
<template>
<div style="min-height: 400px">
<BasicForm @register="registerForm"></BasicForm>
<div style="width: 100%;text-align: center" v-if="!formDisabled">
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary"> </a-button>
</div>
</div>
</template>
<script lang="ts">
import {BasicForm, useForm} from '/@/components/Form/index';
import {computed, defineComponent} from 'vue';
import {defHttp} from '/@/utils/http/axios';
import { propTypes } from '/@/utils/propTypes';
import {getBpmFormSchema} from '../AppletCoursePage.data';
import {saveOrUpdate} from '../AppletCoursePage.api';
export default defineComponent({
name: "AppletCoursePageForm",
components:{
BasicForm
},
props:{
formData: propTypes.object.def({}),
formBpm: propTypes.bool.def(true),
},
setup(props){
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
labelWidth: 150,
schemas: getBpmFormSchema(props.formData),
showActionButtonGroup: false,
baseColProps: {span: 24}
});
const formDisabled = computed(()=>{
if(props.formData.disabled === false){
return false;
}
return true;
});
let formData = {};
const queryByIdUrl = '/appletCoursePage/appletCoursePage/queryById';
async function initFormData(){
let params = {id: props.formData.dataId};
const data = await defHttp.get({url: queryByIdUrl, params});
formData = {...data}
//
await setFieldsValue(formData);
//
await setProps({disabled: formDisabled.value})
}
async function submitForm() {
let data = getFieldsValue();
let params = Object.assign({}, formData, data);
console.log('表单数据', params)
await saveOrUpdate(params, true)
}
initFormData();
return {
registerForm,
formDisabled,
submitForm,
}
}
});
</script>

+ 99
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCoursePage/vue3/components/AppletCoursePageModal.vue View File

@ -0,0 +1,99 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
<BasicForm @register="registerForm" name="AppletCoursePageForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref, reactive} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {BasicForm, useForm} from '/@/components/Form/index';
import {formSchema} from '../AppletCoursePage.data';
import {saveOrUpdate} from '../AppletCoursePage.api';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
const { createMessage } = useMessage();
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
const isDetail = ref(false);
//
const [registerForm, { setProps,resetFields, setFieldsValue, validate, scrollToField }] = useForm({
labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: {span: 24}
});
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
isUpdate.value = !!data?.isUpdate;
isDetail.value = !!data?.showFooter;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const fieldPickers = reactive({
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(isDetail) ? '详情' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
//
changeDateValue(values);
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
} finally {
setModalProps({confirmLoading: false});
}
}
/**
* 处理日期值
* @param formData 表单数据
*/
const changeDateValue = (formData) => {
if (formData && fieldPickers) {
for (let key in fieldPickers) {
if (formData[key]) {
formData[key] = getDateByPicker(formData[key], fieldPickers[key]);
}
}
}
};
</script>
<style lang="less" scoped>
/** 时间和数字输入框样式 */
:deep(.ant-input-number) {
width: 100%;
}
:deep(.ant-calendar-picker) {
width: 100%;
}
</style>

+ 9
- 4
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletWater/entity/AppletWater.java View File

@ -4,14 +4,14 @@ import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.*;
import lombok.*;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.system.vo.AppletUser;
import org.jeecg.common.util.SpringContextUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.modules.demo.appletWithdrawal.entity.AppletWithdrawal;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
@ -97,4 +97,9 @@ public class AppletWater implements Serializable {
@Excel(name = "备注", width = 15)
@Schema(description = "备注")
private java.lang.String remarks;
@TableField(exist = false)
private AppletUser userInfo;
@TableField(exist = false)
private AppletWithdrawal withdrawal;
}

+ 71
- 0
jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/job/CouponExpireJob.java View File

@ -0,0 +1,71 @@
package org.jeecg.modules.job;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.demo.appletCouponRecord.entity.AppletCouponRecord;
import org.jeecg.modules.demo.appletCouponRecord.service.IAppletCouponRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
/**
* @Description: 优惠券过期检查定时任务
* @Author: jeecg-boot
* @Date: 2025-09-17
* @Version: V1.0
*/
@Slf4j
@Component
public class CouponExpireJob {
@Autowired
private IAppletCouponRecordService appletCouponRecordService;
/**
* 每3分钟检查一次优惠券过期情况
* 将过期的优惠券状态设置为2已过期
*/
@Scheduled(fixedRate = 3 * 60 * 1000) // 3分钟 = 3 * 60 * 1000毫秒
public void checkExpiredCoupons() {
log.info("开始执行优惠券过期检查任务...");
try {
Date now = new Date();
// 查询所有未使用且未过期的优惠券记录
List<AppletCouponRecord> records = appletCouponRecordService.lambdaQuery()
.eq(AppletCouponRecord::getStatus, "0") // 0-未使用
.lt(AppletCouponRecord::getEndTime, now) // 过期时间小于当前时间
.list();
if (records.isEmpty()) {
log.info("没有发现过期的优惠券");
return;
}
log.info("发现 {} 张过期优惠券,开始更新状态...", records.size());
// 批量更新过期优惠券状态为2
for (AppletCouponRecord record : records) {
record.setStatus("2"); // 2-已过期
record.setUpdateTime(now);
}
// 批量更新
boolean result = appletCouponRecordService.updateBatchById(records);
if (result) {
log.info("成功更新 {} 张过期优惠券状态", records.size());
} else {
log.error("更新过期优惠券状态失败");
}
} catch (Exception e) {
log.error("执行优惠券过期检查任务时发生异常: {}", e.getMessage(), e);
}
log.info("优惠券过期检查任务执行完成");
}
}

+ 20
- 1
jeecgboot-vue3/src/router/routes/staticRouter.ts View File

@ -20,4 +20,23 @@ export const AI_ROUTE: AppRouteRecordRaw = {
],
};
export const staticRoutesList = [AI_ROUTE];
export const APPLET_COURSE_PAGE_ROUTE: AppRouteRecordRaw = {
path: '',
name: 'applet-course-page-parent',
component: LAYOUT,
meta: {
title: 'applet-course-page',
},
children: [
{
path: '/applet/course-page',
name: 'applet-course-page',
component: () => import('/@/views/applet/course-page/AppletCoursePageList.vue'),
meta: {
title: '课程页面管理',
},
},
],
};
export const staticRoutesList = [AI_ROUTE, APPLET_COURSE_PAGE_ROUTE];

+ 11
- 11
jeecgboot-vue3/src/views/applet/coupon/AppletCoupon.data.ts View File

@ -55,16 +55,16 @@ export const formSchema: FormSchema[] = [
valueFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '发放数量',
field: 'count',
component: 'Input',
},
{
label: '已使用数量',
field: 'quantityused',
component: 'Input',
},
// {
// label: '发放数量',
// field: 'count',
// component: 'Input',
// },
// {
// label: '已使用数量',
// field: 'quantityused',
// component: 'Input',
// },
// TODO 主键隐藏字段,目前写死为ID
{
label: '',
@ -90,4 +90,4 @@ export const superQuerySchema = {
export function getBpmFormSchema(_formData): FormSchema[]{
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
return formSchema;
}
}

+ 24
- 4
jeecgboot-vue3/src/views/applet/coupon/AppletCouponList.vue View File

@ -5,8 +5,8 @@
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'appletCoupon:applet_coupon:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="'appletCoupon:applet_coupon:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'appletCoupon:applet_coupon:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<!-- <a-button type="primary" v-auth="'appletCoupon:applet_coupon:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>-->
<!-- <j-upload-button type="primary" v-auth="'appletCoupon:applet_coupon:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>-->
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
@ -34,6 +34,8 @@
</BasicTable>
<!-- 表单区域 -->
<AppletCouponModal @register="registerModal" @success="handleSuccess"></AppletCouponModal>
<!-- 发放弹窗 -->
<AppletCouponDistributeModal @register="registerDistributeModal" @success="handleSuccess"></AppletCouponDistributeModal>
</div>
</template>
@ -43,6 +45,7 @@
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import AppletCouponModal from './components/AppletCouponModal.vue'
import AppletCouponDistributeModal from './components/AppletCouponDistributeModal.vue'
import {columns, searchFormSchema, superQuerySchema} from './AppletCoupon.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './AppletCoupon.api';
import { downloadFile } from '/@/utils/common/renderUtils';
@ -58,6 +61,8 @@
const { createMessage } = useMessage();
//model
const [registerModal, {openModal}] = useModal();
//
const [registerDistributeModal, {openModal: openDistributeModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
@ -76,7 +81,7 @@
],
},
actionColumn: {
width: 120,
width: 200,
fixed:'right'
},
beforeFetch: (params) => {
@ -134,6 +139,16 @@
showFooter: true,
});
}
/**
* 发放优惠券
*/
function handleDistribute(record: Recordable) {
openDistributeModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
@ -171,6 +186,11 @@
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'appletCoupon:applet_coupon:edit'
},
{
label: '发放',
onClick: handleDistribute.bind(null, record),
auth: 'appletCoupon:applet_coupon:distribute'
}
]
}
@ -203,4 +223,4 @@
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
</style>
</style>

+ 365
- 0
jeecgboot-vue3/src/views/applet/coupon/components/AppletCouponDistributeModal.vue View File

@ -0,0 +1,365 @@
<template>
<BasicModal
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
:width="1000"
:height="650"
@ok="handleSubmit"
>
<div class="pt-3px pr-3px">
<!-- <div class="mb-4">
<a-alert
message="优惠券发放说明"
description="选择用户后点击确定发放优惠券。如果不选择任何用户,将发放给所有用户。"
type="info"
show-icon
/>
</div> -->
<!-- 搜索区域 -->
<div class="mb-4">
<a-row :gutter="16">
<a-col :span="8">
<a-input
v-model:value="searchForm.name"
placeholder="请输入昵称"
@input="handleSearch"
allowClear
/>
</a-col>
<a-col :span="8">
<a-input
v-model:value="searchForm.phone"
placeholder="请输入手机号"
@input="handleSearch"
allowClear
/>
</a-col>
<a-col :span="8">
<a-button @click="handleReset" style="margin-left: 8px">重置</a-button>
</a-col>
</a-row>
</div>
<div class="mb-4">
<a-space>
<!-- <a-button type="primary" @click="handleSelectAll">全选当前页</a-button>
<a-button @click="handleSelectNone">清空</a-button>
<a-button @click="handleSelectReverse">反选当前页</a-button> -->
<a-button type="primary" ghost @click="handleDistributeToAll">发放给所有用户</a-button>
</a-space>
</div>
<div class="mb-2">
<a-alert
v-if="selectedRowKeys.length > 0"
:message="`已选择 ${selectedRowKeys.length} 个用户`"
type="success"
show-icon
/>
</div>
<BasicTable
@register="registerTable"
:rowSelection="rowSelection"
:scroll="{ y: 300 }"
:dataSource="filteredDataSource"
:pagination="{ pageSize: 50, showSizeChanger: true, showQuickJumper: true }"
rowKey="id"
/>
</div>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref, reactive, watch } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { BasicTable, useTable, BasicColumn } from '/@/components/Table';
import { Alert as AAlert, Space as ASpace, Button as AButton, Row as ARow, Col as ACol, Input as AInput } from 'ant-design-vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
const emit = defineEmits(['success', 'register']);
const { createMessage } = useMessage();
const isUpdate = ref(true);
const couponId = ref('');
const selectedRowKeys = ref<string[]>([]);
const allUserData = ref<any[]>([]);
const filteredDataSource = ref<any[]>([]);
//
const searchForm = reactive({
name: '',
phone: '',
});
//
const columns: BasicColumn[] = [
{
title: '昵称',
dataIndex: 'name',
width: 120,
},
{
title: '手机号',
dataIndex: 'phone',
width: 120,
},
{
title: '第三方认证ID',
dataIndex: 'openid',
width: 200,
},
{
title: '创建时间',
dataIndex: 'createTime',
width: 160,
},
];
const [registerTable, { reload, setTableData }] = useTable({
title: '用户列表',
columns,
useSearchForm: false,
showTableSetting: false,
bordered: true,
pagination: false, // 使
actionColumn: {
width: 120,
title: '操作',
dataIndex: 'action',
},
});
//
const rowSelection = computed(() => ({
type: 'checkbox',
selectedRowKeys: unref(selectedRowKeys),
onChange: (keys: string[], selectedRows: any[]) => {
console.log('选中的行键:', keys);
console.log('选中的行数据:', selectedRows);
console.log('选中行的ID:', selectedRows.map(row => row.id));
// ID
const validKeys = keys.filter(key => key && typeof key === 'string' && key.length > 0);
selectedRowKeys.value = validKeys;
},
onSelect: (record: any, selected: boolean) => {
console.log('单行选择:', { record, selected, id: record.id });
if (!record.id) {
console.warn('用户记录缺少ID:', record);
return;
}
if (selected) {
if (!selectedRowKeys.value.includes(record.id)) {
selectedRowKeys.value.push(record.id);
}
} else {
selectedRowKeys.value = selectedRowKeys.value.filter(key => key !== record.id);
}
},
onSelectAll: (selected: boolean, selectedRows: any[], changeRows: any[]) => {
console.log('全选操作:', { selected, selectedRows, changeRows });
console.log('全选的ID:', selectedRows.map(row => row.id));
if (selected) {
// IDID
const currentPageIds = filteredDataSource.value
.map(item => item.id)
.filter(id => id && typeof id === 'string');
selectedRowKeys.value = [...new Set([...selectedRowKeys.value, ...currentPageIds])];
} else {
// ID
const currentPageIds = filteredDataSource.value
.map(item => item.id)
.filter(id => id && typeof id === 'string');
selectedRowKeys.value = selectedRowKeys.value.filter(key => !currentPageIds.includes(key));
}
},
getCheckboxProps: (record: any) => {
console.log('复选框属性:', { record, id: record.id });
return {
disabled: !record.id || typeof record.id !== 'string', // ID
name: record.id,
};
},
}));
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
couponId.value = data.record?.id || '';
//
selectedRowKeys.value = [];
searchForm.name = '';
searchForm.phone = '';
if (unref(isUpdate)) {
//
await loadAllUsers();
}
});
const getTitle = computed(() => (!unref(isUpdate) ? '新增优惠券发放' : '优惠券发放'));
//
async function loadAllUsers() {
try {
const result = await defHttp.get({
url: '/appletUser/appletUser/list',
params: {
pageNo: 1,
pageSize: 999999, //
},
});
// ID
const users = (result.records || []).filter(user => user && user.id);
allUserData.value = users;
filteredDataSource.value = users;
setTableData(users);
} catch (error) {
console.error('加载用户数据失败:', error);
createMessage.error('加载用户数据失败');
}
}
//
function handleSearch() {
const { name, phone } = searchForm;
if (!name && !phone) {
//
filteredDataSource.value = allUserData.value;
} else {
//
filteredDataSource.value = allUserData.value.filter(user => {
const matchName = !name || (user.name && user.name.includes(name));
const matchPhone = !phone || (user.phone && user.phone.includes(phone));
return matchName && matchPhone;
});
}
//
setTableData(filteredDataSource.value);
// ID
const currentIds = filteredDataSource.value.map(item => item.id).filter(id => id);
selectedRowKeys.value = selectedRowKeys.value.filter(key => currentIds.includes(key));
}
//
function handleReset() {
searchForm.name = '';
searchForm.phone = '';
filteredDataSource.value = allUserData.value;
setTableData(filteredDataSource.value);
}
//
function handleSelectAll() {
const currentPageIds = filteredDataSource.value.map((item) => item.id);
//
const newSelected = [...new Set([...selectedRowKeys.value, ...currentPageIds])];
selectedRowKeys.value = newSelected;
//
setTableData([...filteredDataSource.value]);
}
//
function handleSelectNone() {
selectedRowKeys.value = [];
//
setTableData([...filteredDataSource.value]);
}
//
function handleSelectReverse() {
const currentPageIds = filteredDataSource.value.map((item) => item.id);
const currentSelected = selectedRowKeys.value;
//
const toAdd = currentPageIds.filter(id => !currentSelected.includes(id));
const toRemove = currentPageIds.filter(id => currentSelected.includes(id));
selectedRowKeys.value = [
...currentSelected.filter(id => !toRemove.includes(id)),
...toAdd
];
//
setTableData([...filteredDataSource.value]);
}
//
async function handleDistributeToAll() {
try {
setModalProps({ confirmLoading: true });
await defHttp.post({
url: '/appletCoupon/appletCoupon/distribute',
params: {
couponId: couponId.value,
userIds: '', //
},
});
createMessage.success('优惠券发放成功!');
closeModal();
emit('success');
} catch (error) {
console.error('发放失败:', error);
createMessage.error('发放失败,请重试');
} finally {
setModalProps({ confirmLoading: false });
}
}
//
async function handleSubmit() {
try {
const selectedIds = selectedRowKeys.value;
console.log('提交时选中的ID:', selectedIds);
if (!selectedIds || selectedIds.length === 0) {
createMessage.warning('请选择要发放的用户');
return;
}
setModalProps({ confirmLoading: true });
await defHttp.post({
url: '/appletCoupon/appletCoupon/distribute',
params: {
couponId: couponId.value,
userIds: selectedRowKeys.value.join(','),
},
});
createMessage.success('发放成功');
closeModal();
emit('success');
} catch (error) {
console.error('发放失败:', error);
createMessage.error('发放失败: ' + (error.message || '未知错误'));
}
}
</script>
<style lang="less" scoped>
.pt-3px {
padding-top: 3px;
}
.pr-3px {
padding-right: 3px;
}
.mb-4 {
margin-bottom: 16px;
}
.mb-2 {
margin-bottom: 8px;
}
</style>

+ 1
- 1
jeecgboot-vue3/src/views/applet/coupon/components/AppletCouponModal.vue View File

@ -1,5 +1,5 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" :height="600" @ok="handleSubmit">
<BasicForm @register="registerForm" name="AppletCouponForm" />
</BasicModal>
</template>


+ 68
- 0
jeecgboot-vue3/src/views/applet/course-page/AppletCoursePage.api.ts View File

@ -0,0 +1,68 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/appletCoursePage/appletCoursePage/list',
save='/appletCoursePage/appletCoursePage/add',
edit='/appletCoursePage/appletCoursePage/edit',
deleteOne = '/appletCoursePage/appletCoursePage/delete',
deleteBatch = '/appletCoursePage/appletCoursePage/deleteBatch',
importExcel = '/appletCoursePage/appletCoursePage/importExcel',
exportXls = '/appletCoursePage/appletCoursePage/exportXls',
queryById = '/appletCoursePage/appletCoursePage/queryById',
}
/**
* api
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
*/
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();
});
}
/**
*
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}
/**
* ID查询单个记录
*/
export const getById = (params) => {
return defHttp.get({url: Api.queryById, params});
}

+ 111
- 0
jeecgboot-vue3/src/views/applet/course-page/AppletCoursePage.data.ts View File

@ -0,0 +1,111 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '排序',
align:"center",
dataIndex: 'sort'
},
{
title: '付费',
align:"center",
dataIndex: 'pay',
customRender:({text}) => {
return render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
},
},
{
title: '内容',
align:"center",
dataIndex: 'content'
},
{
title: '类型',
align:"center",
dataIndex: 'type'
},
{
title: '课程',
align:"center",
dataIndex: 'courseId'
},
{
title: '上架',
align:"center",
dataIndex: 'status',
customRender:({text}) => {
return render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
},
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '排序',
field: 'sort',
component: 'InputNumber',
},
{
label: '付费',
field: 'pay',
component: 'JSwitch',
componentProps:{
},
},
{
label: '内容',
field: 'content',
component: 'Input',
},
{
label: '类型',
field: 'type',
component: 'Input',
},
{
label: '课程',
field: 'courseId',
component: 'Input',
show: false, // 隐藏课程字段,通过参数传递
},
{
label: '上架',
field: 'status',
component: 'JSwitch',
componentProps:{
},
},
// TODO 主键隐藏字段,目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
];
// 高级查询数据
export const superQuerySchema = {
sort: {title: '排序',order: 0,view: 'number', type: 'number',},
pay: {title: '付费',order: 1,view: 'switch', type: 'string',},
content: {title: '内容',order: 2,view: 'text', type: 'string',},
type: {title: '类型',order: 3,view: 'text', type: 'string',},
courseId: {title: '课程',order: 4,view: 'text', type: 'string',},
status: {title: '上架',order: 5,view: 'switch', type: 'string',},
};
/**
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
return formSchema;
}

+ 1217
- 0
jeecgboot-vue3/src/views/applet/course-page/AppletCoursePageList.vue
File diff suppressed because it is too large
View File


+ 37
- 0
jeecgboot-vue3/src/views/applet/course-page/components/AppletCoursePageForm.vue View File

@ -0,0 +1,37 @@
<template>
<div>
<BasicForm @register="registerForm" @submit="handleSubmit"/>
</div>
</template>
<script lang="ts" setup>
import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from '../AppletCoursePage.data';
import { saveOrUpdate } from '../AppletCoursePage.api';
import { useMessage } from '/@/hooks/web/useMessage';
const { createMessage } = useMessage();
const emit = defineEmits(['success']);
const [registerForm, { validate, resetFields }] = useForm({
labelWidth: 120,
schemas: formSchema,
showActionButtonGroup: true,
actionColOptions: {
span: 24,
},
baseColProps: { span: 12 },
});
async function handleSubmit() {
try {
const values = await validate();
await saveOrUpdate(values, false);
createMessage.success('保存成功');
await resetFields();
emit('success');
} catch (error) {
createMessage.error('保存失败');
}
}
</script>

+ 59
- 0
jeecgboot-vue3/src/views/applet/course-page/components/AppletCoursePageModal.vue View File

@ -0,0 +1,59 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit">
<BasicForm @register="registerForm"/>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from '../AppletCoursePage.data';
import { saveOrUpdate } from '../AppletCoursePage.api';
// Emits
const emit = defineEmits(['success', 'register']);
const isUpdate = ref(true);
const rowId = ref('');
//
const [registerForm, { setProps, resetFields, setFieldsValue, validate }] = useForm({
//labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: { span: 24 }
});
//
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({ confirmLoading: false, showCancelBtn: !!data?.showFooter, showOkBtn: !!data?.showFooter });
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
rowId.value = data.record.id;
//
await setFieldsValue({
...data.record,
});
}
//
if (data?.showFooter === false) {
setProps({ disabled: true });
}
});
//
const getTitle = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
//
async function handleSubmit(v) {
try {
const values = await validate();
setModalProps({ confirmLoading: true });
//
await saveOrUpdate(values, unref(isUpdate));
//
closeModal();
//
emit('success');
} finally {
setModalProps({ confirmLoading: false });
}
}
</script>

+ 19
- 0
jeecgboot-vue3/src/views/applet/course/AppletCourse.data.ts View File

@ -37,6 +37,25 @@ export const columns: BasicColumn[] = [
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "书籍",
field: 'bookId',
component: 'JSelectMultiple',
componentProps:{
dictCode:"applet_books,books_name,id"
},
//colProps: {span: 6},
},
{
label: "中文课程名",
field: "chinese",
component: 'JInput',
},
{
label: "英文课程名",
field: "english",
component: 'JInput',
},
];
//表单数据
export const formSchema: FormSchema[] = [


+ 21
- 2
jeecgboot-vue3/src/views/applet/course/AppletCourseList.vue View File

@ -49,6 +49,7 @@
import { useUserStore } from '/@/store/modules/user';
import { useMessage } from '/@/hooks/web/useMessage';
import { getDateByPicker } from '/@/utils';
import { useRouter } from 'vue-router';
//
const fieldPickers = reactive({
});
@ -56,6 +57,7 @@
const checkedKeys = ref<Array<string | number>>([]);
const userStore = useUserStore();
const { createMessage } = useMessage();
const router = useRouter();
//model
const [registerModal, {openModal}] = useModal();
//table
@ -76,7 +78,7 @@
],
},
actionColumn: {
width: 120,
width: 180,
fixed:'right'
},
beforeFetch: (params) => {
@ -162,6 +164,18 @@
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 页面管理
*/
function handlePageManage(record: Recordable) {
router.push({
path: '/applet/course-page',
query: {
courseId: record.id
}
});
}
/**
* 操作栏
*/
@ -171,6 +185,11 @@
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'appletCourse:applet_course:edit'
},
{
label: '页面管理',
onClick: handlePageManage.bind(null, record),
auth: 'appletCourse:applet_course:page'
}
]
}
@ -203,4 +222,4 @@
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
</style>
</style>

Loading…
Cancel
Save