Browse Source

修复bug

master
主管理员 1 year ago
parent
commit
66db31823d
99 changed files with 6197 additions and 261 deletions
  1. +1
    -1
      admin-pc/.env
  2. +2
    -2
      admin-pc/public/index.html
  3. +1
    -1
      admin-pc/src/components/layouts/TabLayout.vue
  4. +1
    -1
      admin-pc/src/components/layouts/UserLayout.vue
  5. +2
    -2
      admin-pc/src/components/page/GlobalHeader.vue
  6. +1
    -1
      admin-pc/src/components/tools/Logo.vue
  7. +25
    -0
      module-common/src/main/java/org/jeecg/api/bean/FansPageBean.java
  8. +66
    -20
      module-common/src/main/java/org/jeecg/api/controller/AppletIndexController.java
  9. +36
    -4
      module-common/src/main/java/org/jeecg/api/controller/AppletInfoController.java
  10. +31
    -4
      module-common/src/main/java/org/jeecg/api/service/AppletIndexService.java
  11. +424
    -122
      module-common/src/main/java/org/jeecg/api/service/impl/AppletIndexServiceImpl.java
  12. +12
    -1
      module-common/src/main/java/org/jeecg/api/service/impl/AppletLoginServiceImpl.java
  13. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonClass/controller/CommonClassController.java
  14. +5
    -1
      module-common/src/main/java/org/jeecg/modules/commonClass/entity/CommonClass.java
  15. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonClass/mapper/CommonClassMapper.java
  16. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonClass/service/ICommonClassService.java
  17. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonClass/service/impl/CommonClassServiceImpl.java
  18. +7
    -0
      module-common/src/main/java/org/jeecg/modules/commonClass/vue/CommonClassList.vue
  19. +5
    -0
      module-common/src/main/java/org/jeecg/modules/commonClass/vue/modules/CommonClassForm.vue
  20. +13
    -0
      module-common/src/main/java/org/jeecg/modules/commonClass/vue3/CommonClass.data.ts
  21. +171
    -0
      module-common/src/main/java/org/jeecg/modules/commonFack/controller/CommonFackController.java
  22. +70
    -0
      module-common/src/main/java/org/jeecg/modules/commonFack/entity/CommonFack.java
  23. +17
    -0
      module-common/src/main/java/org/jeecg/modules/commonFack/mapper/CommonFackMapper.java
  24. +5
    -0
      module-common/src/main/java/org/jeecg/modules/commonFack/mapper/xml/CommonFackMapper.xml
  25. +14
    -0
      module-common/src/main/java/org/jeecg/modules/commonFack/service/ICommonFackService.java
  26. +19
    -0
      module-common/src/main/java/org/jeecg/modules/commonFack/service/impl/CommonFackServiceImpl.java
  27. +196
    -0
      module-common/src/main/java/org/jeecg/modules/commonFack/vue/CommonFackList.vue
  28. +124
    -0
      module-common/src/main/java/org/jeecg/modules/commonFack/vue/modules/CommonFackForm.vue
  29. +84
    -0
      module-common/src/main/java/org/jeecg/modules/commonFack/vue/modules/CommonFackModal.Style#Drawer.vue
  30. +60
    -0
      module-common/src/main/java/org/jeecg/modules/commonFack/vue/modules/CommonFackModal.vue
  31. +61
    -0
      module-common/src/main/java/org/jeecg/modules/commonFack/vue3/CommonFack.api.ts
  32. +66
    -0
      module-common/src/main/java/org/jeecg/modules/commonFack/vue3/CommonFack.data.ts
  33. +162
    -0
      module-common/src/main/java/org/jeecg/modules/commonFack/vue3/CommonFackList.vue
  34. +58
    -0
      module-common/src/main/java/org/jeecg/modules/commonFack/vue3/components/CommonFackModal.vue
  35. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonOrder/controller/CommonOrderController.java
  36. +22
    -2
      module-common/src/main/java/org/jeecg/modules/commonOrder/entity/CommonOrder.java
  37. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonOrder/mapper/CommonOrderMapper.java
  38. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonOrder/service/ICommonOrderService.java
  39. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonOrder/service/impl/CommonOrderServiceImpl.java
  40. +30
    -0
      module-common/src/main/java/org/jeecg/modules/commonOrder/vue/CommonOrderList.vue
  41. +25
    -0
      module-common/src/main/java/org/jeecg/modules/commonOrder/vue/modules/CommonOrderForm.vue
  42. +50
    -0
      module-common/src/main/java/org/jeecg/modules/commonOrder/vue3/CommonOrder.data.ts
  43. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonOrderSku/controller/CommonOrderSkuController.java
  44. +9
    -1
      module-common/src/main/java/org/jeecg/modules/commonOrderSku/entity/CommonOrderSku.java
  45. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonOrderSku/mapper/CommonOrderSkuMapper.java
  46. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonOrderSku/service/ICommonOrderSkuService.java
  47. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonOrderSku/service/impl/CommonOrderSkuServiceImpl.java
  48. +12
    -0
      module-common/src/main/java/org/jeecg/modules/commonOrderSku/vue/CommonOrderSkuList.vue
  49. +10
    -0
      module-common/src/main/java/org/jeecg/modules/commonOrderSku/vue/modules/CommonOrderSkuForm.vue
  50. +20
    -0
      module-common/src/main/java/org/jeecg/modules/commonOrderSku/vue3/CommonOrderSku.data.ts
  51. +229
    -0
      module-common/src/main/java/org/jeecg/modules/commonPidClass/controller/CommonPidClassController.java
  52. +79
    -0
      module-common/src/main/java/org/jeecg/modules/commonPidClass/entity/CommonPidClass.java
  53. +22
    -0
      module-common/src/main/java/org/jeecg/modules/commonPidClass/mapper/CommonPidClassMapper.java
  54. +9
    -0
      module-common/src/main/java/org/jeecg/modules/commonPidClass/mapper/xml/CommonPidClassMapper.xml
  55. +38
    -0
      module-common/src/main/java/org/jeecg/modules/commonPidClass/service/ICommonPidClassService.java
  56. +191
    -0
      module-common/src/main/java/org/jeecg/modules/commonPidClass/service/impl/CommonPidClassServiceImpl.java
  57. +360
    -0
      module-common/src/main/java/org/jeecg/modules/commonPidClass/vue/CommonPidClassList.vue
  58. +159
    -0
      module-common/src/main/java/org/jeecg/modules/commonPidClass/vue/modules/CommonPidClassModal.vue
  59. +82
    -0
      module-common/src/main/java/org/jeecg/modules/commonPidClass/vue3/CommonPidClass.api.ts
  60. +51
    -0
      module-common/src/main/java/org/jeecg/modules/commonPidClass/vue3/CommonPidClass.data.ts
  61. +272
    -0
      module-common/src/main/java/org/jeecg/modules/commonPidClass/vue3/CommonPidClassList.vue
  62. +87
    -0
      module-common/src/main/java/org/jeecg/modules/commonPidClass/vue3/components/CommonPidClassModal.vue
  63. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonShop/controller/CommonShopController.java
  64. +78
    -17
      module-common/src/main/java/org/jeecg/modules/commonShop/entity/CommonShop.java
  65. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonShop/mapper/CommonShopMapper.java
  66. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonShop/service/ICommonShopService.java
  67. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonShop/service/impl/CommonShopServiceImpl.java
  68. +114
    -17
      module-common/src/main/java/org/jeecg/modules/commonShop/vue/CommonShopList.vue
  69. +94
    -12
      module-common/src/main/java/org/jeecg/modules/commonShop/vue/modules/CommonShopForm.vue
  70. +186
    -29
      module-common/src/main/java/org/jeecg/modules/commonShop/vue3/CommonShop.data.ts
  71. +171
    -0
      module-common/src/main/java/org/jeecg/modules/commonUser/controller/CommonUserController.java
  72. +74
    -0
      module-common/src/main/java/org/jeecg/modules/commonUser/entity/CommonUser.java
  73. +17
    -0
      module-common/src/main/java/org/jeecg/modules/commonUser/mapper/CommonUserMapper.java
  74. +5
    -0
      module-common/src/main/java/org/jeecg/modules/commonUser/mapper/xml/CommonUserMapper.xml
  75. +14
    -0
      module-common/src/main/java/org/jeecg/modules/commonUser/service/ICommonUserService.java
  76. +19
    -0
      module-common/src/main/java/org/jeecg/modules/commonUser/service/impl/CommonUserServiceImpl.java
  77. +201
    -0
      module-common/src/main/java/org/jeecg/modules/commonUser/vue/CommonUserList.vue
  78. +129
    -0
      module-common/src/main/java/org/jeecg/modules/commonUser/vue/modules/CommonUserForm.vue
  79. +84
    -0
      module-common/src/main/java/org/jeecg/modules/commonUser/vue/modules/CommonUserModal.Style#Drawer.vue
  80. +60
    -0
      module-common/src/main/java/org/jeecg/modules/commonUser/vue/modules/CommonUserModal.vue
  81. +61
    -0
      module-common/src/main/java/org/jeecg/modules/commonUser/vue3/CommonUser.api.ts
  82. +73
    -0
      module-common/src/main/java/org/jeecg/modules/commonUser/vue3/CommonUser.data.ts
  83. +162
    -0
      module-common/src/main/java/org/jeecg/modules/commonUser/vue3/CommonUserList.vue
  84. +58
    -0
      module-common/src/main/java/org/jeecg/modules/commonUser/vue3/components/CommonUserModal.vue
  85. +171
    -0
      module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/controller/PopularizeRecruitLogController.java
  86. +66
    -0
      module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/entity/PopularizeRecruitLog.java
  87. +17
    -0
      module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/mapper/PopularizeRecruitLogMapper.java
  88. +5
    -0
      module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/mapper/xml/PopularizeRecruitLogMapper.xml
  89. +14
    -0
      module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/service/IPopularizeRecruitLogService.java
  90. +19
    -0
      module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/service/impl/PopularizeRecruitLogServiceImpl.java
  91. +189
    -0
      module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/vue/PopularizeRecruitLogList.vue
  92. +119
    -0
      module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/vue/modules/PopularizeRecruitLogForm.vue
  93. +84
    -0
      module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/vue/modules/PopularizeRecruitLogModal.Style#Drawer.vue
  94. +60
    -0
      module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/vue/modules/PopularizeRecruitLogModal.vue
  95. +61
    -0
      module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/vue3/PopularizeRecruitLog.api.ts
  96. +53
    -0
      module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/vue3/PopularizeRecruitLog.data.ts
  97. +162
    -0
      module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/vue3/PopularizeRecruitLogList.vue
  98. +58
    -0
      module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/vue3/components/PopularizeRecruitLogModal.vue
  99. +7
    -7
      module-system/src/main/resources/pay_weixin.properties

+ 1
- 1
admin-pc/.env View File

@ -1,5 +1,5 @@
NODE_ENV=production
VUE_APP_PLATFORM_NAME=陌美人后台管理系统
VUE_APP_PLATFORM_NAME=陌美人珠宝管理系统
# 开启单点登录
VUE_APP_SSO=false
# 开启微应用模式


+ 2
- 2
admin-pc/public/index.html View File

@ -5,7 +5,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>陌美人系统</title>
<title>陌美人珠宝</title>
<link rel="icon" href="<%= BASE_URL %>logo.png">
<script src="<%= BASE_URL %>cdn/babel-polyfill/polyfill_7_2_5.js"></script>
<style>
@ -249,7 +249,7 @@
<div id="loader"></div>
<div class="loader-section section-left"></div>
<div class="loader-section section-right"></div>
<div class="load_title">正在加载 陌美人后台管理系统,请耐心等待
<div class="load_title">正在加载 陌美人珠宝后台管理系统,请耐心等待
</div>
</div>


+ 1
- 1
admin-pc/src/components/layouts/TabLayout.vue View File

@ -177,7 +177,7 @@
// update-begin-author:sunjianlei date:20200120 for:
changeTitle(title) {
let projectTitle = "陌美人系统"
let projectTitle = "陌美人珠宝"
//
if (this.$route.path === indexKey) {
document.title = projectTitle


+ 1
- 1
admin-pc/src/components/layouts/UserLayout.vue View File

@ -5,7 +5,7 @@
<div class="header">
<a href="/">
<img src="~@/assets/logo.png" class="logo" alt="logo">
<span class="title">陌美人系统</span>
<span class="title">陌美人珠宝</span>
</a>
</div>
<!-- <div class="desc">-->


+ 2
- 2
admin-pc/src/components/page/GlobalHeader.vue View File

@ -17,8 +17,8 @@
:type="collapsed ? 'menu-unfold' : 'menu-fold'"
@click="toggle"/>
<span v-if="device === 'desktop'">欢迎进入 陌美人系统</span>
<span v-else>陌美人系统</span>
<span v-if="device === 'desktop'">欢迎进入 陌美人珠宝</span>
<span v-else>陌美人珠宝</span>
<user-menu :theme="theme"/>
</div>


+ 1
- 1
admin-pc/src/components/tools/Logo.vue View File

@ -21,7 +21,7 @@
props: {
title: {
type: String,
default: '陌美人',
default: '陌美人珠宝',
required: false
},
showTitle: {


+ 25
- 0
module-common/src/main/java/org/jeecg/api/bean/FansPageBean.java View File

@ -0,0 +1,25 @@
package org.jeecg.api.bean;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class FansPageBean {
//用户头像
private String headImage;
//用户昵称
private String nickName;
//用户下单量
private Integer orderNum;
//用户佣金
private BigDecimal commission;
//时间
private Date createTime;
}

+ 66
- 20
module-common/src/main/java/org/jeecg/api/controller/AppletIndexController.java View File

@ -7,6 +7,7 @@ import lombok.extern.slf4j.Slf4j;
import org.jeecg.api.bean.PageBean;
import org.jeecg.api.service.AppletIndexService;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.commonUser.entity.CommonUser;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@ -57,6 +58,20 @@ public class AppletIndexController {
//获取二级分类数据接口
@ApiOperation(value="获取二级分类数据接口", notes="获取二级分类数据接口")
@GetMapping(value = "/getCategoryPidList")
public Result<?> getCategoryPidList(String title){
return apiRiceService.getCategoryPidList(title);
}
//查询顶级分类数据列表
@ApiOperation(value="获取一级分类数据列表", notes="获取一级分类数据列表")
@GetMapping(value = "/getPidList")
public Result<?> getPidList() {
return apiRiceService.getPidList();
}
@ -77,6 +92,12 @@ public class AppletIndexController {
return apiRiceService.getRiceAdList(pageBean);
}
//获取首页广告列表详情
@ApiOperation(value="获取首页广告列表详情", notes="获取首页广告列表详情")
@GetMapping(value = "/getRiceAdDetail")
public Result<?> getRiceAdDetail(String id) {
return apiRiceService.getRiceAdDetail(id);
}
@ -85,8 +106,8 @@ public class AppletIndexController {
//获取分类分页商品列表接口
@ApiOperation(value="获取分类分页商品列表接口", notes="获取分类分页商品列表接口")
@GetMapping(value = "/getClassShopPageList")
public Result<?> getClassShopPageList(PageBean pageBean, String classId) {
return apiRiceService.getClassShopPageList(pageBean,classId);
public Result<?> getClassShopPageList(PageBean pageBean,String title, String classId) {
return apiRiceService.getClassShopPageList(pageBean,title,classId);
}
@ -163,11 +184,13 @@ public class AppletIndexController {
//创建订单
@ApiOperation(value="创建订单", notes="创建订单")
@GetMapping(value = "/createOrder")
public Result<?> createOrder(@RequestHeader("X-Access-Token") String token, String shopId, Integer num,String addressId) {
return apiRiceService.createOrder(token,shopId,num,addressId);
public Result<?> createOrder(@RequestHeader("X-Access-Token") String token, String shopId, Integer num,String addressId,Integer payType,String couponId) {
return apiRiceService.createOrder(token,shopId,num,addressId,payType,couponId);
}
//创建订单
@ApiOperation(value="创建订单-再次支付", notes="创建订单-再次支付")
@GetMapping(value = "/createOrderTwo")
@ -175,22 +198,22 @@ public class AppletIndexController {
return apiRiceService.createOrderTwo(token,orderId);
}
//商城-加入购物车之后一次下多个订单
@ApiOperation(value="商城-加入购物车之后一次下多个订单", notes="商城-加入购物车之后一次下多个订单")
@PostMapping("/createSumOrder")
public Result<?> createSumOrder(@RequestHeader("X-Access-Token") String token,String list,String addressId){
return apiRiceService.createSumOrder(token,list,addressId);
}
//商城-加入购物车之后一次下多个订单 - 再次下单
@ApiOperation(value="商城-加入购物车之后一次下多个订单 - 再次下单", notes="商城-加入购物车之后一次下多个订单 - 再次下单")
@PostMapping("/createSumOrderAgain")
public Result<?> createSumOrderAgain(@RequestHeader("X-Access-Token") String token,String orderId){
return apiRiceService.createSumOrderAgain(token,orderId);
}
//
// //商城-加入购物车之后一次下多个订单
// @ApiOperation(value="商城-加入购物车之后一次下多个订单", notes="商城-加入购物车之后一次下多个订单")
// @PostMapping("/createSumOrder")
// public Result<?> createSumOrder(@RequestHeader("X-Access-Token") String token,String list,String addressId){
// return apiRiceService.createSumOrder(token,list,addressId);
// }
//
//
//
// //商城-加入购物车之后一次下多个订单 - 再次下单
// @ApiOperation(value="商城-加入购物车之后一次下多个订单 - 再次下单", notes="商城-加入购物车之后一次下多个订单 - 再次下单")
// @PostMapping("/createSumOrderAgain")
// public Result<?> createSumOrderAgain(@RequestHeader("X-Access-Token") String token,String orderId){
// return apiRiceService.createSumOrderAgain(token,orderId);
// }
@ -211,6 +234,29 @@ public class AppletIndexController {
}
//取消订单
@ApiOperation(value="取消订单", notes="取消订单")
@GetMapping(value = "/cancelOrder")
public Result<?> cancelOrder(@RequestHeader("X-Access-Token") String token,String orderId) {
return apiRiceService.cancelOrder(token,orderId);
}
//根据用户查询渠合伙人申请信息表单
@ApiOperation(value="根据用户查询渠合伙人申请信息表单", notes="根据用户查询渠合伙人申请信息表单")
@GetMapping(value = "/getCommonUser")
public Result<?> getCommonUser(@RequestHeader("X-Access-Token") String token){
return apiRiceService.getCommonUser(token);
}
//增加或者修改渠道申请信息
@ApiOperation(value="增加或者修改合伙人申请信息", notes="增加或者修改合伙人申请信息")
@PostMapping(value = "/addOrUpdateCommonUser")
public Result<?> addOrUpdateCommonUser(@RequestHeader("X-Access-Token") String token, CommonUser commonUser){
return apiRiceService.addOrUpdateCommonUser(token,commonUser);
}


+ 36
- 4
module-common/src/main/java/org/jeecg/api/controller/AppletInfoController.java View File

@ -7,6 +7,7 @@ import org.jeecg.api.bean.PageBean;
import org.jeecg.api.service.AppletIndexService;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.commonAddress.entity.CommonAddress;
import org.jeecg.modules.commonFack.entity.CommonFack;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@ -25,16 +26,16 @@ public class AppletInfoController {
//获取优惠券信息
@ApiOperation(value="获取优惠券信息", notes="获取优惠券信息")
@GetMapping(value = "/getRiceCouponList")
public Result<?> getRiceCouponList(@RequestHeader("X-Access-Token") String token,PageBean pageBean) {
return apiRiceService.getRiceCouponList(token,pageBean);
public Result<?> getRiceCouponList(@RequestHeader("X-Access-Token") String token,Integer state,PageBean pageBean) {
return apiRiceService.getRiceCouponList(token,state,pageBean);
}
//获取流水记录带分页
@ApiOperation(value="获取流水记录带分页", notes="获取流水记录带分页")
@GetMapping(value = "/getWaterPageList")
public Result<?> getWaterPageList(@RequestHeader("X-Access-Token") String token, PageBean pageBean){
return apiRiceService.getWaterPageList(token,pageBean);
public Result<?> getWaterPageList(@RequestHeader("X-Access-Token") String token,String timeTitle, PageBean pageBean){
return apiRiceService.getWaterPageList(token,timeTitle,pageBean);
}
//获取订单列表带分页
@ -60,6 +61,8 @@ public class AppletInfoController {
//获取地址列表带分页
@ApiOperation(value="获取地址列表带分页", notes="获取地址列表带分页")
@GetMapping(value = "/getAddressPageList")
@ -107,6 +110,7 @@ public class AppletInfoController {
//删除地址
@ApiOperation(value="删除地址", notes="删除地址")
@GetMapping(value = "/deleteAddress")
@ -132,6 +136,18 @@ public class AppletInfoController {
}
//领取新人优惠券
@ApiOperation(value="领取新人优惠券", notes="领取新人优惠券")
@GetMapping(value = "/getRiceCoupon")
public Result<?> getRiceCoupon(@RequestHeader("X-Access-Token") String token){
return apiRiceService.getRiceCoupon(token);
}
//充值
@ApiOperation(value="充值", notes="充值")
@ -153,4 +169,20 @@ public class AppletInfoController {
//获取我的直接推荐间接推荐用户列表带分页
@ApiOperation(value="获取我的直接推荐间接推荐用户列表带分页", notes="获取我的直接推荐间接推荐用户列表带分页")
@GetMapping(value = "/getHanHaiMemberUser")
public Result<?> getHanHaiMemberUser(@RequestHeader("X-Access-Token") String token,Integer state,PageBean pageBean){
return apiRiceService.getHanHaiMemberUser(token,state,pageBean);
}
//提交反馈信息
@ApiOperation(value="提交反馈信息", notes="提交反馈信息")
@PostMapping(value = "/addFeedback")
public Result<?> addFeedback(@RequestHeader("X-Access-Token") String token, CommonFack feedback){
return apiRiceService.addFeedback(token,feedback);
}
}

+ 31
- 4
module-common/src/main/java/org/jeecg/api/service/AppletIndexService.java View File

@ -3,6 +3,8 @@ package org.jeecg.api.service;
import org.jeecg.api.bean.PageBean;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.commonAddress.entity.CommonAddress;
import org.jeecg.modules.commonFack.entity.CommonFack;
import org.jeecg.modules.commonUser.entity.CommonUser;
import org.springframework.web.bind.annotation.RequestHeader;
import java.math.BigDecimal;
@ -27,6 +29,8 @@ public interface AppletIndexService {
//获取首页广告列表
Result<?> getRiceAdList(PageBean pageBean);
//获取首页广告列表详情
Result<?> getRiceAdDetail(String id);
//获取首页商品详情
Result<?> getRiceProductDetail(String id);
@ -38,7 +42,7 @@ public interface AppletIndexService {
//创建订单
Result<?> createOrder(String token,String shopId,Integer num,String addressId);
Result<?> createOrder(String token,String shopId,Integer num,String addressId,Integer payType,String couponId);
//再次支付
@ -66,14 +70,14 @@ public interface AppletIndexService {
Result<?> updateCartNum(String token,String id,Integer num);
Result<?> getClassShopPageList(PageBean pageBean, String classId);
Result<?> getClassShopPageList(PageBean pageBean,String title, String classId);
//获取优惠券信息列表
Result<?> getRiceCouponList(String token, PageBean pageBean);
Result<?> getRiceCouponList(String token, Integer state,PageBean pageBean);
//获取流水记录带分页
Result<?> getWaterPageList(String token,PageBean pageBean);
Result<?> getWaterPageList(String token,String timeTitle,PageBean pageBean);
//获取订单列表带分页
Result<?> getOrderPageList(String token, PageBean pageBean,Integer state);
@ -102,6 +106,12 @@ public interface AppletIndexService {
//增加或者修改地址
Result<?> addOrUpdateAddress(String token, CommonAddress commonAddress);
Result<?> getCategoryPidList(String title);
Result<?> getPidList();
//删除地址
Result<?> deleteAddress(String token,String id);
@ -113,6 +123,10 @@ public interface AppletIndexService {
Result<?> getRiceInfo(String token);
//领取新人优惠券
Result<?> getRiceCoupon(String token);
//充值
Result<?> recharge(String token, BigDecimal money);
@ -124,8 +138,21 @@ public interface AppletIndexService {
Result<?> confirmOrder(String token,String orderId);
//取消订单
Result<?> cancelOrder(String token,String orderId);
//根据用户查询渠道申请信息表单
Result<?> getCommonUser(String token);
//增加或者修改渠道申请信息
Result<?> addOrUpdateCommonUser(String token, CommonUser commonUser);
Result<?> getHanHaiMemberUser(String token,Integer state,PageBean pageBean);
Result<?> addFeedback(String token, CommonFack feedback);
}

+ 424
- 122
module-common/src/main/java/org/jeecg/api/service/impl/AppletIndexServiceImpl.java View File

@ -12,6 +12,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.jeecg.api.bean.FansPageBean;
import org.jeecg.api.bean.HttpClientUtil;
import org.jeecg.api.bean.PageBean;
import org.jeecg.api.bean.WxQrCodeVo;
@ -30,6 +31,8 @@ import org.jeecg.modules.commonConfig.entity.CommonConfig;
import org.jeecg.modules.commonConfig.service.ICommonConfigService;
import org.jeecg.modules.commonCoupon.entity.CommonCoupon;
import org.jeecg.modules.commonCoupon.service.ICommonCouponService;
import org.jeecg.modules.commonFack.entity.CommonFack;
import org.jeecg.modules.commonFack.service.ICommonFackService;
import org.jeecg.modules.commonIcon.entity.CommonIcon;
import org.jeecg.modules.commonIcon.service.ICommonIconService;
import org.jeecg.modules.commonIconImage.entity.CommonIconImage;
@ -46,8 +49,12 @@ import org.jeecg.modules.commonOrder.entity.CommonOrder;
import org.jeecg.modules.commonOrder.service.ICommonOrderService;
import org.jeecg.modules.commonOrderSku.entity.CommonOrderSku;
import org.jeecg.modules.commonOrderSku.service.ICommonOrderSkuService;
import org.jeecg.modules.commonPidClass.entity.CommonPidClass;
import org.jeecg.modules.commonPidClass.service.ICommonPidClassService;
import org.jeecg.modules.commonShop.entity.CommonShop;
import org.jeecg.modules.commonShop.service.ICommonShopService;
import org.jeecg.modules.commonUser.entity.CommonUser;
import org.jeecg.modules.commonUser.service.ICommonUserService;
import org.jeecg.modules.commonVip.entity.CommonVip;
import org.jeecg.modules.commonVip.service.ICommonVipService;
import org.jeecg.modules.commonVipConfig.entity.CommonVipConfig;
@ -70,7 +77,11 @@ import javax.annotation.Resource;
import javax.transaction.Transactional;
import java.io.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@Service
@ -123,8 +134,14 @@ public class AppletIndexServiceImpl implements AppletIndexService {
@Resource
private ICommonVipService commonVipService;
@Resource
private ICommonUserService commonUserService;
@Resource
private ICommonFackService commonFackService;
@Resource
private ICommonPidClassService commonPidClassService;
@ -172,22 +189,46 @@ public class AppletIndexServiceImpl implements AppletIndexService {
return Result.OK(page1);
}
//获取首页广告列表详情
@Override
public Result<?> getRiceAdDetail(String id){
CommonIcon byId = commonIconService.getById(id);
return Result.OK(byId);
}
@Override
public Result<?> getClassShopPageList(PageBean pageBean, String classId){
public Result<?> getClassShopPageList(PageBean pageBean, String title,String classId){
Page<CommonShop> page = new Page<CommonShop>(pageBean.getPageNo(), pageBean.getPageSize());
Page<CommonShop> page1 = commonShopService.page(page);
Page<CommonShop> pageList = commonShopService.page(page);
//如果分类标识不为空
if(classId!=null){
IPage<CommonShop> pageList =
pageList =
commonShopService.lambdaQuery()
.eq(CommonShop::getClassId,classId)
.eq(CommonShop::getType,2)
.orderByDesc(CommonShop::getCreateTime)
.page(page);
return Result.OK(pageList);
if(StringUtils.isNotBlank(title)){
pageList =
commonShopService.lambdaQuery()
.eq(CommonShop::getCommonPidClassId,classId)
.like(CommonShop::getTitle,title)
.orderByDesc(CommonShop::getCreateTime)
.page(page);
}
}
return Result.OK(page1);
if(StringUtils.isNotBlank(title)){
pageList =
commonShopService.lambdaQuery()
.like(CommonShop::getTitle,title)
.orderByDesc(CommonShop::getCreateTime)
.page(page);
}
return Result.OK(pageList);
}
@ -195,14 +236,15 @@ public class AppletIndexServiceImpl implements AppletIndexService {
//获取优惠券信息列表
@Override
public Result<?> getRiceCouponList(String token, PageBean pageBean){
public Result<?> getRiceCouponList(String token, Integer state,PageBean pageBean){
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
Page<CommonCoupon> page = new Page<CommonCoupon>(pageBean.getPageNo(), pageBean.getPageSize());
Page<CommonCoupon> page1 = commonCouponService
.lambdaQuery()
.eq(CommonCoupon::getUserId,hanHaiMember.getId())
.eq(CommonCoupon::getState,state)
.page(page);
return Result.OK(hanHaiMember);
return Result.OK(page1);
}
@ -243,43 +285,43 @@ public class AppletIndexServiceImpl implements AppletIndexService {
if (commonOrder.getShopState()==2){
return Result.error("非首页订单");
}
//根据配置列表查询每人限制数量
CommonConfig commonConfig = commonConfigService.lambdaQuery()
.eq(CommonConfig::getKeyName,"pay_num")
.one();
//得到配置的数值转为int类型
int payNum = Integer.parseInt(commonConfig.getKeyContent());
//根据商品信息是否是体验装进行判断
if (commonOrder.getShopState()==0){
//查询用户是否存在该订单
List<CommonOrder> byUserIdAndShopId = commonOrderService.lambdaQuery()
.eq(CommonOrder::getUserId,hanHaiMember.getId())
.eq(CommonOrder::getShopId,commonOrder.getShopId())
.eq(CommonOrder::getShopState,0)
.eq(CommonOrder::getState,1)
.list();
if (byUserIdAndShopId.size()+1>payNum){
Result result = new Result();
result.setMessage("已超过体验商品购买次数限制!请勿重复购买");
result.setCode(901);
return result;
}
//查询用户是否存在该订单
List<CommonOrder> payNumList = commonOrderService.lambdaQuery()
.eq(CommonOrder::getUserId,hanHaiMember.getId())
.eq(CommonOrder::getShopId,commonOrder.getShopId())
.eq(CommonOrder::getShopState,0)
.eq(CommonOrder::getState,0)
.list();
if (payNumList.size()>1){
Result result = new Result();
result.setMessage("您有相同订单未付款!请先付款");
result.setCode(901);
return result;
}
}
//
// //根据配置列表查询每人限制数量
// CommonConfig commonConfig = commonConfigService.lambdaQuery()
// .eq(CommonConfig::getKeyName,"pay_num")
// .one();
// //得到配置的数值转为int类型
// int payNum = Integer.parseInt(commonConfig.getKeyContent());
// //根据商品信息是否是体验装进行判断
// if (commonOrder.getShopState()==0){
// //查询用户是否存在该订单
// List<CommonOrder> byUserIdAndShopId = commonOrderService.lambdaQuery()
// .eq(CommonOrder::getUserId,hanHaiMember.getId())
// .eq(CommonOrder::getShopId,commonOrder.getShopId())
// .eq(CommonOrder::getShopState,0)
// .eq(CommonOrder::getState,1)
// .list();
// if (byUserIdAndShopId.size()+1>payNum){
// Result result = new Result();
// result.setMessage("已超过体验商品购买次数限制!请勿重复购买");
// result.setCode(901);
// return result;
// }
//
// //查询用户是否存在该订单
// List<CommonOrder> payNumList = commonOrderService.lambdaQuery()
// .eq(CommonOrder::getUserId,hanHaiMember.getId())
// .eq(CommonOrder::getShopId,commonOrder.getShopId())
// .eq(CommonOrder::getShopState,0)
// .eq(CommonOrder::getState,0)
// .list();
// if (payNumList.size()>1){
// Result result = new Result();
// result.setMessage("您有相同订单未付款!请先付款");
// result.setCode(901);
// return result;
// }
// }
@ -304,6 +346,11 @@ public class AppletIndexServiceImpl implements AppletIndexService {
commonOrder1.setName(commonOrder.getName());
commonOrder1.setPhone(commonOrder.getPhone());
commonOrder1.setSku(commonOrder.getSku());
commonOrder1.setPayType(commonOrder.getPayType());
commonOrder1.setCouponId(commonOrder.getCouponId());
commonOrder1.setCouponPrice(commonOrder.getCouponPrice());
commonOrder1.setSubText(commonOrder.getSubText());
commonOrder1.setOrderDetails(commonOrder.getOrderDetails());
commonOrder1.setCreateTime(new Date());
commonOrderService.save(commonOrder1);
@ -336,27 +383,38 @@ public class AppletIndexServiceImpl implements AppletIndexService {
//删除该订单详情
commonOrderSkuService.removeById(one);
//根据支付方式吊起支付
if (commonOrder1.getPayType()==0){
//吊起微信支付
String s = commonOrder1.getPrice().multiply(new BigDecimal(100)).toString();
int i1 = Double.valueOf(s).intValue();
Object appOrder = mpWxPayService.createOrder(
"购买"+ commonOrder1.getTitle() ,
"127.0.0.1",
newOrderId,
i1,
newOrderId,
hanHaiMember.getAppletOpenid(),
commonOrder.toString());
return Result.OK("支付成功",appOrder);
}else{
commonOrder.setState(1);
commonOrderService.updateById(commonOrder);
return Result.error("支付成功");
}
//吊起微信支付
String s = commonOrder1.getPrice().multiply(new BigDecimal(100)).toString();
int i1 = Double.valueOf(s).intValue();
Object appOrder = mpWxPayService.createOrder(
"购买"+ commonOrder1.getTitle() ,
"127.0.0.1",
orderId,
i1,
orderId,
hanHaiMember.getAppletOpenid(),
commonOrder.toString());
return Result.OK("支付成功",appOrder);
}
//创建订单
@Override
public Result<?> createOrder(String token,String shopId,Integer num,String addressId) {
public Result<?> createOrder(String token,String shopId,Integer num,String addressId,Integer payType,String couponId) {
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
//支付方式不能为空
if (payType==null){
return Result.error("支付方式不能为空");
}
//商品标识不能为空
if (shopId==null){
return Result.error("商品标识不能为空");
@ -380,44 +438,53 @@ public class AppletIndexServiceImpl implements AppletIndexService {
if (commonAddress==null){
return Result.error("地址不存在");
}
//查询优惠券是否存在
CommonCoupon commonCoupon = commonCouponService.getById(couponId);
// //优惠券不存在
// if (commonCoupon==null){
// return Result.error("优惠券不存在");
// }
// if (commonCoupon.getState()==1){
// return Result.error("优惠券已失效");
// }
//根据配置列表查询每人限制数量
CommonConfig commonConfig = commonConfigService.lambdaQuery()
.eq(CommonConfig::getKeyName,"pay_num")
.one();
//得到配置的数值转为int类型
int payNum = Integer.parseInt(commonConfig.getKeyContent());
//根据商品信息是否是体验装进行判断
if (commonShop.getType()==0){
//查询用户是否存在该订单
List<CommonOrder> byUserIdAndShopId = commonOrderService.lambdaQuery()
.eq(CommonOrder::getUserId,hanHaiMember.getId())
.eq(CommonOrder::getShopId,shopId)
.eq(CommonOrder::getShopState,0)
.eq(CommonOrder::getState,1)
.list();
if (byUserIdAndShopId.size()+1>payNum){
Result result = new Result();
result.setMessage("已超过体验商品购买次数限制!请勿重复购买");
result.setCode(901);
return result;
}
//查询用户是否存在该订单
List<CommonOrder> payNumList = commonOrderService.lambdaQuery()
.eq(CommonOrder::getUserId,hanHaiMember.getId())
.eq(CommonOrder::getShopId,shopId)
.eq(CommonOrder::getShopState,0)
.eq(CommonOrder::getState,0)
.list();
if (payNumList.size()>0){
Result result = new Result();
result.setMessage("已超过体验商品购买次数限制!请勿重复购买");
result.setCode(901);
return result;
}
}
//
// //根据配置列表查询每人限制数量
// CommonConfig commonConfig = commonConfigService.lambdaQuery()
// .eq(CommonConfig::getKeyName,"pay_num")
// .one();
// //得到配置的数值转为int类型
// int payNum = Integer.parseInt(commonConfig.getKeyContent());
// //根据商品信息是否是体验装进行判断
// if (commonShop.getType()==0){
// //查询用户是否存在该订单
// List<CommonOrder> byUserIdAndShopId = commonOrderService.lambdaQuery()
// .eq(CommonOrder::getUserId,hanHaiMember.getId())
// .eq(CommonOrder::getShopId,shopId)
// .eq(CommonOrder::getShopState,0)
// .eq(CommonOrder::getState,1)
// .list();
// if (byUserIdAndShopId.size()+1>payNum){
// Result result = new Result();
// result.setMessage("已超过体验商品购买次数限制!请勿重复购买");
// result.setCode(901);
// return result;
// }
//
// //查询用户是否存在该订单
// List<CommonOrder> payNumList = commonOrderService.lambdaQuery()
// .eq(CommonOrder::getUserId,hanHaiMember.getId())
// .eq(CommonOrder::getShopId,shopId)
// .eq(CommonOrder::getShopState,0)
// .eq(CommonOrder::getState,0)
// .list();
// if (payNumList.size()>0){
// Result result = new Result();
// result.setMessage("已超过体验商品购买次数限制!请勿重复购买");
// result.setCode(901);
// return result;
// }
// }
//创建订单标识
@ -444,6 +511,9 @@ public class AppletIndexServiceImpl implements AppletIndexService {
commonOrder.setUserId(hanHaiMember.getId());
commonOrder.setAddressId(addressId);
commonOrder.setShopState(commonShop.getType());
commonOrder.setPayType(payType);
commonOrder.setCreateTime(new Date());
commonOrder.setCouponId(couponId);
commonOrderService.save(commonOrder);
//创建订单详情
@ -458,19 +528,28 @@ public class AppletIndexServiceImpl implements AppletIndexService {
commonOrderSku.setCreateTime(new Date());
commonOrderSkuService.save(commonOrderSku);
//吊起微信支付
String s = price.multiply(new BigDecimal(100)).toString();
int i1 = Double.valueOf(s).intValue();
Object appOrder = mpWxPayService.createOrder(
"购买"+ commonShop.getTitle() ,
"127.0.0.1",
orderId,
i1,
orderId,
hanHaiMember.getAppletOpenid(),
commonOrder.toString());
return Result.OK("支付成功",appOrder);
//根据支付方式吊起支付
if (payType==0){
//吊起微信支付
String s = price.multiply(new BigDecimal(100)).toString();
int i1 = Double.valueOf(s).intValue();
Object appOrder = mpWxPayService.createOrder(
"购买"+ commonShop.getTitle() ,
"127.0.0.1",
orderId,
i1,
orderId,
hanHaiMember.getAppletOpenid(),
commonOrder.toString());
return Result.OK("支付成功",appOrder);
}else{
commonOrder.setState(1);
commonOrderService.updateById(commonOrder);
return Result.error("支付成功");
}
}
@ -548,7 +627,7 @@ public class AppletIndexServiceImpl implements AppletIndexService {
cityOrder.setPhone(commonAddress.getPhone());
cityOrder.setAddressDetails(commonAddress.getAddressDetails());
cityOrder.setAddressId(addressId);
cityOrder.setName("店铺订单");
cityOrder.setName(commonAddress.getName());
cityOrder.setTitle("组合订单");
cityOrder.setPrice(totalPrice);
cityOrder.setShopState(2);
@ -628,7 +707,7 @@ public class AppletIndexServiceImpl implements AppletIndexService {
cityOrder.setPhone(oldOrder.getPhone());
cityOrder.setAddressDetails(oldOrder.getAddressDetails());
cityOrder.setAddressId(addressId);
cityOrder.setName("店铺订单");
cityOrder.setName(commonAddress.getName());
cityOrder.setTitle("组合订单");
cityOrder.setPrice(oldOrder.getPrice());
@ -794,12 +873,23 @@ public class AppletIndexServiceImpl implements AppletIndexService {
//获取流水记录带分页
@Override
public Result<?> getWaterPageList(String token,PageBean pageBean){
public Result<?> getWaterPageList(String token,String timeTitle,PageBean pageBean){
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
Map<String,Object> map = new HashMap<>();
Page<CommonMoneyLog> page = commonMoneyLogService.lambdaQuery()
.eq(CommonMoneyLog::getUserId,hanHaiMember.getId())
.orderByDesc(CommonMoneyLog::getCreateTime)
.page(new Page<>(1, 10));
return Result.OK(page);
map.put("page",page);
//总佣金
map.put("totalMoney",100);
//累积提现
map.put("totalWithdraw",100);
return Result.OK(map);
}
//获取订单列表带分页
@ -891,9 +981,9 @@ public class AppletIndexServiceImpl implements AppletIndexService {
private String appid = "wx0839bc52e7849c13";
private String appid = "wx28679cb649907e7e";
private String secret = "c614fd865951c5246e849501204e6f7f";
private String secret = "6b5fbf1439176f7b78209bd237dfdf7e";
private String endpoint = "oss-cn-shenzhen.aliyuncs.com";
@ -908,8 +998,8 @@ public class AppletIndexServiceImpl implements AppletIndexService {
private static final String APP_ID = "wx0839bc52e7849c13";
private static final String APP_SECRET = "c614fd865951c5246e849501204e6f7f";
private static final String APP_ID = "wx28679cb649907e7e";
private static final String APP_SECRET = "6b5fbf1439176f7b78209bd237dfdf7e";
private static final String TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + APP_ID + "&secret=" + APP_SECRET;
private static final String TEMPLATE_MESSAGE_URL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=";
@ -1132,6 +1222,50 @@ public class AppletIndexServiceImpl implements AppletIndexService {
}
@Override
public Result<?> getPidList(){
List<CommonPidClass> list = commonPidClassService
.lambdaQuery()
.eq(CommonPidClass::getPid,0)
.list();
return Result.OK(list);
}
@Override
public Result<?> getCategoryPidList(String title){
List<CommonPidClass> list = commonPidClassService
.lambdaQuery()
.eq(CommonPidClass::getPid,0)
.list();
list.forEach(item->{
List<CommonPidClass> list1 = commonPidClassService
.lambdaQuery()
.eq(CommonPidClass::getPid,item.getId())
.list();
item.setChildren(list1);
//循环得到list1的数据
list1.forEach(item1->{
//根据标识查询商品数据
List<CommonShop> shopList = commonShopService
.lambdaQuery()
.eq(CommonShop::getCommonPidClassId,item1.getId())
.list();
//如果title不为空
if(StringUtils.isNotBlank(title)){
shopList = commonShopService
.lambdaQuery()
.eq(CommonShop::getCommonPidClassId,item1.getId())
.like(CommonShop::getTitle,title)
.list();
}
item1.setShopList(shopList);
});
});
return Result.OK(list);
}
//删除地址
@Override
public Result<?> deleteAddress(String token,String id){
@ -1168,18 +1302,88 @@ public class AppletIndexServiceImpl implements AppletIndexService {
public Result<?> getRiceInfo(String token){
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
Map map = new HashMap();
//余额可提现收益明细
//余额可提现
map.put("balance",hanHaiMember.getPrice());
map.put("canWithdraw",hanHaiMember.getMoney());
map.put("income",0);
//黄金会员
map.put("goldenMember",0);
//当前会员人数
map.put("memberNum",hanHaiMemberService.lambdaQuery().eq(HanHaiMember::getIsPay,1).list().size());
//累积消费金额
map.put("consumeMoney",0);
//查询配置管理
CommonConfig coupon_money = commonConfigService.lambdaQuery()
.eq(CommonConfig::getKeyName,"coupon_money")
.one();
CommonConfig coupon_get_money = commonConfigService.lambdaQuery()
.eq(CommonConfig::getKeyName,"coupon_get_money")
.one();
//查询是否已经领取了新人优惠券
CommonCoupon one = commonCouponService.lambdaQuery()
.eq(CommonCoupon::getUserId, hanHaiMember.getId())
.eq(CommonCoupon::getType, "新人优惠券")
.one();
if (one!=null){
map.put("isGetCoupon", false);
}else{
//是否有可领取优惠券
map.put("isGetCoupon", true);
}
//领取金额
map.put("getCouponMoney", new BigDecimal(coupon_money.getKeyContent()));
//满多少减
map.put("getCouponMoneySub", new BigDecimal(coupon_get_money.getKeyContent()));
//会员开通时间
map.put("openTime",hanHaiMember.getCreateTime());
return Result.OK(map);
}
//领取新人优惠券
@Override
public Result<?> getRiceCoupon(String token){
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
//查询配置管理
CommonConfig coupon_money = commonConfigService.lambdaQuery()
.eq(CommonConfig::getKeyName,"coupon_money")
.one();
CommonConfig coupon_get_money = commonConfigService.lambdaQuery()
.eq(CommonConfig::getKeyName,"coupon_get_money")
.one();
//查询是否已经领取了新人优惠券
CommonCoupon one = commonCouponService.lambdaQuery()
.eq(CommonCoupon::getUserId, hanHaiMember.getId())
.eq(CommonCoupon::getType, "新人优惠券")
.one();
if (one!=null){
return Result.OK("您已经领取新人优惠券");
}
//创建新人优惠券
CommonCoupon commonCoupon = new CommonCoupon();
commonCoupon.setMoney(new BigDecimal(coupon_money.getKeyContent()));
commonCoupon.setUseMoney(new BigDecimal(coupon_get_money.getKeyContent()));
//获取当前时间一年之后的时间
// 获取当前日期和时间
LocalDateTime now = LocalDateTime.now();
// 加上一年
LocalDateTime oneYearLater = now.plus(1, ChronoUnit.YEARS);
//转为date类型
Date date = Date.from(oneYearLater.atZone(ZoneId.systemDefault()).toInstant());
commonCoupon.setEndTime(date);
commonCoupon.setState(0);
commonCoupon.setType("新人优惠券");
commonCoupon.setUserId(hanHaiMember.getId());
commonCouponService.save(commonCoupon);
return Result.OK("领取成功");
}
//充值
@Override
@ -1486,15 +1690,113 @@ public class AppletIndexServiceImpl implements AppletIndexService {
@Override
public Result<?> confirmOrder(String token,String orderId){
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
CommonOrder byId = commonOrderService.getById(orderId);
byId.setState(3);
commonOrderService.updateById(byId);
return Result.OK("确认收货");
}
//取消订单
@Override
public Result<?> cancelOrder(String token,String orderId){
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
CommonOrder byId = commonOrderService.getById(orderId);
byId.setState(4);
commonOrderService.updateById(byId);
return Result.OK("取消成功");
}
//根据用户查询渠道申请信息表单
@Override
public Result<?> getCommonUser(String token){
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
CommonUser one = commonUserService.lambdaQuery().eq(CommonUser::getUserId, hanHaiMember.getId()).one();
return Result.OK(one);
}
//增加或者修改渠道申请信息
@Override
public Result<?> addOrUpdateCommonUser(String token, CommonUser commonUser){
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
commonUser.setState(0);
//根据用户标识查询改用户是否以申请
CommonUser one = commonUserService.lambdaQuery().eq(CommonUser::getUserId, hanHaiMember.getId()).one();
//如果为空则申请
if(one==null){
commonUser.setUserId(hanHaiMember.getId());
commonUser.setState(0);
commonUserService.save(commonUser);
}else{
//如果状态为1
if(one.getState()==1){
return Result.error("已申请通过,请勿重复申请");
}
//修改
commonUser.setId(one.getId());
commonUserService.updateById(commonUser);
}
return Result.OK("申请成功,等待审核");
}
@Override
public Result<?> getHanHaiMemberUser(String token,Integer state,PageBean pageBean){
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
Page<HanHaiMember> page = new Page<HanHaiMember>(pageBean.getPageNo(), pageBean.getPageSize());
Page<HanHaiMember> pageList = hanHaiMemberService.lambdaQuery()
.eq(HanHaiMember::getShareId,hanHaiMember.getId())
.page(page);
if(state == 0){
pageList = hanHaiMemberService.lambdaQuery()
.eq(HanHaiMember::getShareId,hanHaiMember.getId())
.page(page);
}else{
pageList = hanHaiMemberService.lambdaQuery()
.eq(HanHaiMember::getVid,hanHaiMember.getId())
.page(page);
}
//创建一个新的集合
Page<FansPageBean> pageListFans = new Page<>();
List<FansPageBean> fansPageBean = new ArrayList<>();
pageList.getRecords().forEach(item->{
//创建一个新的对象
FansPageBean fansPageBean1 = new FansPageBean();
fansPageBean1.setHeadImage(item.getHeadImage());
fansPageBean1.setNickName(item.getNickName());
//查询该用户的订单数量
int count = commonOrderService.lambdaQuery()
.eq(CommonOrder::getUserId,item.getId())
.count().intValue();
fansPageBean1.setOrderNum(count);
//查询该用户的佣金之和
BigDecimal commission = new BigDecimal(10);
fansPageBean1.setCommission(commission);
fansPageBean1.setCreateTime(item.getCreateTime());
fansPageBean.add(fansPageBean1);
});
pageListFans.setRecords(fansPageBean);
return Result.OK(pageListFans);
}
@Override
public Result<?> addFeedback(String token, CommonFack feedback){
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
feedback.setUserId(hanHaiMember.getId());
commonFackService.save(feedback);
return Result.OK("反馈成功");
}
}

+ 12
- 1
module-common/src/main/java/org/jeecg/api/service/impl/AppletLoginServiceImpl.java View File

@ -24,6 +24,7 @@ import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@ -81,8 +82,18 @@ public class AppletLoginServiceImpl implements AppletLoginService {
member = new HanHaiMember();
// member.setSesssionKey(sessionKey);
member.setAppletOpenid(wxOpenid);
member.setNickName("瑶都墙友"+System.currentTimeMillis());
member.setNickName("陌美人"+System.currentTimeMillis());
member.setHeadImage(loginReq.getHeadimgurl());
member.setShareId(loginReq.getShareId());
//查询邀请人是否存在
if (StringUtils.isNotBlank(loginReq.getShareId())) {
HanHaiMember shareMember = memberService.lambdaQuery().eq(HanHaiMember::getId, loginReq.getShareId()).one();
if (shareMember != null) {
member.setVid(shareMember.getShareId());
}
}
member.setVtime(new Date());
// 生成token返回给小程序端
String token = JwtUtil.sign(member.getAppletOpenid(), wxOpenid);
memberService.save(member);


+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonClass/controller/CommonClassController.java View File

@ -39,7 +39,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 商品分类表
* @Author: jeecg-boot
* @Date: 2024-11-24
* @Date: 2025-01-02
* @Version: V1.0
*/
@Api(tags="商品分类表")


+ 5
- 1
module-common/src/main/java/org/jeecg/modules/commonClass/entity/CommonClass.java View File

@ -20,7 +20,7 @@ import lombok.experimental.Accessors;
/**
* @Description: 商品分类表
* @Author: jeecg-boot
* @Date: 2024-11-24
* @Date: 2025-01-02
* @Version: V1.0
*/
@Data
@ -55,4 +55,8 @@ public class CommonClass implements Serializable {
@Excel(name = "排序", width = 15)
@ApiModelProperty(value = "排序")
private java.lang.Integer sort;
/**图片*/
@Excel(name = "图片", width = 15)
@ApiModelProperty(value = "图片")
private java.lang.String image;
}

+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonClass/mapper/CommonClassMapper.java View File

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 商品分类表
* @Author: jeecg-boot
* @Date: 2024-11-24
* @Date: 2025-01-02
* @Version: V1.0
*/
public interface CommonClassMapper extends BaseMapper<CommonClass> {


+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonClass/service/ICommonClassService.java View File

@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 商品分类表
* @Author: jeecg-boot
* @Date: 2024-11-24
* @Date: 2025-01-02
* @Version: V1.0
*/
public interface ICommonClassService extends IService<CommonClass> {


+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonClass/service/impl/CommonClassServiceImpl.java View File

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 商品分类表
* @Author: jeecg-boot
* @Date: 2024-11-24
* @Date: 2025-01-02
* @Version: V1.0
*/
@Service


+ 7
- 0
module-common/src/main/java/org/jeecg/modules/commonClass/vue/CommonClassList.vue View File

@ -131,6 +131,12 @@
align:"center",
dataIndex: 'sort'
},
{
title:'图片',
align:"center",
dataIndex: 'image',
scopedSlots: {customRender: 'imgSlot'}
},
{
title: '操作',
dataIndex: 'action',
@ -167,6 +173,7 @@
let fieldList=[];
fieldList.push({type:'string',value:'title',text:'分类标题',dictCode:''})
fieldList.push({type:'int',value:'sort',text:'排序',dictCode:''})
fieldList.push({type:'Text',value:'image',text:'图片',dictCode:''})
this.superFieldList = fieldList
}
}


+ 5
- 0
module-common/src/main/java/org/jeecg/modules/commonClass/vue/modules/CommonClassForm.vue View File

@ -13,6 +13,11 @@
<a-input-number v-model="model.sort" placeholder="请输入排序" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="image">
<j-image-upload isMultiple v-model="model.image" ></j-image-upload>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>


+ 13
- 0
module-common/src/main/java/org/jeecg/modules/commonClass/vue3/CommonClass.data.ts View File

@ -14,6 +14,12 @@ export const columns: BasicColumn[] = [
align:"center",
dataIndex: 'sort'
},
{
title: '图片',
align:"center",
dataIndex: 'image',
customRender:render.renderAvatar,
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
@ -30,4 +36,11 @@ export const formSchema: FormSchema[] = [
field: 'sort',
component: 'InputNumber',
},
{
label: '图片',
field: 'image',
component: 'JImageUpload',
componentProps:{
},
},
];

+ 171
- 0
module-common/src/main/java/org/jeecg/modules/commonFack/controller/CommonFackController.java View File

@ -0,0 +1,171 @@
package org.jeecg.modules.commonFack.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.commonFack.entity.CommonFack;
import org.jeecg.modules.commonFack.service.ICommonFackService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 反馈信息表
* @Author: jeecg-boot
* @Date: 2024-12-31
* @Version: V1.0
*/
@Api(tags="反馈信息表")
@RestController
@RequestMapping("/commonFack/commonFack")
@Slf4j
public class CommonFackController extends JeecgController<CommonFack, ICommonFackService> {
@Autowired
private ICommonFackService commonFackService;
/**
* 分页列表查询
*
* @param commonFack
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "反馈信息表-分页列表查询")
@ApiOperation(value="反馈信息表-分页列表查询", notes="反馈信息表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<CommonFack>> queryPageList(CommonFack commonFack,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<CommonFack> queryWrapper = QueryGenerator.initQueryWrapper(commonFack, req.getParameterMap());
Page<CommonFack> page = new Page<CommonFack>(pageNo, pageSize);
IPage<CommonFack> pageList = commonFackService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param commonFack
* @return
*/
@AutoLog(value = "反馈信息表-添加")
@ApiOperation(value="反馈信息表-添加", notes="反馈信息表-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody CommonFack commonFack) {
commonFackService.save(commonFack);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param commonFack
* @return
*/
@AutoLog(value = "反馈信息表-编辑")
@ApiOperation(value="反馈信息表-编辑", notes="反馈信息表-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody CommonFack commonFack) {
commonFackService.updateById(commonFack);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "反馈信息表-通过id删除")
@ApiOperation(value="反馈信息表-通过id删除", notes="反馈信息表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
commonFackService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "反馈信息表-批量删除")
@ApiOperation(value="反馈信息表-批量删除", notes="反馈信息表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.commonFackService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "反馈信息表-通过id查询")
@ApiOperation(value="反馈信息表-通过id查询", notes="反馈信息表-通过id查询")
@GetMapping(value = "/queryById")
public Result<CommonFack> queryById(@RequestParam(name="id",required=true) String id) {
CommonFack commonFack = commonFackService.getById(id);
if(commonFack==null) {
return Result.error("未找到对应数据");
}
return Result.OK(commonFack);
}
/**
* 导出excel
*
* @param request
* @param commonFack
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, CommonFack commonFack) {
return super.exportXls(request, commonFack, CommonFack.class, "反馈信息表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, CommonFack.class);
}
}

+ 70
- 0
module-common/src/main/java/org/jeecg/modules/commonFack/entity/CommonFack.java View File

@ -0,0 +1,70 @@
package org.jeecg.modules.commonFack.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 反馈信息表
* @Author: jeecg-boot
* @Date: 2024-12-31
* @Version: V1.0
*/
@Data
@TableName("common_fack")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="common_fack对象", description="反馈信息表")
public class CommonFack implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**内容*/
@Excel(name = "内容", width = 15)
@ApiModelProperty(value = "内容")
private java.lang.String remark;
/**图片*/
@Excel(name = "图片", width = 15)
@ApiModelProperty(value = "图片")
private java.lang.String image;
/**姓名*/
@Excel(name = "姓名", width = 15)
@ApiModelProperty(value = "姓名")
private java.lang.String name;
/**电话*/
@Excel(name = "电话", width = 15)
@ApiModelProperty(value = "电话")
private java.lang.String phone;
/**用户标识*/
@Excel(name = "用户标识", width = 15)
@ApiModelProperty(value = "用户标识")
private java.lang.String userId;
}

+ 17
- 0
module-common/src/main/java/org/jeecg/modules/commonFack/mapper/CommonFackMapper.java View File

@ -0,0 +1,17 @@
package org.jeecg.modules.commonFack.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.commonFack.entity.CommonFack;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 反馈信息表
* @Author: jeecg-boot
* @Date: 2024-12-31
* @Version: V1.0
*/
public interface CommonFackMapper extends BaseMapper<CommonFack> {
}

+ 5
- 0
module-common/src/main/java/org/jeecg/modules/commonFack/mapper/xml/CommonFackMapper.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.commonFack.mapper.CommonFackMapper">
</mapper>

+ 14
- 0
module-common/src/main/java/org/jeecg/modules/commonFack/service/ICommonFackService.java View File

@ -0,0 +1,14 @@
package org.jeecg.modules.commonFack.service;
import org.jeecg.modules.commonFack.entity.CommonFack;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 反馈信息表
* @Author: jeecg-boot
* @Date: 2024-12-31
* @Version: V1.0
*/
public interface ICommonFackService extends IService<CommonFack> {
}

+ 19
- 0
module-common/src/main/java/org/jeecg/modules/commonFack/service/impl/CommonFackServiceImpl.java View File

@ -0,0 +1,19 @@
package org.jeecg.modules.commonFack.service.impl;
import org.jeecg.modules.commonFack.entity.CommonFack;
import org.jeecg.modules.commonFack.mapper.CommonFackMapper;
import org.jeecg.modules.commonFack.service.ICommonFackService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 反馈信息表
* @Author: jeecg-boot
* @Date: 2024-12-31
* @Version: V1.0
*/
@Service
public class CommonFackServiceImpl extends ServiceImpl<CommonFackMapper, CommonFack> implements ICommonFackService {
}

+ 196
- 0
module-common/src/main/java/org/jeecg/modules/commonFack/vue/CommonFackList.vue View File

@ -0,0 +1,196 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('反馈信息表')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<common-fack-modal ref="modalForm" @ok="modalFormOk"></common-fack-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CommonFackModal from './modules/CommonFackModal'
export default {
name: 'CommonFackList',
mixins:[JeecgListMixin, mixinDevice],
components: {
CommonFackModal
},
data () {
return {
description: '反馈信息表管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'内容',
align:"center",
dataIndex: 'remark'
},
{
title:'图片',
align:"center",
dataIndex: 'image',
scopedSlots: {customRender: 'imgSlot'}
},
{
title:'姓名',
align:"center",
dataIndex: 'name'
},
{
title:'电话',
align:"center",
dataIndex: 'phone'
},
{
title:'用户标识',
align:"center",
dataIndex: 'userId'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/commonFack/commonFack/list",
delete: "/commonFack/commonFack/delete",
deleteBatch: "/commonFack/commonFack/deleteBatch",
exportXlsUrl: "/commonFack/commonFack/exportXls",
importExcelUrl: "commonFack/commonFack/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'Text',value:'remark',text:'内容',dictCode:''})
fieldList.push({type:'Text',value:'image',text:'图片',dictCode:''})
fieldList.push({type:'string',value:'name',text:'姓名',dictCode:''})
fieldList.push({type:'string',value:'phone',text:'电话',dictCode:''})
fieldList.push({type:'string',value:'userId',text:'用户标识',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

+ 124
- 0
module-common/src/main/java/org/jeecg/modules/commonFack/vue/modules/CommonFackForm.vue View File

@ -0,0 +1,124 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
<a-textarea v-model="model.remark" rows="4" placeholder="请输入内容" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="image">
<j-image-upload isMultiple v-model="model.image" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
<a-input v-model="model.name" placeholder="请输入姓名" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="phone">
<a-input v-model="model.phone" placeholder="请输入电话" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="用户标识" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userId">
<a-input v-model="model.userId" placeholder="请输入用户标识" ></a-input>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'CommonFackForm',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/commonFack/commonFack/add",
edit: "/commonFack/commonFack/edit",
queryById: "/commonFack/commonFack/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

+ 84
- 0
module-common/src/main/java/org/jeecg/modules/commonFack/vue/modules/CommonFackModal.Style#Drawer.vue View File

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<common-fack-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></common-fack-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
</div>
</a-drawer>
</template>
<script>
import CommonFackForm from './CommonFackForm'
export default {
name: 'CommonFackModal',
components: {
CommonFackForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

+ 60
- 0
module-common/src/main/java/org/jeecg/modules/commonFack/vue/modules/CommonFackModal.vue View File

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<common-fack-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></common-fack-form>
</j-modal>
</template>
<script>
import CommonFackForm from './CommonFackForm'
export default {
name: 'CommonFackModal',
components: {
CommonFackForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

+ 61
- 0
module-common/src/main/java/org/jeecg/modules/commonFack/vue3/CommonFack.api.ts View File

@ -0,0 +1,61 @@
import {defHttp} from '/@/utils/http/axios';
import {Modal} from 'ant-design-vue';
enum Api {
list = '/commonFack/commonFack/list',
save='/commonFack/commonFack/add',
edit='/commonFack/commonFack/edit',
deleteOne = '/commonFack/commonFack/delete',
deleteBatch = '/commonFack/commonFack/deleteBatch',
importExcel = '/commonFack/commonFack/importExcel',
exportXls = '/commonFack/commonFack/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
*
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
export const batchDelete = (params, handleSuccess) => {
Modal.confirm({
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}

+ 66
- 0
module-common/src/main/java/org/jeecg/modules/commonFack/vue3/CommonFack.data.ts View File

@ -0,0 +1,66 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '内容',
align:"center",
dataIndex: 'remark'
},
{
title: '图片',
align:"center",
dataIndex: 'image',
customRender:render.renderAvatar,
},
{
title: '姓名',
align:"center",
dataIndex: 'name'
},
{
title: '电话',
align:"center",
dataIndex: 'phone'
},
{
title: '用户标识',
align:"center",
dataIndex: 'userId'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '内容',
field: 'remark',
component: 'InputTextArea',//TODO 注意string转换问题
},
{
label: '图片',
field: 'image',
component: 'JImageUpload',
componentProps:{
},
},
{
label: '姓名',
field: 'name',
component: 'Input',
},
{
label: '电话',
field: 'phone',
component: 'Input',
},
{
label: '用户标识',
field: 'userId',
component: 'Input',
},
];

+ 162
- 0
module-common/src/main/java/org/jeecg/modules/commonFack/vue3/CommonFackList.vue View File

@ -0,0 +1,162 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="checkedKeys.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>批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<CommonFackModal @register="registerModal" @success="handleSuccess"></CommonFackModal>
</div>
</template>
<script lang="ts" name="commonFack-commonFack" setup>
import {ref, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import CommonFackModal from './components/CommonFackModal.vue'
import {columns, searchFormSchema} from './commonFack.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './commonFack.api';
const checkedKeys = ref<Array<string | number>>([]);
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '反馈信息表',
api: list,
columns,
canResize:false,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
},
},
exportConfig: {
name:"反馈信息表",
url: getExportUrl,
},
importConfig: {
url: getImportUrl
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
/**
* 新增事件
*/
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}, reload);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: checkedKeys.value}, reload);
}
/**
* 成功回调
*/
function handleSuccess() {
reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
}
]
}
</script>
<style scoped>
</style>

+ 58
- 0
module-common/src/main/java/org/jeecg/modules/commonFack/vue3/components/CommonFackModal.vue View File

@ -0,0 +1,58 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" @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 '../commonFack.data';
import {saveOrUpdate} from '../commonFack.api';
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
//
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({
labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
});
//
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)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} finally {
setModalProps({confirmLoading: false});
}
}
</script>
<style lang="less" scoped>
</style>

+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonOrder/controller/CommonOrderController.java View File

@ -39,7 +39,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 订单信息表
* @Author: jeecg-boot
* @Date: 2024-12-12
* @Date: 2025-01-02
* @Version: V1.0
*/
@Api(tags="订单信息表")


+ 22
- 2
module-common/src/main/java/org/jeecg/modules/commonOrder/entity/CommonOrder.java View File

@ -24,7 +24,7 @@ import lombok.experimental.Accessors;
/**
* @Description: 订单信息表
* @Author: jeecg-boot
* @Date: 2024-12-12
* @Date: 2025-01-02
* @Version: V1.0
*/
@Data
@ -128,7 +128,27 @@ public class CommonOrder implements Serializable {
@Excel(name = "物流订单", width = 15)
@ApiModelProperty(value = "物流订单")
private java.lang.String wuliu;
/**订单材质*/
@Excel(name = "订单材质", width = 15)
@ApiModelProperty(value = "订单材质")
private java.lang.String subText;
/**下单须知*/
@Excel(name = "下单须知", width = 15)
@ApiModelProperty(value = "下单须知")
private java.lang.String orderDetails;
/**支付方式*/
@Excel(name = "支付方式", width = 15)
@ApiModelProperty(value = "支付方式")
private java.lang.Integer payType;
/**优惠券标识*/
@Excel(name = "优惠券标识", width = 15)
@ApiModelProperty(value = "优惠券标识")
private java.lang.String couponId;
/**优惠价格*/
@Excel(name = "优惠价格", width = 15)
@ApiModelProperty(value = "优惠价格")
private java.math.BigDecimal couponPrice;
@TableField(exist = false)
@TableField(exist = false)
private List<CommonOrderSku> commonOrderSkuList;
}

+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonOrder/mapper/CommonOrderMapper.java View File

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 订单信息表
* @Author: jeecg-boot
* @Date: 2024-12-12
* @Date: 2025-01-02
* @Version: V1.0
*/
public interface CommonOrderMapper extends BaseMapper<CommonOrder> {


+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonOrder/service/ICommonOrderService.java View File

@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 订单信息表
* @Author: jeecg-boot
* @Date: 2024-12-12
* @Date: 2025-01-02
* @Version: V1.0
*/
public interface ICommonOrderService extends IService<CommonOrder> {


+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonOrder/service/impl/CommonOrderServiceImpl.java View File

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 订单信息表
* @Author: jeecg-boot
* @Date: 2024-12-12
* @Date: 2025-01-02
* @Version: V1.0
*/
@Service


+ 30
- 0
module-common/src/main/java/org/jeecg/modules/commonOrder/vue/CommonOrderList.vue View File

@ -217,6 +217,31 @@
align:"center",
dataIndex: 'wuliu'
},
{
title:'订单材质',
align:"center",
dataIndex: 'subText'
},
{
title:'下单须知',
align:"center",
dataIndex: 'orderDetails'
},
{
title:'支付方式',
align:"center",
dataIndex: 'payType'
},
{
title:'优惠券标识',
align:"center",
dataIndex: 'couponId'
},
{
title:'优惠价格',
align:"center",
dataIndex: 'couponPrice'
},
{
title: '操作',
dataIndex: 'action',
@ -267,6 +292,11 @@
fieldList.push({type:'int',value:'shareNum',text:'第几次推荐购买',dictCode:''})
fieldList.push({type:'string',value:'kuai',text:'快递公司',dictCode:''})
fieldList.push({type:'string',value:'wuliu',text:'物流订单',dictCode:''})
fieldList.push({type:'string',value:'subText',text:'订单材质',dictCode:''})
fieldList.push({type:'Text',value:'orderDetails',text:'下单须知',dictCode:''})
fieldList.push({type:'int',value:'payType',text:'支付方式',dictCode:''})
fieldList.push({type:'string',value:'couponId',text:'优惠券标识',dictCode:''})
fieldList.push({type:'BigDecimal',value:'couponPrice',text:'优惠价格',dictCode:''})
this.superFieldList = fieldList
}
}


+ 25
- 0
module-common/src/main/java/org/jeecg/modules/commonOrder/vue/modules/CommonOrderForm.vue View File

@ -83,6 +83,31 @@
<a-input v-model="model.wuliu" placeholder="请输入物流订单" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="订单材质" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="subText">
<a-input v-model="model.subText" placeholder="请输入订单材质" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="下单须知" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderDetails">
<a-input v-model="model.orderDetails" placeholder="请输入下单须知" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="支付方式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="payType">
<a-input-number v-model="model.payType" placeholder="请输入支付方式" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="优惠券标识" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="couponId">
<a-input v-model="model.couponId" placeholder="请输入优惠券标识" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="优惠价格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="couponPrice">
<a-input-number v-model="model.couponPrice" placeholder="请输入优惠价格" style="width: 100%" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>


+ 50
- 0
module-common/src/main/java/org/jeecg/modules/commonOrder/vue3/CommonOrder.data.ts View File

@ -84,6 +84,31 @@ export const columns: BasicColumn[] = [
align:"center",
dataIndex: 'wuliu'
},
{
title: '订单材质',
align:"center",
dataIndex: 'subText'
},
{
title: '下单须知',
align:"center",
dataIndex: 'orderDetails'
},
{
title: '支付方式',
align:"center",
dataIndex: 'payType'
},
{
title: '优惠券标识',
align:"center",
dataIndex: 'couponId'
},
{
title: '优惠价格',
align:"center",
dataIndex: 'couponPrice'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
@ -182,4 +207,29 @@ export const formSchema: FormSchema[] = [
field: 'wuliu',
component: 'Input',
},
{
label: '订单材质',
field: 'subText',
component: 'Input',
},
{
label: '下单须知',
field: 'orderDetails',
component: 'Input',
},
{
label: '支付方式',
field: 'payType',
component: 'InputNumber',
},
{
label: '优惠券标识',
field: 'couponId',
component: 'Input',
},
{
label: '优惠价格',
field: 'couponPrice',
component: 'InputNumber',
},
];

+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonOrderSku/controller/CommonOrderSkuController.java View File

@ -39,7 +39,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 订单详情表
* @Author: jeecg-boot
* @Date: 2024-12-05
* @Date: 2025-01-02
* @Version: V1.0
*/
@Api(tags="订单详情表")


+ 9
- 1
module-common/src/main/java/org/jeecg/modules/commonOrderSku/entity/CommonOrderSku.java View File

@ -20,7 +20,7 @@ import lombok.experimental.Accessors;
/**
* @Description: 订单详情表
* @Author: jeecg-boot
* @Date: 2024-12-05
* @Date: 2025-01-02
* @Version: V1.0
*/
@Data
@ -86,4 +86,12 @@ public class CommonOrderSku implements Serializable {
@Excel(name = "商品", width = 15)
@ApiModelProperty(value = "商品")
private java.lang.String shopId;
/**材质*/
@Excel(name = "材质", width = 15)
@ApiModelProperty(value = "材质")
private java.lang.String subText;
/**下单须知*/
@Excel(name = "下单须知", width = 15)
@ApiModelProperty(value = "下单须知")
private java.lang.String orderDetails;
}

+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonOrderSku/mapper/CommonOrderSkuMapper.java View File

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 订单详情表
* @Author: jeecg-boot
* @Date: 2024-12-05
* @Date: 2025-01-02
* @Version: V1.0
*/
public interface CommonOrderSkuMapper extends BaseMapper<CommonOrderSku> {


+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonOrderSku/service/ICommonOrderSkuService.java View File

@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 订单详情表
* @Author: jeecg-boot
* @Date: 2024-12-05
* @Date: 2025-01-02
* @Version: V1.0
*/
public interface ICommonOrderSkuService extends IService<CommonOrderSku> {


+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonOrderSku/service/impl/CommonOrderSkuServiceImpl.java View File

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 订单详情表
* @Author: jeecg-boot
* @Date: 2024-12-05
* @Date: 2025-01-02
* @Version: V1.0
*/
@Service


+ 12
- 0
module-common/src/main/java/org/jeecg/modules/commonOrderSku/vue/CommonOrderSkuList.vue View File

@ -166,6 +166,16 @@
align:"center",
dataIndex: 'shopId'
},
{
title:'材质',
align:"center",
dataIndex: 'subText'
},
{
title:'下单须知',
align:"center",
dataIndex: 'orderDetails'
},
{
title: '操作',
dataIndex: 'action',
@ -209,6 +219,8 @@
fieldList.push({type:'string',value:'sku',text:'规格',dictCode:''})
fieldList.push({type:'string',value:'userId',text:'用户',dictCode:''})
fieldList.push({type:'string',value:'shopId',text:'商品',dictCode:''})
fieldList.push({type:'string',value:'subText',text:'材质',dictCode:''})
fieldList.push({type:'Text',value:'orderDetails',text:'下单须知',dictCode:''})
this.superFieldList = fieldList
}
}


+ 10
- 0
module-common/src/main/java/org/jeecg/modules/commonOrderSku/vue/modules/CommonOrderSkuForm.vue View File

@ -48,6 +48,16 @@
<a-input v-model="model.shopId" placeholder="请输入商品" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="材质" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="subText">
<a-input v-model="model.subText" placeholder="请输入材质" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="下单须知" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderDetails">
<a-input v-model="model.orderDetails" placeholder="请输入下单须知" ></a-input>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>


+ 20
- 0
module-common/src/main/java/org/jeecg/modules/commonOrderSku/vue3/CommonOrderSku.data.ts View File

@ -49,6 +49,16 @@ export const columns: BasicColumn[] = [
align:"center",
dataIndex: 'shopId'
},
{
title: '材质',
align:"center",
dataIndex: 'subText'
},
{
title: '下单须知',
align:"center",
dataIndex: 'orderDetails'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
@ -100,4 +110,14 @@ export const formSchema: FormSchema[] = [
field: 'shopId',
component: 'Input',
},
{
label: '材质',
field: 'subText',
component: 'Input',
},
{
label: '下单须知',
field: 'orderDetails',
component: 'Input',
},
];

+ 229
- 0
module-common/src/main/java/org/jeecg/modules/commonPidClass/controller/CommonPidClassController.java View File

@ -0,0 +1,229 @@
package org.jeecg.modules.commonPidClass.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.commonPidClass.entity.CommonPidClass;
import org.jeecg.modules.commonPidClass.service.ICommonPidClassService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 二级分类
* @Author: jeecg-boot
* @Date: 2025-01-16
* @Version: V1.0
*/
@Api(tags="二级分类")
@RestController
@RequestMapping("/commonPidClass/commonPidClass")
@Slf4j
public class CommonPidClassController extends JeecgController<CommonPidClass, ICommonPidClassService>{
@Autowired
private ICommonPidClassService commonPidClassService;
/**
* 分页列表查询
*
* @param commonPidClass
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "二级分类-分页列表查询")
@ApiOperation(value="二级分类-分页列表查询", notes="二级分类-分页列表查询")
@GetMapping(value = "/rootList")
public Result<IPage<CommonPidClass>> queryPageList(CommonPidClass commonPidClass,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
String hasQuery = req.getParameter("hasQuery");
if(hasQuery != null && "true".equals(hasQuery)){
QueryWrapper<CommonPidClass> queryWrapper = QueryGenerator.initQueryWrapper(commonPidClass, req.getParameterMap());
List<CommonPidClass> list = commonPidClassService.queryTreeListNoPage(queryWrapper);
IPage<CommonPidClass> pageList = new Page<>(1, 10, list.size());
pageList.setRecords(list);
return Result.OK(pageList);
}else{
String parentId = commonPidClass.getPid();
if (oConvertUtils.isEmpty(parentId)) {
parentId = "0";
}
commonPidClass.setPid(null);
QueryWrapper<CommonPidClass> queryWrapper = QueryGenerator.initQueryWrapper(commonPidClass, req.getParameterMap());
// 使用 eq 防止模糊查询
queryWrapper.eq("pid", parentId);
Page<CommonPidClass> page = new Page<CommonPidClass>(pageNo, pageSize);
IPage<CommonPidClass> pageList = commonPidClassService.page(page, queryWrapper);
return Result.OK(pageList);
}
}
/**
* 获取子数据
* @param commonPidClass
* @param req
* @return
*/
//@AutoLog(value = "二级分类-获取子数据")
@ApiOperation(value="二级分类-获取子数据", notes="二级分类-获取子数据")
@GetMapping(value = "/childList")
public Result<IPage<CommonPidClass>> queryPageList(CommonPidClass commonPidClass,HttpServletRequest req) {
QueryWrapper<CommonPidClass> queryWrapper = QueryGenerator.initQueryWrapper(commonPidClass, req.getParameterMap());
List<CommonPidClass> list = commonPidClassService.list(queryWrapper);
IPage<CommonPidClass> pageList = new Page<>(1, 10, list.size());
pageList.setRecords(list);
return Result.OK(pageList);
}
/**
* 批量查询子节点
* @param parentIds 父ID多个采用半角逗号分割
* @return 返回 IPage
* @param parentIds
* @return
*/
//@AutoLog(value = "二级分类-批量获取子数据")
@ApiOperation(value="二级分类-批量获取子数据", notes="二级分类-批量获取子数据")
@GetMapping("/getChildListBatch")
public Result getChildListBatch(@RequestParam("parentIds") String parentIds) {
try {
QueryWrapper<CommonPidClass> queryWrapper = new QueryWrapper<>();
List<String> parentIdList = Arrays.asList(parentIds.split(","));
queryWrapper.in("pid", parentIdList);
List<CommonPidClass> list = commonPidClassService.list(queryWrapper);
IPage<CommonPidClass> pageList = new Page<>(1, 10, list.size());
pageList.setRecords(list);
return Result.OK(pageList);
} catch (Exception e) {
log.error(e.getMessage(), e);
return Result.error("批量查询子节点失败:" + e.getMessage());
}
}
/**
* 添加
*
* @param commonPidClass
* @return
*/
@AutoLog(value = "二级分类-添加")
@ApiOperation(value="二级分类-添加", notes="二级分类-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody CommonPidClass commonPidClass) {
commonPidClassService.addCommonPidClass(commonPidClass);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param commonPidClass
* @return
*/
@AutoLog(value = "二级分类-编辑")
@ApiOperation(value="二级分类-编辑", notes="二级分类-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody CommonPidClass commonPidClass) {
commonPidClassService.updateCommonPidClass(commonPidClass);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "二级分类-通过id删除")
@ApiOperation(value="二级分类-通过id删除", notes="二级分类-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
commonPidClassService.deleteCommonPidClass(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "二级分类-批量删除")
@ApiOperation(value="二级分类-批量删除", notes="二级分类-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.commonPidClassService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "二级分类-通过id查询")
@ApiOperation(value="二级分类-通过id查询", notes="二级分类-通过id查询")
@GetMapping(value = "/queryById")
public Result<CommonPidClass> queryById(@RequestParam(name="id",required=true) String id) {
CommonPidClass commonPidClass = commonPidClassService.getById(id);
if(commonPidClass==null) {
return Result.error("未找到对应数据");
}
return Result.OK(commonPidClass);
}
/**
* 导出excel
*
* @param request
* @param commonPidClass
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, CommonPidClass commonPidClass) {
return super.exportXls(request, commonPidClass, CommonPidClass.class, "二级分类");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, CommonPidClass.class);
}
}

+ 79
- 0
module-common/src/main/java/org/jeecg/modules/commonPidClass/entity/CommonPidClass.java View File

@ -0,0 +1,79 @@
package org.jeecg.modules.commonPidClass.entity;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.modules.commonShop.entity.CommonShop;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.UnsupportedEncodingException;
import java.util.List;
/**
* @Description: 二级分类
* @Author: jeecg-boot
* @Date: 2025-01-16
* @Version: V1.0
*/
@Data
@TableName("common_pid_class")
@ApiModel(value="common_pid_class对象", description="二级分类")
public class CommonPidClass implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**父级节点*/
@Excel(name = "父级节点", width = 15)
@ApiModelProperty(value = "父级节点")
private java.lang.String pid;
/**是否有子节点*/
@Excel(name = "是否有子节点", width = 15, dicCode = "yn")
@Dict(dicCode = "yn")
@ApiModelProperty(value = "是否有子节点")
private java.lang.String hasChild;
/**分类名称*/
@Excel(name = "分类名称", width = 15)
@ApiModelProperty(value = "分类名称")
private java.lang.String name;
/**排序*/
@Excel(name = "排序", width = 15)
@ApiModelProperty(value = "排序")
private java.lang.Integer sort;
/**图标*/
@Excel(name = "图标", width = 15)
@ApiModelProperty(value = "图标")
private java.lang.String image;
@TableField (exist = false)
private List<CommonPidClass> children;
@TableField (exist = false)
private List<CommonShop> shopList;
}

+ 22
- 0
module-common/src/main/java/org/jeecg/modules/commonPidClass/mapper/CommonPidClassMapper.java View File

@ -0,0 +1,22 @@
package org.jeecg.modules.commonPidClass.mapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.commonPidClass.entity.CommonPidClass;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 二级分类
* @Author: jeecg-boot
* @Date: 2025-01-16
* @Version: V1.0
*/
public interface CommonPidClassMapper extends BaseMapper<CommonPidClass> {
/**
* 编辑节点状态
* @param id
* @param status
*/
void updateTreeNodeStatus(@Param("id") String id,@Param("status") String status);
}

+ 9
- 0
module-common/src/main/java/org/jeecg/modules/commonPidClass/mapper/xml/CommonPidClassMapper.xml View File

@ -0,0 +1,9 @@
<?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.commonPidClass.mapper.CommonPidClassMapper">
<update id="updateTreeNodeStatus" parameterType="java.lang.String">
update common_pid_class set has_child = #{status} where id = #{id}
</update>
</mapper>

+ 38
- 0
module-common/src/main/java/org/jeecg/modules/commonPidClass/service/ICommonPidClassService.java View File

@ -0,0 +1,38 @@
package org.jeecg.modules.commonPidClass.service;
import org.jeecg.modules.commonPidClass.entity.CommonPidClass;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.exception.JeecgBootException;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.util.List;
/**
* @Description: 二级分类
* @Author: jeecg-boot
* @Date: 2025-01-16
* @Version: V1.0
*/
public interface ICommonPidClassService extends IService<CommonPidClass> {
/**根节点父ID的值*/
public static final String ROOT_PID_VALUE = "0";
/**树节点有子节点状态值*/
public static final String HASCHILD = "1";
/**树节点无子节点状态值*/
public static final String NOCHILD = "0";
/**新增节点*/
void addCommonPidClass(CommonPidClass commonPidClass);
/**修改节点*/
void updateCommonPidClass(CommonPidClass commonPidClass) throws JeecgBootException;
/**删除节点*/
void deleteCommonPidClass(String id) throws JeecgBootException;
/**查询所有数据,无分页*/
List<CommonPidClass> queryTreeListNoPage(QueryWrapper<CommonPidClass> queryWrapper);
}

+ 191
- 0
module-common/src/main/java/org/jeecg/modules/commonPidClass/service/impl/CommonPidClassServiceImpl.java View File

@ -0,0 +1,191 @@
package org.jeecg.modules.commonPidClass.service.impl;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.commonPidClass.entity.CommonPidClass;
import org.jeecg.modules.commonPidClass.mapper.CommonPidClassMapper;
import org.jeecg.modules.commonPidClass.service.ICommonPidClassService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 二级分类
* @Author: jeecg-boot
* @Date: 2025-01-16
* @Version: V1.0
*/
@Service
public class CommonPidClassServiceImpl extends ServiceImpl<CommonPidClassMapper, CommonPidClass> implements ICommonPidClassService {
@Override
public void addCommonPidClass(CommonPidClass commonPidClass) {
//新增时设置hasChild为0
commonPidClass.setHasChild(ICommonPidClassService.NOCHILD);
if(oConvertUtils.isEmpty(commonPidClass.getPid())){
commonPidClass.setPid(ICommonPidClassService.ROOT_PID_VALUE);
}else{
//如果当前节点父ID不为空 则设置父节点的hasChildren 为1
CommonPidClass parent = baseMapper.selectById(commonPidClass.getPid());
if(parent!=null && !"1".equals(parent.getHasChild())){
parent.setHasChild("1");
baseMapper.updateById(parent);
}
}
baseMapper.insert(commonPidClass);
}
@Override
public void updateCommonPidClass(CommonPidClass commonPidClass) {
CommonPidClass entity = this.getById(commonPidClass.getId());
if(entity==null) {
throw new JeecgBootException("未找到对应实体");
}
String old_pid = entity.getPid();
String new_pid = commonPidClass.getPid();
if(!old_pid.equals(new_pid)) {
updateOldParentNode(old_pid);
if(oConvertUtils.isEmpty(new_pid)){
commonPidClass.setPid(ICommonPidClassService.ROOT_PID_VALUE);
}
if(!ICommonPidClassService.ROOT_PID_VALUE.equals(commonPidClass.getPid())) {
baseMapper.updateTreeNodeStatus(commonPidClass.getPid(), ICommonPidClassService.HASCHILD);
}
}
baseMapper.updateById(commonPidClass);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteCommonPidClass(String id) throws JeecgBootException {
//查询选中节点下所有子节点一并删除
id = this.queryTreeChildIds(id);
if(id.indexOf(",")>0) {
StringBuffer sb = new StringBuffer();
String[] idArr = id.split(",");
for (String idVal : idArr) {
if(idVal != null){
CommonPidClass commonPidClass = this.getById(idVal);
String pidVal = commonPidClass.getPid();
//查询此节点上一级是否还有其他子节点
List<CommonPidClass> dataList = baseMapper.selectList(new QueryWrapper<CommonPidClass>().eq("pid", pidVal).notIn("id",Arrays.asList(idArr)));
if((dataList == null || dataList.size()==0) && !Arrays.asList(idArr).contains(pidVal)
&& !sb.toString().contains(pidVal)){
//如果当前节点原本有子节点 现在木有了更新状态
sb.append(pidVal).append(",");
}
}
}
//批量删除节点
baseMapper.deleteBatchIds(Arrays.asList(idArr));
//修改已无子节点的标识
String[] pidArr = sb.toString().split(",");
for(String pid : pidArr){
this.updateOldParentNode(pid);
}
}else{
CommonPidClass commonPidClass = this.getById(id);
if(commonPidClass==null) {
throw new JeecgBootException("未找到对应实体");
}
updateOldParentNode(commonPidClass.getPid());
baseMapper.deleteById(id);
}
}
@Override
public List<CommonPidClass> queryTreeListNoPage(QueryWrapper<CommonPidClass> queryWrapper) {
List<CommonPidClass> dataList = baseMapper.selectList(queryWrapper);
List<CommonPidClass> mapList = new ArrayList<>();
for(CommonPidClass data : dataList){
String pidVal = data.getPid();
//递归查询子节点的根节点
if(pidVal != null && !"0".equals(pidVal)){
CommonPidClass rootVal = this.getTreeRoot(pidVal);
if(rootVal != null && !mapList.contains(rootVal)){
mapList.add(rootVal);
}
}else{
if(!mapList.contains(data)){
mapList.add(data);
}
}
}
return mapList;
}
/**
* 根据所传pid查询旧的父级节点的子节点并修改相应状态值
* @param pid
*/
private void updateOldParentNode(String pid) {
// if(!ICommonPidClassService.ROOT_PID_VALUE.equals(pid)) {
// Integer count = baseMapper.selectCount(new QueryWrapper<CommonPidClass>().eq("pid", pid));
// if(count==null || count<=1) {
// baseMapper.updateTreeNodeStatus(pid, ICommonPidClassService.NOCHILD);
// }
// }
}
/**
* 递归查询节点的根节点
* @param pidVal
* @return
*/
private CommonPidClass getTreeRoot(String pidVal){
CommonPidClass data = baseMapper.selectById(pidVal);
if(data != null && !"0".equals(data.getPid())){
return this.getTreeRoot(data.getPid());
}else{
return data;
}
}
/**
* 根据id查询所有子节点id
* @param ids
* @return
*/
private String queryTreeChildIds(String ids) {
//获取id数组
String[] idArr = ids.split(",");
StringBuffer sb = new StringBuffer();
for (String pidVal : idArr) {
if(pidVal != null){
if(!sb.toString().contains(pidVal)){
if(sb.toString().length() > 0){
sb.append(",");
}
sb.append(pidVal);
this.getTreeChildIds(pidVal,sb);
}
}
}
return sb.toString();
}
/**
* 递归查询所有子节点
* @param pidVal
* @param sb
* @return
*/
private StringBuffer getTreeChildIds(String pidVal,StringBuffer sb){
List<CommonPidClass> dataList = baseMapper.selectList(new QueryWrapper<CommonPidClass>().eq("pid", pidVal));
if(dataList != null && dataList.size()>0){
for(CommonPidClass tree : dataList) {
if(!sb.toString().contains(tree.getId())){
sb.append(",").append(tree.getId());
}
this.getTreeChildIds(tree.getId(),sb);
}
}
return sb;
}
}

+ 360
- 0
module-common/src/main/java/org/jeecg/modules/commonPidClass/vue/CommonPidClassList.vue View File

@ -0,0 +1,360 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('二级分类')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
rowKey="id"
class="j-table-force-nowrap"
:scroll="{x:true}"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:expandedRowKeys="expandedRowKeys"
@change="handleTableChange"
@expand="handleExpand"
v-bind="tableProps">
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleAddChild(record)">添加下级</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDeleteNode(record.id)" placement="topLeft">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<commonPidClass-modal ref="modalForm" @ok="modalFormOk"></commonPidClass-modal>
</a-card>
</template>
<script>
import { getAction, deleteAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CommonPidClassModal from './modules/CommonPidClassModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import { filterObj } from '@/utils/util';
export default {
name: "CommonPidClassList",
mixins:[JeecgListMixin],
components: {
CommonPidClassModal
},
data () {
return {
description: '二级分类管理页面',
//
columns: [
{
title:'分类名称',
align:"left",
dataIndex: 'name'
},
{
title:'排序',
align:"left",
dataIndex: 'sort'
},
{
title:'图标',
align:"left",
dataIndex: 'image',
scopedSlots: {customRender: 'imgSlot'}
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/commonPidClass/commonPidClass/rootList",
childList: "/commonPidClass/commonPidClass/childList",
getChildListBatch: "/commonPidClass/commonPidClass/getChildListBatch",
delete: "/commonPidClass/commonPidClass/delete",
deleteBatch: "/commonPidClass/commonPidClass/deleteBatch",
exportXlsUrl: "/commonPidClass/commonPidClass/exportXls",
importExcelUrl: "commonPidClass/commonPidClass/importExcel",
},
expandedRowKeys:[],
hasChildrenField:"hasChild",
pidField:"pid",
dictOptions: {},
loadParent: false,
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
tableProps() {
let _this = this
return {
//
rowSelection: {
selectedRowKeys: _this.selectedRowKeys,
onChange: (selectedRowKeys) => _this.selectedRowKeys = selectedRowKeys
}
}
}
},
methods: {
loadData(arg){
if(arg==1){
this.ipagination.current=1
}
this.loading = true
let params = this.getQueryParams()
params.hasQuery = 'true'
getAction(this.url.list,params).then(res=>{
if(res.success){
let result = res.result
if(Number(result.total)>0){
this.ipagination.total = Number(result.total)
this.dataSource = this.getDataByResult(res.result.records)
return this.loadDataByExpandedRows(this.dataSource)
}else{
this.ipagination.total=0
this.dataSource=[]
}
}else{
this.$message.warning(res.message)
}
}).finally(()=>{
this.loading = false
})
},
//
loadDataByExpandedRows(dataList) {
if (this.expandedRowKeys.length > 0) {
return getAction(this.url.getChildListBatch,{ parentIds: this.expandedRowKeys.join(',') }).then(res=>{
if (res.success && res.result.records.length>0) {
//
let records = res.result.records
const listMap = new Map();
for (let item of records) {
let pid = item[this.pidField];
if (this.expandedRowKeys.join(',').includes(pid)) {
let mapList = listMap.get(pid);
if (mapList == null) {
mapList = [];
}
mapList.push(item);
listMap.set(pid, mapList);
}
}
let childrenMap = listMap;
let fn = (list) => {
if(list) {
list.forEach(data => {
if (this.expandedRowKeys.includes(data.id)) {
data.children = this.getDataByResult(childrenMap.get(data.id))
fn(data.children)
}
})
}
}
fn(dataList)
}
})
} else {
return Promise.resolve()
}
},
getQueryParams(arg) {
//
let sqp = {}
let param = {}
if(this.superQueryParams){
sqp['superQueryParams']=encodeURI(this.superQueryParams)
sqp['superQueryMatchType'] = this.superQueryMatchType
}
if(arg){
param = Object.assign(sqp, this.isorter ,this.filters);
}else{
param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters);
}
if(JSON.stringify(this.queryParam) === "{}" || arg){
param.hasQuery = 'false'
}else{
param.hasQuery = 'true'
}
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
return filterObj(param);
},
searchReset() {
//
this.expandedRowKeys = []
this.queryParam = {}
this.loadData(1);
},
getDataByResult(result){
if(result){
return result.map(item=>{
//
if(item[this.hasChildrenField]=='1'){
let loadChild = { id: item.id+'_loadChild', name: 'loading...', isLoading: true }
item.children = [loadChild]
}
return item
})
}
},
handleExpand(expanded, record){
//
if (expanded) {
this.expandedRowKeys.push(record.id)
if (record.children.length>0 && record.children[0].isLoading === true) {
let params = this.getQueryParams(1);//
params[this.pidField] = record.id
params.hasQuery = 'false'
params.superQueryParams=""
getAction(this.url.childList,params).then((res)=>{
if(res.success){
if(res.result.records){
record.children = this.getDataByResult(res.result.records)
this.dataSource = [...this.dataSource]
}else{
record.children=''
record.hasChildrenField='0'
}
}else{
this.$message.warning(res.message)
}
})
}
}else{
let keyIndex = this.expandedRowKeys.indexOf(record.id)
if(keyIndex>=0){
this.expandedRowKeys.splice(keyIndex, 1);
}
}
},
handleAddChild(record){
this.loadParent = true
let obj = {}
obj[this.pidField] = record['id']
this.$refs.modalForm.add(obj);
},
handleDeleteNode(id) {
if(!this.url.delete){
this.$message.error("请设置url.delete属性!")
return
}
var that = this;
deleteAction(that.url.delete, {id: id}).then((res) => {
if (res.success) {
that.loadData(1)
} else {
that.$message.warning(res.message);
}
});
},
batchDel(){
if(this.selectedRowKeys.length<=0){
this.$message.warning('请选择一条记录!');
return false;
}else{
let ids = "";
let that = this;
that.selectedRowKeys.forEach(function(val) {
ids+=val+",";
});
that.$confirm({
title:"确认删除",
content:"是否删除选中数据?",
onOk: function(){
that.handleDeleteNode(ids)
that.onClearSelected();
}
});
}
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'pid',text:'父级节点',dictCode:''})
fieldList.push({type:'string',value:'name',text:'分类名称',dictCode:''})
fieldList.push({type:'int',value:'sort',text:'排序',dictCode:''})
fieldList.push({type:'Text',value:'image',text:'图标',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

+ 159
- 0
module-common/src/main/java/org/jeecg/modules/commonPidClass/vue/modules/CommonPidClassModal.vue View File

@ -0,0 +1,159 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
switchFullscreen
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model" :rules="validatorRules">
<a-form-model-item label="父级节点" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pid">
<j-tree-select
ref="treeSelect"
placeholder="请选择父级节点"
v-model="model.pid"
dict="common_pid_class,name,id"
pidField="pid"
pidValue="0"
hasChildField="has_child"
>
</j-tree-select>
</a-form-model-item>
<a-form-model-item label="分类名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
<a-input v-model="model.name" placeholder="请输入分类名称" ></a-input>
</a-form-model-item>
<a-form-model-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sort">
<a-input-number v-model="model.sort" placeholder="请输入排序" style="width: 100%" />
</a-form-model-item>
<a-form-model-item label="图标" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="image">
<j-image-upload isMultiple v-model="model.image" ></j-image-upload>
</a-form-model-item>
</a-form-model>
</a-spin>
</j-modal>
</template>
<script>
import { httpAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: "CommonPidClassModal",
components: {
},
data () {
return {
title:"操作",
width:800,
visible: false,
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/commonPidClass/commonPidClass/add",
edit: "/commonPidClass/commonPidClass/edit",
},
expandedRowKeys:[],
pidField:"pid"
}
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add (obj) {
this.modelDefault.pid=''
this.edit(Object.assign(this.modelDefault , obj));
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
close () {
this.$emit('close');
this.visible = false;
this.$refs.form.clearValidate()
},
handleOk () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
if(this.model.id && this.model.id === this.model[this.pidField]){
that.$message.warning("父级节点不能选择自己");
that.confirmLoading = false;
return;
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
this.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
that.close();
})
}else{
return false
}
})
},
handleCancel () {
this.close()
},
submitSuccess(formData,flag){
if(!formData.id){
let treeData = this.$refs.treeSelect.getCurrTreeData()
this.expandedRowKeys=[]
this.getExpandKeysByPid(formData[this.pidField],treeData,treeData)
this.$emit('ok',formData,this.expandedRowKeys.reverse());
}else{
this.$emit('ok',formData,flag);
}
},
getExpandKeysByPid(pid,arr,all){
if(pid && arr && arr.length>0){
for(let i=0;i<arr.length;i++){
if(arr[i].key==pid){
this.expandedRowKeys.push(arr[i].key)
this.getExpandKeysByPid(arr[i]['parentId'],all,all)
}else{
this.getExpandKeysByPid(pid,arr[i].children,all)
}
}
}
}
}
}
</script>

+ 82
- 0
module-common/src/main/java/org/jeecg/modules/commonPidClass/vue3/CommonPidClass.api.ts View File

@ -0,0 +1,82 @@
import {defHttp} from "/@/utils/http/axios";
import {Modal} from 'ant-design-vue';
enum Api {
list = '/commonPidClass/commonPidClass/rootList',
save='/commonPidClass/commonPidClass/add',
edit='/commonPidClass/commonPidClass/edit',
deleteCommonPidClass = '/sys/commonPidClass/delete',
deleteBatch = '/commonPidClass/commonPidClass/deleteBatch',
importExcel = '/commonPidClass/commonPidClass/importExcel',
exportXls = '/commonPidClass/commonPidClass/exportXls',
loadTreeData = '/commonPidClass/commonPidClass/loadTreeRoot',
getChildList = '/commonPidClass/commonPidClass/childList',
getChildListBatch = '/commonPidClass/commonPidClass/getChildListBatch',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
* @param params
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
*
*/
export const deleteCommonPidClass = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteCommonPidClass, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
export const batchDeleteCommonPidClass = (params, handleSuccess) => {
Modal.confirm({
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
*/
export const saveOrUpdateDict = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}
/**
*
* @param params
*/
export const loadTreeData = (params) =>
defHttp.get({url: Api.loadTreeData,params});
/**
*
* @param params
*/
export const getChildList = (params) =>
defHttp.get({url: Api.getChildList, params});
/**
*
* @param params
*/
export const getChildListBatch = (params) =>
defHttp.get({url: Api.getChildListBatch, params},{isTransformResponse:false});

+ 51
- 0
module-common/src/main/java/org/jeecg/modules/commonPidClass/vue3/CommonPidClass.data.ts View File

@ -0,0 +1,51 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '分类名称',
align:"center",
dataIndex: 'name'
},
{
title: '排序',
align:"center",
dataIndex: 'sort'
},
{
title: '图标',
align:"center",
dataIndex: 'image',
customRender:render.renderAvatar,
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '父级节点',
field: 'pid',
component: 'Input',
},
{
label: '分类名称',
field: 'name',
component: 'Input',
},
{
label: '排序',
field: 'sort',
component: 'InputNumber',
},
{
label: '图标',
field: 'image',
component: 'JImageUpload',
componentProps:{
},
},
];

+ 272
- 0
module-common/src/main/java/org/jeecg/modules/commonPidClass/vue3/CommonPidClassList.vue View File

@ -0,0 +1,272 @@
<template>
<div class="p-4">
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection" :expandedRowKeys="expandedRowKeys" @expand="handleExpand" @fetch-success="onFetchSuccess">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleCreate" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" 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>批量操作
<Icon icon="ant-design:down-outlined"></Icon>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
</BasicTable>
<!--字典弹窗-->
<CommonPidClassModal @register="registerModal" @success="handleSuccess"/>
</div>
</template>
<script lang="ts" name="commonPidClass-commonPidClass" setup>
//ts
import {ref, computed, unref, toRaw, nextTick} from 'vue';
import {BasicTable, useTable, TableAction} from '/src/components/Table';
import {useModal} from '/src/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import CommonPidClassModal from './components/CommonPidClassModal.vue';
import {columns} from './CommonPidClass.data';
import {list, deleteCommonPidClass, batchDeleteCommonPidClass, getExportUrl,getImportUrl, getChildList,getChildListBatch} from './CommonPidClass.api';
const expandedRowKeys = ref([]);
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '二级分类',
columns,
canResize:false,
actionColumn: {
width: 120,
},
},
exportConfig: {
name:"二级分类",
url: getExportUrl,
},
importConfig: {
url: getImportUrl,
success: importSuccess
},
})
const [registerTable, {reload, collapseAll, updateTableDataRecord, findTableDataRecord,getDataSource},{ rowSelection, selectedRowKeys }] = tableContext
/**
* 新增事件
*/
function handleCreate() {
openModal(true, {
isUpdate: false,
});
}
/**
* 编辑事件
*/
async function handleEdit(record) {
openModal(true, {
record,
isUpdate: true,
});
}
/**
* 详情
*/
async function handleDetail(record) {
openModal(true, {
record,
isUpdate: true,
hideFooter: true,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteCommonPidClass({id: record.id}, importSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
const ids = selectedRowKeys.value.filter(item => !item.includes('loading'))
await batchDeleteCommonPidClass({ids: ids}, importSuccess);
}
/**
* 导入
*/
function importSuccess() {
reload() && (expandedRowKeys.value = []);
}
/**
* 添加下级
*/
function handleAddSub(record) {
openModal(true, {
record,
isUpdate: false,
});
}
/**
* 成功回调
*/
async function handleSuccess({isUpdate, values, expandedArr}) {
if (isUpdate) {
//
updateTableDataRecord(values.id, values);
} else {
if(!values['pid']){
//
reload();
}else{
//
expandedRowKeys.value = [];
for (let key of unref(expandedArr)) {
await expandTreeNode(key)
}
}
}
}
/**
* 接口请求成功后回调
*/
function onFetchSuccess(result) {
getDataByResult(result.items)&&loadDataByExpandedRows();
}
/**
* 根据已展开的行查询数据用于保存后刷新时异步加载子级的数据
*/
async function loadDataByExpandedRows() {
if (unref(expandedRowKeys).length > 0) {
const res = await getChildListBatch({ parentIds: unref(expandedRowKeys).join(',')});
if (res.success && res.result.records.length>0) {
//
let records = res.result.records
const listMap = new Map();
for (let item of records) {
let pid = item['pid'];
if (unref(expandedRowKeys).includes(pid)) {
let mapList = listMap.get(pid);
if (mapList == null) {
mapList = [];
}
mapList.push(item);
listMap.set(pid, mapList);
}
}
let childrenMap = listMap;
let fn = (list) => {
if(list) {
list.forEach(data => {
if (unref(expandedRowKeys).includes(data.id)) {
data.children = getDataByResult(childrenMap.get(data.id))
fn(data.children)
}
})
}
};
fn(getDataSource())
}
}
}
/**
* 处理数据集
*/
function getDataByResult(result){
if(result && result.length>0){
return result.map(item=>{
//
if(item["hasChild"]=='1'){
let loadChild = { id: item.id+'_loadChild', name: 'loading...', isLoading: true }
item.children = [loadChild]
}
return item
})
}
}
/**
*树节点展开合并
* */
async function handleExpand(expanded, record) {
// (expanded)(children)(isLoading)
if (expanded) {
expandedRowKeys.value.push(record.id)
if (record.children.length > 0 && !!record.children[0].isLoading) {
let result = await getChildList({pid: record.id});
result=result.records?result.records:result;
if (result && result.length > 0) {
record.children = getDataByResult(result);
} else {
record.children = null
record.hasChild = '0'
}
}
} else {
let keyIndex = expandedRowKeys.value.indexOf(record.id)
if (keyIndex >= 0) {
expandedRowKeys.value.splice(keyIndex, 1);
}
}
}
/**
*操作表格后处理树节点展开合并
* */
async function expandTreeNode(key) {
let record = findTableDataRecord(key)
expandedRowKeys.value.push(key);
let result = await getChildList({pid: key});
if (result && result.length > 0) {
record.children = getDataByResult(result);
} else {
record.children = null
record.hasChild = '0'
}
updateTableDataRecord(key, record);
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
},
{
label: '删除',
popConfirm: {
title: '确定删除吗?',
confirm: handleDelete.bind(null, record),
},
},
{
label: '添加下级',
onClick: handleAddSub.bind(null, {pid: record.id}),
}
]
}
</script>
<style scoped>
</style>

+ 87
- 0
module-common/src/main/java/org/jeecg/modules/commonPidClass/vue3/components/CommonPidClassModal.vue View File

@ -0,0 +1,87 @@
<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 '/src/components/Modal';
import {BasicForm, useForm} from '/src/components/Form';
import {formSchema} from '../commonPidClass.data';
import {loadTreeData, saveOrUpdateDict} from '../commonPidClass.api';
// emit
const emit = defineEmits(['register', 'success']);
const isUpdate = ref(true);
const expandedRowKeys = ref([]);
const treeData = ref([]);
//
const [registerForm, {resetFields, setFieldsValue, validate, updateSchema}] = useForm({
schemas: formSchema,
showActionButtonGroup: false,
labelCol: {
xs: { span: 24 },
sm: { span: 4 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 18 },
},
});
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//
await resetFields();
expandedRowKeys.value = [];
setModalProps({confirmLoading: false, minHeight: 80});
isUpdate.value = !!data?.isUpdate;
if (data?.record) {
//
await setFieldsValue({
...data.record,
});
}
//
treeData.value = await loadTreeData({'async': false,'pcode':''});
updateSchema({
field: 'pid',
componentProps: {treeData},
});
});
//
const getTitle = computed(() => (!unref(isUpdate) ? '新增字典' : '编辑字典'));
/**
* 根据pid获取展开的节点
* @param pid
* @param arr
*/
function getExpandKeysByPid(pid,arr){
if(pid && arr && arr.length>0){
for(let i=0;i<arr.length;i++){
if(arr[i].key==pid && unref(expandedRowKeys).indexOf(pid)<0){
expandedRowKeys.value.push(arr[i].key);
getExpandKeysByPid(arr[i]['parentId'],unref(treeData))
}else{
getExpandKeysByPid(pid,arr[i].children)
}
}
}
}
//
async function handleSubmit() {
try {
let values = await validate();
setModalProps({confirmLoading: true});
//
await saveOrUpdateDict(values, isUpdate.value);
//
closeModal();
//
await getExpandKeysByPid(values['pid'],unref(treeData))
//(isUpdate:;values:;expandedArr:)
emit('success', {isUpdate: unref(isUpdate), values:{...values},expandedArr: unref(expandedRowKeys).reverse()});
} finally {
setModalProps({confirmLoading: false});
}
}
</script>

+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonShop/controller/CommonShopController.java View File

@ -39,7 +39,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 单商户商品信息表
* @Author: jeecg-boot
* @Date: 2024-12-13
* @Date: 2025-01-16
* @Version: V1.0
*/
@Api(tags="单商户商品信息表")


+ 78
- 17
module-common/src/main/java/org/jeecg/modules/commonShop/entity/CommonShop.java View File

@ -20,7 +20,7 @@ import lombok.experimental.Accessors;
/**
* @Description: 单商户商品信息表
* @Author: jeecg-boot
* @Date: 2024-12-13
* @Date: 2025-01-16
* @Version: V1.0
*/
@Data
@ -47,6 +47,11 @@ public class CommonShop implements Serializable {
/**更新日期*/
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**分类*/
@Excel(name = "分类", width = 15, dictTable = "common_pid_class", dicText = "name", dicCode = "id")
@Dict(dictTable = "common_pid_class", dicText = "name", dicCode = "id")
@ApiModelProperty(value = "分类")
private java.lang.String commonPidClassId;
/**标题*/
@Excel(name = "标题", width = 15)
@ApiModelProperty(value = "标题")
@ -64,14 +69,26 @@ public class CommonShop implements Serializable {
@Dict(dicCode = "shop_type")
@ApiModelProperty(value = "类型")
private java.lang.Integer type;
/**价格*/
@Excel(name = "价格", width = 15)
@ApiModelProperty(value = "价格")
private java.math.BigDecimal price;
/**原价*/
@Excel(name = "原价", width = 15)
@ApiModelProperty(value = "原价")
private java.math.BigDecimal oldPrice;
/**价格*/
@Excel(name = "价格", width = 15)
@ApiModelProperty(value = "价格")
private java.math.BigDecimal price;
/**金卡价*/
@Excel(name = "金卡价", width = 15)
@ApiModelProperty(value = "金卡价")
private java.math.BigDecimal goldPrice;
/**银卡价*/
@Excel(name = "银卡价", width = 15)
@ApiModelProperty(value = "银卡价")
private java.math.BigDecimal silverPrice;
/**钻石价*/
@Excel(name = "钻石价", width = 15)
@ApiModelProperty(value = "钻石价")
private java.lang.String diamondPrice;
/**会员价格*/
@Excel(name = "会员价格", width = 15)
@ApiModelProperty(value = "会员价格")
@ -109,16 +126,60 @@ public class CommonShop implements Serializable {
@Excel(name = "首页显示", width = 15)
@ApiModelProperty(value = "首页显示")
private java.lang.String indexNo;
/**金卡价*/
@Excel(name = "金卡价", width = 15)
@ApiModelProperty(value = "金卡价")
private java.math.BigDecimal goldPrice;
/**银卡价*/
@Excel(name = "银卡价", width = 15)
@ApiModelProperty(value = "银卡价")
private java.math.BigDecimal silverPrice;
/**钻石价*/
@Excel(name = "钻石价", width = 15)
@ApiModelProperty(value = "钻石价")
private java.lang.String diamondPrice;
/**产品材质*/
@Excel(name = "产品材质", width = 15)
@ApiModelProperty(value = "产品材质")
private java.lang.String subText;
/**X销量*/
@Excel(name = "X销量", width = 15)
@ApiModelProperty(value = "X销量")
private java.lang.Integer payNum;
/**说明*/
@Excel(name = "说明", width = 15)
@ApiModelProperty(value = "说明")
private java.lang.String subDetails;
/**下单须知*/
@Excel(name = "下单须知", width = 15)
@ApiModelProperty(value = "下单须知")
private java.lang.String orderDetails;
/**普通【直推】返佣*/
@Excel(name = "普通【直推】返佣", width = 15)
@ApiModelProperty(value = "普通【直推】返佣")
private java.math.BigDecimal givePrice;
/**金卡【直推】返佣*/
@Excel(name = "金卡【直推】返佣", width = 15)
@ApiModelProperty(value = "金卡【直推】返佣")
private java.math.BigDecimal goldGivePrice;
/**银卡【直推】返佣*/
@Excel(name = "银卡【直推】返佣", width = 15)
@ApiModelProperty(value = "银卡【直推】返佣")
private java.math.BigDecimal silverGivePrice;
/**钻石【直推】返佣*/
@Excel(name = "钻石【直推】返佣", width = 15)
@ApiModelProperty(value = "钻石【直推】返佣")
private java.math.BigDecimal diamondGivePrice;
/**合伙人【直推】返佣*/
@Excel(name = "合伙人【直推】返佣", width = 15)
@ApiModelProperty(value = "合伙人【直推】返佣")
private java.math.BigDecimal shopUseerMoney;
/**普通【间推】返佣*/
@Excel(name = "普通【间推】返佣", width = 15)
@ApiModelProperty(value = "普通【间推】返佣")
private java.math.BigDecimal givePriceTwo;
/**金卡【间推】返佣*/
@Excel(name = "金卡【间推】返佣", width = 15)
@ApiModelProperty(value = "金卡【间推】返佣")
private java.math.BigDecimal goldGivePriceTwo;
/**银卡【间推】返佣*/
@Excel(name = "银卡【间推】返佣", width = 15)
@ApiModelProperty(value = "银卡【间推】返佣")
private java.math.BigDecimal silverGivePriceTwo;
/**钻石【间推】返佣*/
@Excel(name = "钻石【间推】返佣", width = 15)
@ApiModelProperty(value = "钻石【间推】返佣")
private java.math.BigDecimal diamondGivePriceTwo;
/**合伙人【间推】返佣*/
@Excel(name = "合伙人【间推】返佣", width = 15)
@ApiModelProperty(value = "合伙人【间推】返佣")
private java.math.BigDecimal shopUseerMoneyTwo;
}

+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonShop/mapper/CommonShopMapper.java View File

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 单商户商品信息表
* @Author: jeecg-boot
* @Date: 2024-12-13
* @Date: 2025-01-16
* @Version: V1.0
*/
public interface CommonShopMapper extends BaseMapper<CommonShop> {


+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonShop/service/ICommonShopService.java View File

@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 单商户商品信息表
* @Author: jeecg-boot
* @Date: 2024-12-13
* @Date: 2025-01-16
* @Version: V1.0
*/
public interface ICommonShopService extends IService<CommonShop> {


+ 1
- 1
module-common/src/main/java/org/jeecg/modules/commonShop/service/impl/CommonShopServiceImpl.java View File

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 单商户商品信息表
* @Author: jeecg-boot
* @Date: 2024-12-13
* @Date: 2025-01-16
* @Version: V1.0
*/
@Service


+ 114
- 17
module-common/src/main/java/org/jeecg/modules/commonShop/vue/CommonShopList.vue View File

@ -137,6 +137,17 @@
return parseInt(index)+1;
}
},
{
title:'创建日期',
align:"center",
sorter: true,
dataIndex: 'createTime'
},
{
title:'分类',
align:"center",
dataIndex: 'commonPidClassId_dictText'
},
{
title:'标题',
align:"center",
@ -158,15 +169,30 @@
align:"center",
dataIndex: 'type_dictText'
},
{
title:'原价',
align:"center",
dataIndex: 'oldPrice'
},
{
title:'价格',
align:"center",
dataIndex: 'price'
},
{
title:'价',
title:'金卡价',
align:"center",
dataIndex: 'oldPrice'
dataIndex: 'goldPrice'
},
{
title:'银卡价',
align:"center",
dataIndex: 'silverPrice'
},
{
title:'钻石价',
align:"center",
dataIndex: 'diamondPrice'
},
{
title:'会员价格',
@ -174,14 +200,14 @@
dataIndex: 'vipPrice'
},
{
title:'标签',
title:'限购数量',
align:"center",
dataIndex: 'skuIcon'
dataIndex: 'num'
},
{
title:'分类标识',
title:'标签',
align:"center",
dataIndex: 'classId_dictText'
dataIndex: 'skuIcon'
},
{
title:'首页显示',
@ -190,19 +216,74 @@
customRender: (text) => (text ? filterMultiDictText(this.dictOptions['indexNo'], text) : ''),
},
{
title:'金卡价',
title:'产品材质',
align:"center",
dataIndex: 'goldPrice'
dataIndex: 'subText'
},
{
title:'银卡价',
title:'X销量',
align:"center",
dataIndex: 'silverPrice'
dataIndex: 'payNum'
},
{
title:'钻石价',
title:'说明',
align:"center",
dataIndex: 'diamondPrice'
dataIndex: 'subDetails'
},
{
title:'下单须知',
align:"center",
dataIndex: 'orderDetails'
},
{
title:'普通【直推】返佣',
align:"center",
dataIndex: 'givePrice'
},
{
title:'金卡【直推】返佣',
align:"center",
dataIndex: 'goldGivePrice'
},
{
title:'银卡【直推】返佣',
align:"center",
dataIndex: 'silverGivePrice'
},
{
title:'钻石【直推】返佣',
align:"center",
dataIndex: 'diamondGivePrice'
},
{
title:'合伙人【直推】返佣',
align:"center",
dataIndex: 'shopUseerMoney'
},
{
title:'普通【间推】返佣',
align:"center",
dataIndex: 'givePriceTwo'
},
{
title:'金卡【间推】返佣',
align:"center",
dataIndex: 'goldGivePriceTwo'
},
{
title:'银卡【间推】返佣',
align:"center",
dataIndex: 'silverGivePriceTwo'
},
{
title:'钻石【间推】返佣',
align:"center",
dataIndex: 'diamondGivePriceTwo'
},
{
title:'合伙人【间推】返佣',
align:"center",
dataIndex: 'shopUseerMoneyTwo'
},
{
title: '操作',
@ -239,20 +320,36 @@
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'datetime',value:'createTime',text:'创建日期'})
fieldList.push({type:'string',value:'commonPidClassId',text:'分类'})
fieldList.push({type:'string',value:'title',text:'标题',dictCode:''})
fieldList.push({type:'Text',value:'image',text:'主图',dictCode:''})
fieldList.push({type:'string',value:'sku',text:'规格',dictCode:''})
fieldList.push({type:'int',value:'type',text:'类型',dictCode:'shop_type'})
fieldList.push({type:'BigDecimal',value:'price',text:'价格',dictCode:''})
fieldList.push({type:'BigDecimal',value:'oldPrice',text:'原价',dictCode:''})
fieldList.push({type:'BigDecimal',value:'price',text:'价格',dictCode:''})
fieldList.push({type:'BigDecimal',value:'goldPrice',text:'金卡价',dictCode:''})
fieldList.push({type:'BigDecimal',value:'silverPrice',text:'银卡价',dictCode:''})
fieldList.push({type:'string',value:'diamondPrice',text:'钻石价',dictCode:''})
fieldList.push({type:'BigDecimal',value:'vipPrice',text:'会员价格',dictCode:''})
fieldList.push({type:'int',value:'num',text:'限购数量',dictCode:''})
fieldList.push({type:'string',value:'skuIcon',text:'标签',dictCode:''})
fieldList.push({type:'Text',value:'details',text:'详情',dictCode:''})
fieldList.push({type:'sel_search',value:'classId',text:'分类标识',dictTable:"common_class", dictText:'title', dictCode:'id'})
fieldList.push({type:'switch',value:'indexNo',text:'首页显示'})
fieldList.push({type:'BigDecimal',value:'goldPrice',text:'金卡价',dictCode:''})
fieldList.push({type:'BigDecimal',value:'silverPrice',text:'银卡价',dictCode:''})
fieldList.push({type:'string',value:'diamondPrice',text:'钻石价',dictCode:''})
fieldList.push({type:'string',value:'subText',text:'产品材质',dictCode:''})
fieldList.push({type:'int',value:'payNum',text:'X销量',dictCode:''})
fieldList.push({type:'string',value:'subDetails',text:'说明',dictCode:''})
fieldList.push({type:'Text',value:'orderDetails',text:'下单须知',dictCode:''})
fieldList.push({type:'BigDecimal',value:'givePrice',text:'普通【直推】返佣',dictCode:''})
fieldList.push({type:'BigDecimal',value:'goldGivePrice',text:'金卡【直推】返佣',dictCode:''})
fieldList.push({type:'BigDecimal',value:'silverGivePrice',text:'银卡【直推】返佣',dictCode:''})
fieldList.push({type:'BigDecimal',value:'diamondGivePrice',text:'钻石【直推】返佣',dictCode:''})
fieldList.push({type:'BigDecimal',value:'shopUseerMoney',text:'合伙人【直推】返佣',dictCode:''})
fieldList.push({type:'BigDecimal',value:'givePriceTwo',text:'普通【间推】返佣',dictCode:''})
fieldList.push({type:'BigDecimal',value:'goldGivePriceTwo',text:'金卡【间推】返佣',dictCode:''})
fieldList.push({type:'BigDecimal',value:'silverGivePriceTwo',text:'银卡【间推】返佣',dictCode:''})
fieldList.push({type:'BigDecimal',value:'diamondGivePriceTwo',text:'钻石【间推】返佣',dictCode:''})
fieldList.push({type:'BigDecimal',value:'shopUseerMoneyTwo',text:'合伙人【间推】返佣',dictCode:''})
this.superFieldList = fieldList
}
}


+ 94
- 12
module-common/src/main/java/org/jeecg/modules/commonShop/vue/modules/CommonShopForm.vue View File

@ -3,6 +3,18 @@
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="分类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="commonPidClassId">
<j-tree-select
ref="treeSelect"
placeholder="请选择分类"
v-model="model.commonPidClassId"
dict="common_pid_class,name,id"
pidValue="0"
>
</j-tree-select>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="title">
<a-input v-model="model.title" placeholder="请输入标题" ></a-input>
@ -23,14 +35,29 @@
<j-dict-select-tag type="list" v-model="model.type" dictCode="shop_type" placeholder="请选择类型" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="原价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="oldPrice">
<a-input-number v-model="model.oldPrice" placeholder="请输入原价" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="价格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="price">
<a-input-number v-model="model.price" placeholder="请输入价格" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="原价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="oldPrice">
<a-input-number v-model="model.oldPrice" placeholder="请输入原价" style="width: 100%" />
<a-form-model-item label="金卡价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goldPrice">
<a-input-number v-model="model.goldPrice" placeholder="请输入金卡价" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="银卡价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="silverPrice">
<a-input-number v-model="model.silverPrice" placeholder="请输入银卡价" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="钻石价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="diamondPrice">
<a-input v-model="model.diamondPrice" placeholder="请输入钻石价" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -38,6 +65,11 @@
<a-input-number v-model="model.vipPrice" placeholder="请输入会员价格" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="限购数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num">
<a-input-number v-model="model.num" placeholder="请输入限购数量" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="标签" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="skuIcon">
<a-input v-model="model.skuIcon" placeholder="请输入标签" ></a-input>
@ -49,28 +81,78 @@
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="分类标识" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="classId">
<j-search-select-tag v-model="model.classId" dict="common_class,title,id" />
<a-form-model-item label="首页显示" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="indexNo">
<j-switch v-model="model.indexNo" ></j-switch>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="首页显示" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="indexNo">
<j-switch v-model="model.indexNo" ></j-switch>
<a-form-model-item label="产品材质" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="subText">
<a-input v-model="model.subText" placeholder="请输入产品材质" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="金卡价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goldPrice">
<a-input-number v-model="model.goldPrice" placeholder="请输入金卡价" style="width: 100%" />
<a-form-model-item label="X销量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="payNum">
<a-input-number v-model="model.payNum" placeholder="请输入X销量" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="银卡价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="silverPrice">
<a-input-number v-model="model.silverPrice" placeholder="请输入银卡价" style="width: 100%" />
<a-form-model-item label="说明" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="subDetails">
<a-input v-model="model.subDetails" placeholder="请输入说明" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="钻石价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="diamondPrice">
<a-input v-model="model.diamondPrice" placeholder="请输入钻石价" ></a-input>
<a-form-model-item label="下单须知" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderDetails">
<a-textarea v-model="model.orderDetails" rows="4" placeholder="请输入下单须知" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="普通【直推】返佣" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="givePrice">
<a-input-number v-model="model.givePrice" placeholder="请输入普通【直推】返佣" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="金卡【直推】返佣" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goldGivePrice">
<a-input-number v-model="model.goldGivePrice" placeholder="请输入金卡【直推】返佣" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="银卡【直推】返佣" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="silverGivePrice">
<a-input-number v-model="model.silverGivePrice" placeholder="请输入银卡【直推】返佣" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="钻石【直推】返佣" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="diamondGivePrice">
<a-input-number v-model="model.diamondGivePrice" placeholder="请输入钻石【直推】返佣" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="合伙人【直推】返佣" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shopUseerMoney">
<a-input-number v-model="model.shopUseerMoney" placeholder="请输入合伙人【直推】返佣" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="普通【间推】返佣" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="givePriceTwo">
<a-input-number v-model="model.givePriceTwo" placeholder="请输入普通【间推】返佣" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="金卡【间推】返佣" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goldGivePriceTwo">
<a-input-number v-model="model.goldGivePriceTwo" placeholder="请输入金卡【间推】返佣" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="银卡【间推】返佣" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="silverGivePriceTwo">
<a-input-number v-model="model.silverGivePriceTwo" placeholder="请输入银卡【间推】返佣" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="钻石【间推】返佣" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="diamondGivePriceTwo">
<a-input-number v-model="model.diamondGivePriceTwo" placeholder="请输入钻石【间推】返佣" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="合伙人【间推】返佣" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shopUseerMoneyTwo">
<a-input-number v-model="model.shopUseerMoneyTwo" placeholder="请输入合伙人【间推】返佣" style="width: 100%" />
</a-form-model-item>
</a-col>
</a-row>


+ 186
- 29
module-common/src/main/java/org/jeecg/modules/commonShop/vue3/CommonShop.data.ts View File

@ -5,6 +5,17 @@ import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '创建日期',
align:"center",
sorter: true,
dataIndex: 'createTime'
},
{
title: '分类',
align:"center",
dataIndex: 'commonPidClassId_dictText'
},
{
title: '标题',
align:"center",
dataIndex: 'title'
@ -25,15 +36,30 @@ export const columns: BasicColumn[] = [
align:"center",
dataIndex: 'type_dictText'
},
{
title: '原价',
align:"center",
dataIndex: 'oldPrice'
},
{
title: '价格',
align:"center",
dataIndex: 'price'
},
{
title: '价',
title: '金卡价',
align:"center",
dataIndex: 'oldPrice'
dataIndex: 'goldPrice'
},
{
title: '银卡价',
align:"center",
dataIndex: 'silverPrice'
},
{
title: '钻石价',
align:"center",
dataIndex: 'diamondPrice'
},
{
title: '会员价格',
@ -41,14 +67,14 @@ export const columns: BasicColumn[] = [
dataIndex: 'vipPrice'
},
{
title: '标签',
title: '限购数量',
align:"center",
dataIndex: 'skuIcon'
dataIndex: 'num'
},
{
title: '分类标识',
title: '标签',
align:"center",
dataIndex: 'classId_dictText'
dataIndex: 'skuIcon'
},
{
title: '首页显示',
@ -59,19 +85,74 @@ export const columns: BasicColumn[] = [
},
},
{
title: '金卡价',
title: '产品材质',
align:"center",
dataIndex: 'goldPrice'
dataIndex: 'subText'
},
{
title: '银卡价',
title: 'X销量',
align:"center",
dataIndex: 'silverPrice'
dataIndex: 'payNum'
},
{
title: '钻石价',
title: '说明',
align:"center",
dataIndex: 'diamondPrice'
dataIndex: 'subDetails'
},
{
title: '下单须知',
align:"center",
dataIndex: 'orderDetails'
},
{
title: '普通【直推】返佣',
align:"center",
dataIndex: 'givePrice'
},
{
title: '金卡【直推】返佣',
align:"center",
dataIndex: 'goldGivePrice'
},
{
title: '银卡【直推】返佣',
align:"center",
dataIndex: 'silverGivePrice'
},
{
title: '钻石【直推】返佣',
align:"center",
dataIndex: 'diamondGivePrice'
},
{
title: '合伙人【直推】返佣',
align:"center",
dataIndex: 'shopUseerMoney'
},
{
title: '普通【间推】返佣',
align:"center",
dataIndex: 'givePriceTwo'
},
{
title: '金卡【间推】返佣',
align:"center",
dataIndex: 'goldGivePriceTwo'
},
{
title: '银卡【间推】返佣',
align:"center",
dataIndex: 'silverGivePriceTwo'
},
{
title: '钻石【间推】返佣',
align:"center",
dataIndex: 'diamondGivePriceTwo'
},
{
title: '合伙人【间推】返佣',
align:"center",
dataIndex: 'shopUseerMoneyTwo'
},
];
//查询数据
@ -88,6 +169,15 @@ export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '分类',
field: 'commonPidClassId',
component: 'JTreeSelect',
componentProps:{
dict:"common_pid_class,name,id",
pidValue:"0",
},
},
{
label: '标题',
field: 'title',
@ -113,21 +203,41 @@ export const formSchema: FormSchema[] = [
dictCode:"shop_type"
},
},
{
label: '原价',
field: 'oldPrice',
component: 'InputNumber',
},
{
label: '价格',
field: 'price',
component: 'InputNumber',
},
{
label: '价',
field: 'oldPrice',
label: '金卡价',
field: 'goldPrice',
component: 'InputNumber',
},
{
label: '银卡价',
field: 'silverPrice',
component: 'InputNumber',
},
{
label: '钻石价',
field: 'diamondPrice',
component: 'Input',
},
{
label: '会员价格',
field: 'vipPrice',
component: 'InputNumber',
},
{
label: '限购数量',
field: 'num',
component: 'InputNumber',
},
{
label: '标签',
field: 'skuIcon',
@ -138,14 +248,6 @@ export const formSchema: FormSchema[] = [
field: 'details',
component: 'JCodeEditor', //TODO String后缀暂未添加
},
{
label: '分类标识',
field: 'classId',
component: 'JSearchSelect',
componentProps:{
dict:"common_class,title,id"
},
},
{
label: '首页显示',
field: 'indexNo',
@ -154,18 +256,73 @@ export const formSchema: FormSchema[] = [
},
},
{
label: '金卡价',
field: 'goldPrice',
component: 'InputNumber',
label: '产品材质',
field: 'subText',
component: 'Input',
},
{
label: '银卡价',
field: 'silverPrice',
label: 'X销量',
field: 'payNum',
component: 'InputNumber',
},
{
label: '钻石价',
field: 'diamondPrice',
label: '说明',
field: 'subDetails',
component: 'Input',
},
{
label: '下单须知',
field: 'orderDetails',
component: 'InputTextArea',//TODO 注意string转换问题
},
{
label: '普通【直推】返佣',
field: 'givePrice',
component: 'InputNumber',
},
{
label: '金卡【直推】返佣',
field: 'goldGivePrice',
component: 'InputNumber',
},
{
label: '银卡【直推】返佣',
field: 'silverGivePrice',
component: 'InputNumber',
},
{
label: '钻石【直推】返佣',
field: 'diamondGivePrice',
component: 'InputNumber',
},
{
label: '合伙人【直推】返佣',
field: 'shopUseerMoney',
component: 'InputNumber',
},
{
label: '普通【间推】返佣',
field: 'givePriceTwo',
component: 'InputNumber',
},
{
label: '金卡【间推】返佣',
field: 'goldGivePriceTwo',
component: 'InputNumber',
},
{
label: '银卡【间推】返佣',
field: 'silverGivePriceTwo',
component: 'InputNumber',
},
{
label: '钻石【间推】返佣',
field: 'diamondGivePriceTwo',
component: 'InputNumber',
},
{
label: '合伙人【间推】返佣',
field: 'shopUseerMoneyTwo',
component: 'InputNumber',
},
];

+ 171
- 0
module-common/src/main/java/org/jeecg/modules/commonUser/controller/CommonUserController.java View File

@ -0,0 +1,171 @@
package org.jeecg.modules.commonUser.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.commonUser.entity.CommonUser;
import org.jeecg.modules.commonUser.service.ICommonUserService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 合伙人申请表
* @Author: jeecg-boot
* @Date: 2024-12-31
* @Version: V1.0
*/
@Api(tags="合伙人申请表")
@RestController
@RequestMapping("/commonUser/commonUser")
@Slf4j
public class CommonUserController extends JeecgController<CommonUser, ICommonUserService> {
@Autowired
private ICommonUserService commonUserService;
/**
* 分页列表查询
*
* @param commonUser
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "合伙人申请表-分页列表查询")
@ApiOperation(value="合伙人申请表-分页列表查询", notes="合伙人申请表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<CommonUser>> queryPageList(CommonUser commonUser,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<CommonUser> queryWrapper = QueryGenerator.initQueryWrapper(commonUser, req.getParameterMap());
Page<CommonUser> page = new Page<CommonUser>(pageNo, pageSize);
IPage<CommonUser> pageList = commonUserService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param commonUser
* @return
*/
@AutoLog(value = "合伙人申请表-添加")
@ApiOperation(value="合伙人申请表-添加", notes="合伙人申请表-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody CommonUser commonUser) {
commonUserService.save(commonUser);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param commonUser
* @return
*/
@AutoLog(value = "合伙人申请表-编辑")
@ApiOperation(value="合伙人申请表-编辑", notes="合伙人申请表-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody CommonUser commonUser) {
commonUserService.updateById(commonUser);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "合伙人申请表-通过id删除")
@ApiOperation(value="合伙人申请表-通过id删除", notes="合伙人申请表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
commonUserService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "合伙人申请表-批量删除")
@ApiOperation(value="合伙人申请表-批量删除", notes="合伙人申请表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.commonUserService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "合伙人申请表-通过id查询")
@ApiOperation(value="合伙人申请表-通过id查询", notes="合伙人申请表-通过id查询")
@GetMapping(value = "/queryById")
public Result<CommonUser> queryById(@RequestParam(name="id",required=true) String id) {
CommonUser commonUser = commonUserService.getById(id);
if(commonUser==null) {
return Result.error("未找到对应数据");
}
return Result.OK(commonUser);
}
/**
* 导出excel
*
* @param request
* @param commonUser
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, CommonUser commonUser) {
return super.exportXls(request, commonUser, CommonUser.class, "合伙人申请表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, CommonUser.class);
}
}

+ 74
- 0
module-common/src/main/java/org/jeecg/modules/commonUser/entity/CommonUser.java View File

@ -0,0 +1,74 @@
package org.jeecg.modules.commonUser.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 合伙人申请表
* @Author: jeecg-boot
* @Date: 2024-12-31
* @Version: V1.0
*/
@Data
@TableName("common_user")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="common_user对象", description="合伙人申请表")
public class CommonUser implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**用户标识*/
@Excel(name = "用户标识", width = 15)
@ApiModelProperty(value = "用户标识")
private java.lang.String userId;
/**姓名*/
@Excel(name = "姓名", width = 15)
@ApiModelProperty(value = "姓名")
private java.lang.String name;
/**电话*/
@Excel(name = "电话", width = 15)
@ApiModelProperty(value = "电话")
private java.lang.String phone;
/**地区*/
@Excel(name = "地区", width = 15)
@ApiModelProperty(value = "地区")
private java.lang.String address;
/**地址详情*/
@Excel(name = "地址详情", width = 15)
@ApiModelProperty(value = "地址详情")
private java.lang.String addressdetail;
/**审核状态*/
@Excel(name = "审核状态", width = 15)
@ApiModelProperty(value = "审核状态")
private java.lang.Integer state;
}

+ 17
- 0
module-common/src/main/java/org/jeecg/modules/commonUser/mapper/CommonUserMapper.java View File

@ -0,0 +1,17 @@
package org.jeecg.modules.commonUser.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.commonUser.entity.CommonUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 合伙人申请表
* @Author: jeecg-boot
* @Date: 2024-12-31
* @Version: V1.0
*/
public interface CommonUserMapper extends BaseMapper<CommonUser> {
}

+ 5
- 0
module-common/src/main/java/org/jeecg/modules/commonUser/mapper/xml/CommonUserMapper.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.commonUser.mapper.CommonUserMapper">
</mapper>

+ 14
- 0
module-common/src/main/java/org/jeecg/modules/commonUser/service/ICommonUserService.java View File

@ -0,0 +1,14 @@
package org.jeecg.modules.commonUser.service;
import org.jeecg.modules.commonUser.entity.CommonUser;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 合伙人申请表
* @Author: jeecg-boot
* @Date: 2024-12-31
* @Version: V1.0
*/
public interface ICommonUserService extends IService<CommonUser> {
}

+ 19
- 0
module-common/src/main/java/org/jeecg/modules/commonUser/service/impl/CommonUserServiceImpl.java View File

@ -0,0 +1,19 @@
package org.jeecg.modules.commonUser.service.impl;
import org.jeecg.modules.commonUser.entity.CommonUser;
import org.jeecg.modules.commonUser.mapper.CommonUserMapper;
import org.jeecg.modules.commonUser.service.ICommonUserService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 合伙人申请表
* @Author: jeecg-boot
* @Date: 2024-12-31
* @Version: V1.0
*/
@Service
public class CommonUserServiceImpl extends ServiceImpl<CommonUserMapper, CommonUser> implements ICommonUserService {
}

+ 201
- 0
module-common/src/main/java/org/jeecg/modules/commonUser/vue/CommonUserList.vue View File

@ -0,0 +1,201 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('合伙人申请表')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<common-user-modal ref="modalForm" @ok="modalFormOk"></common-user-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CommonUserModal from './modules/CommonUserModal'
export default {
name: 'CommonUserList',
mixins:[JeecgListMixin, mixinDevice],
components: {
CommonUserModal
},
data () {
return {
description: '合伙人申请表管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'用户标识',
align:"center",
dataIndex: 'userId'
},
{
title:'姓名',
align:"center",
dataIndex: 'name'
},
{
title:'电话',
align:"center",
dataIndex: 'phone'
},
{
title:'地区',
align:"center",
dataIndex: 'address'
},
{
title:'地址详情',
align:"center",
dataIndex: 'addressdetail'
},
{
title:'审核状态',
align:"center",
dataIndex: 'state'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/commonUser/commonUser/list",
delete: "/commonUser/commonUser/delete",
deleteBatch: "/commonUser/commonUser/deleteBatch",
exportXlsUrl: "/commonUser/commonUser/exportXls",
importExcelUrl: "commonUser/commonUser/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'userId',text:'用户标识',dictCode:''})
fieldList.push({type:'string',value:'name',text:'姓名',dictCode:''})
fieldList.push({type:'string',value:'phone',text:'电话',dictCode:''})
fieldList.push({type:'Text',value:'address',text:'地区',dictCode:''})
fieldList.push({type:'Text',value:'addressdetail',text:'地址详情',dictCode:''})
fieldList.push({type:'int',value:'state',text:'审核状态',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

+ 129
- 0
module-common/src/main/java/org/jeecg/modules/commonUser/vue/modules/CommonUserForm.vue View File

@ -0,0 +1,129 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="用户标识" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userId">
<a-input v-model="model.userId" placeholder="请输入用户标识" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
<a-input v-model="model.name" placeholder="请输入姓名" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="phone">
<a-input v-model="model.phone" placeholder="请输入电话" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="地区" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="address">
<a-input v-model="model.address" placeholder="请输入地区" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="地址详情" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="addressdetail">
<a-input v-model="model.addressdetail" placeholder="请输入地址详情" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="审核状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="state">
<a-input-number v-model="model.state" placeholder="请输入审核状态" style="width: 100%" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'CommonUserForm',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/commonUser/commonUser/add",
edit: "/commonUser/commonUser/edit",
queryById: "/commonUser/commonUser/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

+ 84
- 0
module-common/src/main/java/org/jeecg/modules/commonUser/vue/modules/CommonUserModal.Style#Drawer.vue View File

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<common-user-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></common-user-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
</div>
</a-drawer>
</template>
<script>
import CommonUserForm from './CommonUserForm'
export default {
name: 'CommonUserModal',
components: {
CommonUserForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

+ 60
- 0
module-common/src/main/java/org/jeecg/modules/commonUser/vue/modules/CommonUserModal.vue View File

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<common-user-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></common-user-form>
</j-modal>
</template>
<script>
import CommonUserForm from './CommonUserForm'
export default {
name: 'CommonUserModal',
components: {
CommonUserForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

+ 61
- 0
module-common/src/main/java/org/jeecg/modules/commonUser/vue3/CommonUser.api.ts View File

@ -0,0 +1,61 @@
import {defHttp} from '/@/utils/http/axios';
import {Modal} from 'ant-design-vue';
enum Api {
list = '/commonUser/commonUser/list',
save='/commonUser/commonUser/add',
edit='/commonUser/commonUser/edit',
deleteOne = '/commonUser/commonUser/delete',
deleteBatch = '/commonUser/commonUser/deleteBatch',
importExcel = '/commonUser/commonUser/importExcel',
exportXls = '/commonUser/commonUser/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
*
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
export const batchDelete = (params, handleSuccess) => {
Modal.confirm({
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}

+ 73
- 0
module-common/src/main/java/org/jeecg/modules/commonUser/vue3/CommonUser.data.ts View File

@ -0,0 +1,73 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '用户标识',
align:"center",
dataIndex: 'userId'
},
{
title: '姓名',
align:"center",
dataIndex: 'name'
},
{
title: '电话',
align:"center",
dataIndex: 'phone'
},
{
title: '地区',
align:"center",
dataIndex: 'address'
},
{
title: '地址详情',
align:"center",
dataIndex: 'addressdetail'
},
{
title: '审核状态',
align:"center",
dataIndex: 'state'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '用户标识',
field: 'userId',
component: 'Input',
},
{
label: '姓名',
field: 'name',
component: 'Input',
},
{
label: '电话',
field: 'phone',
component: 'Input',
},
{
label: '地区',
field: 'address',
component: 'Input',
},
{
label: '地址详情',
field: 'addressdetail',
component: 'Input',
},
{
label: '审核状态',
field: 'state',
component: 'InputNumber',
},
];

+ 162
- 0
module-common/src/main/java/org/jeecg/modules/commonUser/vue3/CommonUserList.vue View File

@ -0,0 +1,162 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="checkedKeys.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>批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<CommonUserModal @register="registerModal" @success="handleSuccess"></CommonUserModal>
</div>
</template>
<script lang="ts" name="commonUser-commonUser" setup>
import {ref, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import CommonUserModal from './components/CommonUserModal.vue'
import {columns, searchFormSchema} from './commonUser.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './commonUser.api';
const checkedKeys = ref<Array<string | number>>([]);
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '合伙人申请表',
api: list,
columns,
canResize:false,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
},
},
exportConfig: {
name:"合伙人申请表",
url: getExportUrl,
},
importConfig: {
url: getImportUrl
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
/**
* 新增事件
*/
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}, reload);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: checkedKeys.value}, reload);
}
/**
* 成功回调
*/
function handleSuccess() {
reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
}
]
}
</script>
<style scoped>
</style>

+ 58
- 0
module-common/src/main/java/org/jeecg/modules/commonUser/vue3/components/CommonUserModal.vue View File

@ -0,0 +1,58 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" @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 '../commonUser.data';
import {saveOrUpdate} from '../commonUser.api';
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
//
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({
labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
});
//
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)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} finally {
setModalProps({confirmLoading: false});
}
}
</script>
<style lang="less" scoped>
</style>

+ 171
- 0
module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/controller/PopularizeRecruitLogController.java View File

@ -0,0 +1,171 @@
package org.jeecg.modules.popularizeRecruitLog.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.popularizeRecruitLog.entity.PopularizeRecruitLog;
import org.jeecg.modules.popularizeRecruitLog.service.IPopularizeRecruitLogService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 招募报名日志
* @Author: jeecg-boot
* @Date: 2025-01-06
* @Version: V1.0
*/
@Api(tags="招募报名日志")
@RestController
@RequestMapping("/popularizeRecruitLog/popularizeRecruitLog")
@Slf4j
public class PopularizeRecruitLogController extends JeecgController<PopularizeRecruitLog, IPopularizeRecruitLogService> {
@Autowired
private IPopularizeRecruitLogService popularizeRecruitLogService;
/**
* 分页列表查询
*
* @param popularizeRecruitLog
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "招募报名日志-分页列表查询")
@ApiOperation(value="招募报名日志-分页列表查询", notes="招募报名日志-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<PopularizeRecruitLog>> queryPageList(PopularizeRecruitLog popularizeRecruitLog,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<PopularizeRecruitLog> queryWrapper = QueryGenerator.initQueryWrapper(popularizeRecruitLog, req.getParameterMap());
Page<PopularizeRecruitLog> page = new Page<PopularizeRecruitLog>(pageNo, pageSize);
IPage<PopularizeRecruitLog> pageList = popularizeRecruitLogService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param popularizeRecruitLog
* @return
*/
@AutoLog(value = "招募报名日志-添加")
@ApiOperation(value="招募报名日志-添加", notes="招募报名日志-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody PopularizeRecruitLog popularizeRecruitLog) {
popularizeRecruitLogService.save(popularizeRecruitLog);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param popularizeRecruitLog
* @return
*/
@AutoLog(value = "招募报名日志-编辑")
@ApiOperation(value="招募报名日志-编辑", notes="招募报名日志-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody PopularizeRecruitLog popularizeRecruitLog) {
popularizeRecruitLogService.updateById(popularizeRecruitLog);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "招募报名日志-通过id删除")
@ApiOperation(value="招募报名日志-通过id删除", notes="招募报名日志-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
popularizeRecruitLogService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "招募报名日志-批量删除")
@ApiOperation(value="招募报名日志-批量删除", notes="招募报名日志-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.popularizeRecruitLogService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "招募报名日志-通过id查询")
@ApiOperation(value="招募报名日志-通过id查询", notes="招募报名日志-通过id查询")
@GetMapping(value = "/queryById")
public Result<PopularizeRecruitLog> queryById(@RequestParam(name="id",required=true) String id) {
PopularizeRecruitLog popularizeRecruitLog = popularizeRecruitLogService.getById(id);
if(popularizeRecruitLog==null) {
return Result.error("未找到对应数据");
}
return Result.OK(popularizeRecruitLog);
}
/**
* 导出excel
*
* @param request
* @param popularizeRecruitLog
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, PopularizeRecruitLog popularizeRecruitLog) {
return super.exportXls(request, popularizeRecruitLog, PopularizeRecruitLog.class, "招募报名日志");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, PopularizeRecruitLog.class);
}
}

+ 66
- 0
module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/entity/PopularizeRecruitLog.java View File

@ -0,0 +1,66 @@
package org.jeecg.modules.popularizeRecruitLog.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 招募报名日志
* @Author: jeecg-boot
* @Date: 2025-01-06
* @Version: V1.0
*/
@Data
@TableName("popularize_recruit_log")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="popularize_recruit_log对象", description="招募报名日志")
public class PopularizeRecruitLog implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**用户信息*/
@Excel(name = "用户信息", width = 15)
@ApiModelProperty(value = "用户信息")
private java.lang.String userId;
/**姓名*/
@Excel(name = "姓名", width = 15)
@ApiModelProperty(value = "姓名")
private java.lang.String name;
/**电话*/
@Excel(name = "电话", width = 15)
@ApiModelProperty(value = "电话")
private java.lang.String phone;
/**头像*/
@Excel(name = "头像", width = 15)
@ApiModelProperty(value = "头像")
private java.lang.String headImage;
}

+ 17
- 0
module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/mapper/PopularizeRecruitLogMapper.java View File

@ -0,0 +1,17 @@
package org.jeecg.modules.popularizeRecruitLog.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.popularizeRecruitLog.entity.PopularizeRecruitLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 招募报名日志
* @Author: jeecg-boot
* @Date: 2025-01-06
* @Version: V1.0
*/
public interface PopularizeRecruitLogMapper extends BaseMapper<PopularizeRecruitLog> {
}

+ 5
- 0
module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/mapper/xml/PopularizeRecruitLogMapper.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.popularizeRecruitLog.mapper.PopularizeRecruitLogMapper">
</mapper>

+ 14
- 0
module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/service/IPopularizeRecruitLogService.java View File

@ -0,0 +1,14 @@
package org.jeecg.modules.popularizeRecruitLog.service;
import org.jeecg.modules.popularizeRecruitLog.entity.PopularizeRecruitLog;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 招募报名日志
* @Author: jeecg-boot
* @Date: 2025-01-06
* @Version: V1.0
*/
public interface IPopularizeRecruitLogService extends IService<PopularizeRecruitLog> {
}

+ 19
- 0
module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/service/impl/PopularizeRecruitLogServiceImpl.java View File

@ -0,0 +1,19 @@
package org.jeecg.modules.popularizeRecruitLog.service.impl;
import org.jeecg.modules.popularizeRecruitLog.entity.PopularizeRecruitLog;
import org.jeecg.modules.popularizeRecruitLog.mapper.PopularizeRecruitLogMapper;
import org.jeecg.modules.popularizeRecruitLog.service.IPopularizeRecruitLogService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 招募报名日志
* @Author: jeecg-boot
* @Date: 2025-01-06
* @Version: V1.0
*/
@Service
public class PopularizeRecruitLogServiceImpl extends ServiceImpl<PopularizeRecruitLogMapper, PopularizeRecruitLog> implements IPopularizeRecruitLogService {
}

+ 189
- 0
module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/vue/PopularizeRecruitLogList.vue View File

@ -0,0 +1,189 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('招募报名日志')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text,record">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<popularize-recruit-log-modal ref="modalForm" @ok="modalFormOk"></popularize-recruit-log-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import PopularizeRecruitLogModal from './modules/PopularizeRecruitLogModal'
export default {
name: 'PopularizeRecruitLogList',
mixins:[JeecgListMixin, mixinDevice],
components: {
PopularizeRecruitLogModal
},
data () {
return {
description: '招募报名日志管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'用户信息',
align:"center",
dataIndex: 'userId'
},
{
title:'姓名',
align:"center",
dataIndex: 'name'
},
{
title:'电话',
align:"center",
dataIndex: 'phone'
},
{
title:'头像',
align:"center",
dataIndex: 'headImage'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/popularizeRecruitLog/popularizeRecruitLog/list",
delete: "/popularizeRecruitLog/popularizeRecruitLog/delete",
deleteBatch: "/popularizeRecruitLog/popularizeRecruitLog/deleteBatch",
exportXlsUrl: "/popularizeRecruitLog/popularizeRecruitLog/exportXls",
importExcelUrl: "popularizeRecruitLog/popularizeRecruitLog/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'userId',text:'用户信息',dictCode:''})
fieldList.push({type:'string',value:'name',text:'姓名',dictCode:''})
fieldList.push({type:'string',value:'phone',text:'电话',dictCode:''})
fieldList.push({type:'Text',value:'headImage',text:'头像',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

+ 119
- 0
module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/vue/modules/PopularizeRecruitLogForm.vue View File

@ -0,0 +1,119 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="用户信息" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userId">
<a-input v-model="model.userId" placeholder="请输入用户信息" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
<a-input v-model="model.name" placeholder="请输入姓名" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="phone">
<a-input v-model="model.phone" placeholder="请输入电话" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="头像" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="headImage">
<a-input v-model="model.headImage" placeholder="请输入头像" ></a-input>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'PopularizeRecruitLogForm',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/popularizeRecruitLog/popularizeRecruitLog/add",
edit: "/popularizeRecruitLog/popularizeRecruitLog/edit",
queryById: "/popularizeRecruitLog/popularizeRecruitLog/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
</script>

+ 84
- 0
module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/vue/modules/PopularizeRecruitLogModal.Style#Drawer.vue View File

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<popularize-recruit-log-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></popularize-recruit-log-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
</div>
</a-drawer>
</template>
<script>
import PopularizeRecruitLogForm from './PopularizeRecruitLogForm'
export default {
name: 'PopularizeRecruitLogModal',
components: {
PopularizeRecruitLogForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>

+ 60
- 0
module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/vue/modules/PopularizeRecruitLogModal.vue View File

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<popularize-recruit-log-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></popularize-recruit-log-form>
</j-modal>
</template>
<script>
import PopularizeRecruitLogForm from './PopularizeRecruitLogForm'
export default {
name: 'PopularizeRecruitLogModal',
components: {
PopularizeRecruitLogForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

+ 61
- 0
module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/vue3/PopularizeRecruitLog.api.ts View File

@ -0,0 +1,61 @@
import {defHttp} from '/@/utils/http/axios';
import {Modal} from 'ant-design-vue';
enum Api {
list = '/popularizeRecruitLog/popularizeRecruitLog/list',
save='/popularizeRecruitLog/popularizeRecruitLog/add',
edit='/popularizeRecruitLog/popularizeRecruitLog/edit',
deleteOne = '/popularizeRecruitLog/popularizeRecruitLog/delete',
deleteBatch = '/popularizeRecruitLog/popularizeRecruitLog/deleteBatch',
importExcel = '/popularizeRecruitLog/popularizeRecruitLog/importExcel',
exportXls = '/popularizeRecruitLog/popularizeRecruitLog/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
*
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
export const batchDelete = (params, handleSuccess) => {
Modal.confirm({
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}

+ 53
- 0
module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/vue3/PopularizeRecruitLog.data.ts View File

@ -0,0 +1,53 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '用户信息',
align:"center",
dataIndex: 'userId'
},
{
title: '姓名',
align:"center",
dataIndex: 'name'
},
{
title: '电话',
align:"center",
dataIndex: 'phone'
},
{
title: '头像',
align:"center",
dataIndex: 'headImage'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '用户信息',
field: 'userId',
component: 'Input',
},
{
label: '姓名',
field: 'name',
component: 'Input',
},
{
label: '电话',
field: 'phone',
component: 'Input',
},
{
label: '头像',
field: 'headImage',
component: 'Input',
},
];

+ 162
- 0
module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/vue3/PopularizeRecruitLogList.vue View File

@ -0,0 +1,162 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="checkedKeys.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>批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<PopularizeRecruitLogModal @register="registerModal" @success="handleSuccess"></PopularizeRecruitLogModal>
</div>
</template>
<script lang="ts" name="popularizeRecruitLog-popularizeRecruitLog" setup>
import {ref, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import PopularizeRecruitLogModal from './components/PopularizeRecruitLogModal.vue'
import {columns, searchFormSchema} from './popularizeRecruitLog.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './popularizeRecruitLog.api';
const checkedKeys = ref<Array<string | number>>([]);
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '招募报名日志',
api: list,
columns,
canResize:false,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
},
},
exportConfig: {
name:"招募报名日志",
url: getExportUrl,
},
importConfig: {
url: getImportUrl
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
/**
* 新增事件
*/
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}, reload);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: checkedKeys.value}, reload);
}
/**
* 成功回调
*/
function handleSuccess() {
reload();
}
/**
* 操作栏
*/
function getTableAction(record){
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
}
]
}
</script>
<style scoped>
</style>

+ 58
- 0
module-common/src/main/java/org/jeecg/modules/popularizeRecruitLog/vue3/components/PopularizeRecruitLogModal.vue View File

@ -0,0 +1,58 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" @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 '../popularizeRecruitLog.data';
import {saveOrUpdate} from '../popularizeRecruitLog.api';
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
//
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({
labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
});
//
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)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} finally {
setModalProps({confirmLoading: false});
}
}
</script>
<style lang="less" scoped>
</style>

+ 7
- 7
module-system/src/main/resources/pay_weixin.properties View File

@ -1,10 +1,10 @@
pay.mchId=1700534180
pay.appId=wx0839bc52e7849c13
pay.mchKey=9bde2770a74c2a460592de2d451ce05f
pay.mchId=1702891319
pay.appId=wx28679cb649907e7e
pay.mchKey=6b5fbf1439176f7b78209bd237dfdf7e
pay.keyPath=classpath:apiclient_cert.pem
pay.notifyUrl=https://admin.szqwdgidm.com/rice-admin/rice_index/payNotify
pay.notifyUrlDev=https://admin.szqwdgidm.com/rice-admin/rice_index/payNotify
pay.notifyOneUrl=https://admin.szqwdgidm.com/rice-admin/rice_index/payNotify
pay.notifyUrlOneDev=https://admin.szqwdgidm.com/rice-admin/rice_index/payNotify
pay.notifyUrl=https://jewelry-admin.hhlm1688.com/jewelry-admin/index_common/payNotify
pay.notifyUrlDev=https://jewelry-admin.hhlm1688.com/jewelry-admin/index_common/payNotify
pay.notifyOneUrl=https://jewelry-admin.hhlm1688.com/jewelry-admin/index_common/payNotify
pay.notifyUrlOneDev=https://jewelry-admin.hhlm1688.com/jewelry-admin/index_common/payNotify

Loading…
Cancel
Save