Browse Source

提交信息

master
主管理员 3 months ago
parent
commit
215dcd2758
67 changed files with 6756 additions and 110 deletions
  1. +3
    -1
      .idea/compiler.xml
  2. +1
    -1
      admin-pc/.env.development
  3. +1
    -1
      admin-pc/.env.production
  4. +4
    -4
      module-base/base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java
  5. +17
    -1
      module-common/pom.xml
  6. +1122
    -0
      module-common/src/main/java/org/jeecg/api/bean/HttpClientUtil.java
  7. +20
    -0
      module-common/src/main/java/org/jeecg/api/bean/PageBean.java
  8. +14
    -0
      module-common/src/main/java/org/jeecg/api/bean/WxQrCodeVo.java
  9. +217
    -0
      module-common/src/main/java/org/jeecg/api/controller/AppletIndexController.java
  10. +156
    -0
      module-common/src/main/java/org/jeecg/api/controller/AppletInfoController.java
  11. +7
    -0
      module-common/src/main/java/org/jeecg/api/controller/AppletLoginController.java
  12. +4
    -4
      module-common/src/main/java/org/jeecg/api/controller/AppletMyInfoController.java
  13. +131
    -0
      module-common/src/main/java/org/jeecg/api/service/AppletIndexService.java
  14. +6
    -6
      module-common/src/main/java/org/jeecg/api/service/AppletLoginService.java
  15. +1500
    -0
      module-common/src/main/java/org/jeecg/api/service/impl/AppletIndexServiceImpl.java
  16. +71
    -0
      module-common/src/main/java/org/jeecg/api/service/impl/AppletLoginServiceImpl.java
  17. +171
    -0
      module-common/src/main/java/org/jeecg/modules/commonCoupon/controller/CommonCouponController.java
  18. +78
    -0
      module-common/src/main/java/org/jeecg/modules/commonCoupon/entity/CommonCoupon.java
  19. +17
    -0
      module-common/src/main/java/org/jeecg/modules/commonCoupon/mapper/CommonCouponMapper.java
  20. +5
    -0
      module-common/src/main/java/org/jeecg/modules/commonCoupon/mapper/xml/CommonCouponMapper.xml
  21. +14
    -0
      module-common/src/main/java/org/jeecg/modules/commonCoupon/service/ICommonCouponService.java
  22. +19
    -0
      module-common/src/main/java/org/jeecg/modules/commonCoupon/service/impl/CommonCouponServiceImpl.java
  23. +207
    -0
      module-common/src/main/java/org/jeecg/modules/commonCoupon/vue/CommonCouponList.vue
  24. +134
    -0
      module-common/src/main/java/org/jeecg/modules/commonCoupon/vue/modules/CommonCouponForm.vue
  25. +84
    -0
      module-common/src/main/java/org/jeecg/modules/commonCoupon/vue/modules/CommonCouponModal.Style#Drawer.vue
  26. +60
    -0
      module-common/src/main/java/org/jeecg/modules/commonCoupon/vue/modules/CommonCouponModal.vue
  27. +61
    -0
      module-common/src/main/java/org/jeecg/modules/commonCoupon/vue3/CommonCoupon.api.ts
  28. +83
    -0
      module-common/src/main/java/org/jeecg/modules/commonCoupon/vue3/CommonCoupon.data.ts
  29. +162
    -0
      module-common/src/main/java/org/jeecg/modules/commonCoupon/vue3/CommonCouponList.vue
  30. +58
    -0
      module-common/src/main/java/org/jeecg/modules/commonCoupon/vue3/components/CommonCouponModal.vue
  31. +171
    -0
      module-common/src/main/java/org/jeecg/modules/commonIcon/controller/CommonIconController.java
  32. +74
    -0
      module-common/src/main/java/org/jeecg/modules/commonIcon/entity/CommonIcon.java
  33. +17
    -0
      module-common/src/main/java/org/jeecg/modules/commonIcon/mapper/CommonIconMapper.java
  34. +5
    -0
      module-common/src/main/java/org/jeecg/modules/commonIcon/mapper/xml/CommonIconMapper.xml
  35. +14
    -0
      module-common/src/main/java/org/jeecg/modules/commonIcon/service/ICommonIconService.java
  36. +19
    -0
      module-common/src/main/java/org/jeecg/modules/commonIcon/service/impl/CommonIconServiceImpl.java
  37. +203
    -0
      module-common/src/main/java/org/jeecg/modules/commonIcon/vue/CommonIconList.vue
  38. +129
    -0
      module-common/src/main/java/org/jeecg/modules/commonIcon/vue/modules/CommonIconForm.vue
  39. +84
    -0
      module-common/src/main/java/org/jeecg/modules/commonIcon/vue/modules/CommonIconModal.Style#Drawer.vue
  40. +60
    -0
      module-common/src/main/java/org/jeecg/modules/commonIcon/vue/modules/CommonIconModal.vue
  41. +61
    -0
      module-common/src/main/java/org/jeecg/modules/commonIcon/vue3/CommonIcon.api.ts
  42. +77
    -0
      module-common/src/main/java/org/jeecg/modules/commonIcon/vue3/CommonIcon.data.ts
  43. +162
    -0
      module-common/src/main/java/org/jeecg/modules/commonIcon/vue3/CommonIconList.vue
  44. +58
    -0
      module-common/src/main/java/org/jeecg/modules/commonIcon/vue3/components/CommonIconModal.vue
  45. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonShop/controller/CommonShopController.java
  46. +13
    -1
      module-common/src/main/java/org/jeecg/modules/commonShop/entity/CommonShop.java
  47. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonShop/mapper/CommonShopMapper.java
  48. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonShop/service/ICommonShopService.java
  49. +1
    -1
      module-common/src/main/java/org/jeecg/modules/commonShop/service/impl/CommonShopServiceImpl.java
  50. +16
    -22
      module-common/src/main/java/org/jeecg/modules/commonShop/vue/CommonShopList.vue
  51. +14
    -19
      module-common/src/main/java/org/jeecg/modules/commonShop/vue/modules/CommonShopForm.vue
  52. +30
    -40
      module-common/src/main/java/org/jeecg/modules/commonShop/vue3/CommonShop.data.ts
  53. +171
    -0
      module-common/src/main/java/org/jeecg/modules/commonVip/controller/CommonVipController.java
  54. +73
    -0
      module-common/src/main/java/org/jeecg/modules/commonVip/entity/CommonVip.java
  55. +17
    -0
      module-common/src/main/java/org/jeecg/modules/commonVip/mapper/CommonVipMapper.java
  56. +5
    -0
      module-common/src/main/java/org/jeecg/modules/commonVip/mapper/xml/CommonVipMapper.xml
  57. +14
    -0
      module-common/src/main/java/org/jeecg/modules/commonVip/service/ICommonVipService.java
  58. +19
    -0
      module-common/src/main/java/org/jeecg/modules/commonVip/service/impl/CommonVipServiceImpl.java
  59. +197
    -0
      module-common/src/main/java/org/jeecg/modules/commonVip/vue/CommonVipList.vue
  60. +124
    -0
      module-common/src/main/java/org/jeecg/modules/commonVip/vue/modules/CommonVipForm.vue
  61. +84
    -0
      module-common/src/main/java/org/jeecg/modules/commonVip/vue/modules/CommonVipModal.Style#Drawer.vue
  62. +60
    -0
      module-common/src/main/java/org/jeecg/modules/commonVip/vue/modules/CommonVipModal.vue
  63. +61
    -0
      module-common/src/main/java/org/jeecg/modules/commonVip/vue3/CommonVip.api.ts
  64. +67
    -0
      module-common/src/main/java/org/jeecg/modules/commonVip/vue3/CommonVip.data.ts
  65. +162
    -0
      module-common/src/main/java/org/jeecg/modules/commonVip/vue3/CommonVipList.vue
  66. +58
    -0
      module-common/src/main/java/org/jeecg/modules/commonVip/vue3/components/CommonVipModal.vue
  67. +6
    -6
      module-system/src/main/resources/application-dev.yml

+ 3
- 1
.idea/compiler.xml View File

@ -12,10 +12,12 @@
<module name="module-pay" />
<module name="module-common" />
<module name="base-core" />
<module name="applet-rice-api" />
<module name="jeecg-system-local-api" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="applet-rice-api" target="1.8" />
</bytecodeTargetLevel>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">


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

@ -1,5 +1,5 @@
NODE_ENV=development
VUE_APP_API_BASE_URL=http://localhost:8000/jewelry-admin/
VUE_APP_API_BASE_URL=http://localhost:8001/jewelry-admin/
VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas
VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview


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

@ -1,4 +1,4 @@
NODE_ENV=production
VUE_APP_API_BASE_URL=http://localhost:8000/jewelry-admin/
VUE_APP_API_BASE_URL=http://localhost:8001/jewelry-admin/
VUE_APP_CAS_BASE_URL=http://localhost:8888/cas
VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview

+ 4
- 4
module-base/base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java View File

@ -79,10 +79,10 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/config_common/**", "anon");
//三只青蛙
filterChainDefinitionMap.put("/rice_vip/**", "anon");
filterChainDefinitionMap.put("/rice_info/**", "anon");
filterChainDefinitionMap.put("/rice_index/**", "anon");
//珠宝项目
filterChainDefinitionMap.put("/index_common/**", "anon");
filterChainDefinitionMap.put("/info_common/**", "anon");


+ 17
- 1
module-common/pom.xml View File

@ -38,6 +38,22 @@
<groupId>org.jeecgframework.boot</groupId>
<artifactId>base-core</artifactId>
</dependency>
</dependencies>
<dependency>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
<version>0.0.20131108.vaadin1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jeecgframework.boot</groupId>
<artifactId>module-pay</artifactId>
<version>3.2.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
</dependency>
</dependencies>
</project>

+ 1122
- 0
module-common/src/main/java/org/jeecg/api/bean/HttpClientUtil.java
File diff suppressed because it is too large
View File


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

@ -0,0 +1,20 @@
package org.jeecg.api.bean;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class PageBean {
/**显示条数*/
@ApiModelProperty(value = "显示条数" )
private Integer pageSize;
/**当前页*/
@ApiModelProperty(value = "当前页" )
private Integer pageNo;
public PageBean() {
this.pageNo = 1;
this.pageSize = 1000;
}
}

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

@ -0,0 +1,14 @@
package org.jeecg.api.bean;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class WxQrCodeVo {
/**图片地址*/
@ApiModelProperty(value = "图片地址")
private String url;
@ApiModelProperty(value = "加油站名称")
private String name;
}

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

@ -0,0 +1,217 @@
package org.jeecg.api.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* 集中所有登录接口
*/
@Api(tags="珠宝项目-首页接口")
@RestController
@RequestMapping("/index_common")
@Slf4j
public class AppletIndexController {
@Resource
private AppletIndexService apiRiceService;
//获取首页轮播图
@ApiOperation(value="获取首页轮播图", notes="获取首页轮播图")
@GetMapping(value = "/getRiceBanner")
public Result<?> getRiceBanner() {
return apiRiceService.getRiceBanner();
}
//获取首页公告列表
@ApiOperation(value="获取首页公告列表", notes="获取首页公告列表")
@GetMapping(value = "/getRiceNoticeList")
public Result<?> getRiceNoticeList() {
return apiRiceService.getRiceNoticeList();
}
//获取会员信息
@ApiOperation(value="获取会员信息", notes="获取会员信息")
@GetMapping(value = "/getVipInfoList")
public Result<?> getVipInfoList(){
return apiRiceService.getVipInfoList();
}
//获取首页跳转图标
@ApiOperation(value="获取首页跳转图标", notes="获取首页跳转图标")
@GetMapping(value = "/getRiceIconList")
public Result<?> getRiceIconList() {
return apiRiceService.getRiceIconList();
}
//获取首页广告列表
@ApiOperation(value="获取首页广告列表", notes="获取首页广告列表")
@GetMapping(value = "/getRiceAdList")
public Result<?> getRiceAdList(PageBean pageBean) {
return apiRiceService.getRiceAdList(pageBean);
}
//获取分类分页商品列表接口
@ApiOperation(value="获取分类分页商品列表接口", notes="获取分类分页商品列表接口")
@GetMapping(value = "/getClassShopPageList")
public Result<?> getClassShopPageList(PageBean pageBean, String classId) {
return apiRiceService.getClassShopPageList(pageBean,classId);
}
//获取首页商品详情
@ApiOperation(value="获取首页商品详情", notes="获取首页商品详情")
@GetMapping(value = "/getRiceProductDetail")
public Result<?> getRiceProductDetail(String id) {
return apiRiceService.getRiceProductDetail(id);
}
//获取首页新闻列表
@ApiOperation(value="获取首页新闻列表", notes="获取首页新闻列表")
@GetMapping(value = "/getRiceNewsList")
public Result<?> getRiceNewsList() {
return apiRiceService.getRiceNewsList();
}
//加入购物车 传入token shopId num
@ApiOperation(value="加入购物车 传入token shopId num", notes="加入购物车 传入token shopId num")
@GetMapping(value = "/addCart")
public Result<?> addCart(@RequestHeader("X-Access-Token") String token, String shopId, Integer num){
return apiRiceService.addCart(token,shopId,num);
}
//删除购物车信息
@ApiOperation(value="删除购物车信息", notes="删除购物车信息")
@DeleteMapping(value = "/deleteCart")
public Result<?> deleteCart(@RequestHeader("X-Access-Token") String token,String ids){
return apiRiceService.deleteCart(token,ids);
}
//修改购物车信息数量
@ApiOperation(value="修改购物车信息数量", notes="修改购物车信息数量")
@PostMapping(value = "/updateCartNum")
public Result<?> updateCartNum(@RequestHeader("X-Access-Token") String token,String id,Integer num){
return apiRiceService.updateCartNum(token,id,num);
}
//查询分类接口
@ApiOperation(value="查询分类接口", notes="查询分类接口")
@GetMapping(value = "/getCategoryList")
private Result<?> getCategoryList(){
return apiRiceService.getCategoryList();
}
//创建订单
@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);
}
//创建订单
@ApiOperation(value="创建订单-再次支付", notes="创建订单-再次支付")
@GetMapping(value = "/createOrderTwo")
public Result<?> createOrderTwo(@RequestHeader("X-Access-Token") String token,String orderId) {
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);
}
@PostMapping("/payNotify")
public Object payNotify(@RequestBody String requestBody){
return apiRiceService.payNotify(requestBody);
}
//确认收货
@ApiOperation(value="确认收货", notes="确认收货")
@GetMapping(value = "/confirmOrder")
public Result<?> confirmOrder(@RequestHeader("X-Access-Token") String token,String orderId) {
return apiRiceService.confirmOrder(token,orderId);
}
}

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

@ -0,0 +1,156 @@
package org.jeecg.api.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.commonAddress.entity.CommonAddress;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.math.BigDecimal;
@Api(tags="珠宝项目-个人中心接口")
@RestController
@RequestMapping("/info_common")
@Slf4j
public class AppletInfoController {
@Resource
private AppletIndexService apiRiceService;
//获取优惠券信息
@ApiOperation(value="获取优惠券信息", notes="获取优惠券信息")
@GetMapping(value = "/getRiceCouponList")
public Result<?> getRiceCouponList(@RequestHeader("X-Access-Token") String token,PageBean pageBean) {
return apiRiceService.getRiceCouponList(token,pageBean);
}
//获取流水记录带分页
@ApiOperation(value="获取流水记录带分页", notes="获取流水记录带分页")
@GetMapping(value = "/getWaterPageList")
public Result<?> getWaterPageList(@RequestHeader("X-Access-Token") String token, PageBean pageBean){
return apiRiceService.getWaterPageList(token,pageBean);
}
//获取订单列表带分页
@ApiOperation(value="获取订单列表带分页", notes="获取订单列表带分页")
@GetMapping(value = "/getOrderPageList")
public Result<?> getOrderPageList(@RequestHeader("X-Access-Token") String token, PageBean pageBean,Integer state){
return apiRiceService.getOrderPageList(token,pageBean,state);
}
//获取订单详情
@ApiOperation(value="获取订单详情", notes="获取订单详情")
@GetMapping(value = "/getOrderDetail")
public Result<?> getOrderDetail(@RequestHeader("X-Access-Token") String token,String id){
return apiRiceService.getOrderDetail(token,id);
}
//获取地址列表带分页
@ApiOperation(value="获取地址列表带分页", notes="获取地址列表带分页")
@GetMapping(value = "/getAddressPageList")
public Result<?> getAddressPageList(@RequestHeader("X-Access-Token") String token,PageBean pageBean){
return apiRiceService.getAddressPageList(token,pageBean);
}
//获取粉丝列表带分页
@ApiOperation(value="获取粉丝列表带分页", notes="获取粉丝列表带分页")
@GetMapping(value = "/getFansPageList")
public Result<?> getFansPageList(@RequestHeader("X-Access-Token") String token,PageBean pageBean,String title){
return apiRiceService.getFansPageList(token,pageBean,title);
}
//获取个人邀请码
@ApiOperation(value="获取个人邀请码", notes="获取个人邀请码")
@GetMapping(value = "/getInviteCode")
public Result<?> getInviteCode(@RequestHeader("X-Access-Token") String token){
return apiRiceService.getInviteCode(token);
}
//获取购物车信息列表带分页
@ApiOperation(value="获取购物车信息列表带分页", notes="获取购物车信息列表带分页")
@GetMapping(value = "/getCartPageList")
public Result<?> getCartPageList(@RequestHeader("X-Access-Token") String token,PageBean pageBean){
return apiRiceService.getCartPageList(token,pageBean);
}
//获取相关介绍
@ApiOperation(value="获取相关介绍", notes="获取相关介绍")
@GetMapping(value = "/getInfoIntroduce")
public Result<?> getInfoIntroduce(String type){
return apiRiceService.getInfoIntroduce(type);
}
//增加或修改地址信息
@ApiOperation(value="增加或修改地址信息", notes="增加或修改地址信息")
@PostMapping(value = "/addOrUpdateAddress")
public Result<?> addOrUpdateAddress(@RequestHeader("X-Access-Token") String token, CommonAddress commonAddress){
return apiRiceService.addOrUpdateAddress(token,commonAddress);
}
//删除地址
@ApiOperation(value="删除地址", notes="删除地址")
@GetMapping(value = "/deleteAddress")
public Result<?> deleteAddress(@RequestHeader("X-Access-Token") String token,String id){
return apiRiceService.deleteAddress(token,id);
}
//修改默认地址
@ApiOperation(value="修改默认地址", notes="修改默认地址")
@GetMapping(value = "/updateDefaultAddress")
public Result<?> updateDefaultAddress(@RequestHeader("X-Access-Token") String token,String id){
return apiRiceService.updateDefaultAddress(token,id);
}
//查询个人信息相关
@ApiOperation(value="查询个人信息相关", notes="查询个人信息相关")
@GetMapping(value = "/getRiceInfo")
public Result<?> getRiceInfo(String token){
return apiRiceService.getRiceInfo(token);
}
//充值
@ApiOperation(value="充值", notes="充值")
@GetMapping(value = "/recharge")
public Result<?> recharge(@RequestHeader("X-Access-Token") String token, BigDecimal money){
return apiRiceService.recharge(token,money);
}
//提现
@ApiOperation(value="提现", notes="提现")
@GetMapping(value = "/withdraw")
public Result<?> withdraw(@RequestHeader("X-Access-Token") String token,BigDecimal money,String bankName,String bankNo){
return apiRiceService.withdraw(token,money,bankName,bankNo);
}
}

+ 7
- 0
module-common/src/main/java/org/jeecg/api/controller/AppletLoginController.java View File

@ -34,6 +34,13 @@ public class AppletLoginController {
//绑定手机号码
@ApiOperation(value="绑定手机号码", notes="绑定手机号码")
@GetMapping(value = "/bindPhone")
public Result<Object> bindPhone(String phoneCode){
return appletLoginService.bindPhone(phoneCode);
}


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

@ -22,18 +22,18 @@ public class AppletMyInfoController {
//权限验证
@Resource
private ShiroRealm shiroRealm;
//修改个人信息
@PostMapping(value = "/updateInfo")
@ApiOperation(value="修改个人信息", notes="修改个人信息")
public Result<?> updateInfo(@RequestHeader("X-Access-Token") String token, String nickName, String avatarUrl){
public Result<?> updateInfo(@RequestHeader("X-Access-Token") String token, String nickName, String avatarUrl,String phone){
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
HanHaiMember member = new HanHaiMember();
member.setId(hanHaiMember.getId());
member.setNickName(nickName);
member.setHeadImage(avatarUrl);
hanHaiMemberService.updateById(member);
return Result.ok("修改成功");
member.setPhone(phone);
hanHaiMemberService.updateById(member);
return Result.ok("修改成功");
}
//获取个人信息


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

@ -0,0 +1,131 @@
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.springframework.web.bind.annotation.RequestHeader;
import java.math.BigDecimal;
public interface AppletIndexService {
//获取首页轮播图
Result<?> getRiceBanner();
//获取首页公告列表
Result<?> getRiceNoticeList();
//获取首页跳转图标
Result<?> getRiceIconList();
//获取会员信息
Result<?> getVipInfoList();
//获取首页广告列表
Result<?> getRiceAdList(PageBean pageBean);
//获取首页商品详情
Result<?> getRiceProductDetail(String id);
//获取首页新闻列表
Result<?> getRiceNewsList();
//创建订单
Result<?> createOrder(String token,String shopId,Integer num,String addressId);
//再次支付
Result<?> createOrderTwo(String token,String orderId);
//商城-立即购买多少商品
Result<?> createSumOrder(String token,String list,String addressId);
//商城-加入购物车之后一次下多个订单 - 再次下单
Result<?> createSumOrderAgain(String token,String orderId);
//商城-支付回调
Object payNotify(String requestBody);
//加入购物车
Result<?> addCart(String token,String shopId,Integer num);
//删除购物车信息
Result<?> deleteCart(String token,String ids);
//修改购物车信息数量
Result<?> updateCartNum(String token,String id,Integer num);
Result<?> getClassShopPageList(PageBean pageBean, String classId);
//获取优惠券信息列表
Result<?> getRiceCouponList(String token, PageBean pageBean);
//获取流水记录带分页
Result<?> getWaterPageList(String token,PageBean pageBean);
//获取订单列表带分页
Result<?> getOrderPageList(String token, PageBean pageBean,Integer state);
//获取订单详情
Result<?> getOrderDetail(String token, String id);
//获取粉丝列表带分页
Result<?> getFansPageList(String token,PageBean pageBean,String title);
//获取购物车信息列表带分页
Result<?> getCartPageList(String token,PageBean pageBean);
//获取地址列表带分页
Result<?> getAddressPageList(String token,PageBean pageBean);
//获取个人邀请码
Result<?> getInviteCode(String token);
//获取相关介绍
Result<?> getInfoIntroduce(String type);
//查询分类的接口
Result<?> getCategoryList();
//增加或者修改地址
Result<?> addOrUpdateAddress(String token, CommonAddress commonAddress);
//删除地址
Result<?> deleteAddress(String token,String id);
//修改默认地址
Result<?> updateDefaultAddress(String token,String id);
//查询个人信息相关
Result<?> getRiceInfo(String token);
//充值
Result<?> recharge(String token, BigDecimal money);
//提现
Result<?> withdraw(String token,BigDecimal money,String bankName,String bankNo);
//确认收货
Result<?> confirmOrder(String token,String orderId);
}

+ 6
- 6
module-common/src/main/java/org/jeecg/api/service/AppletLoginService.java View File

@ -18,10 +18,10 @@ public interface AppletLoginService {
Result<Object> appletLogin(LoginReq loginReq);
// /**
// * 微信小程序登录绑定手机号码接口
// * @param loginReq
// * @return
// */
// Result<Object> bindPhone(LoginReq loginReq);
/**
* 微信小程序登录绑定手机号码接口
* @param code
* @return
*/
Result<Object> bindPhone(String code);
}

+ 1500
- 0
module-common/src/main/java/org/jeecg/api/service/impl/AppletIndexServiceImpl.java
File diff suppressed because it is too large
View File


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

@ -18,6 +18,12 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
@ -116,6 +122,71 @@ public class AppletLoginServiceImpl implements AppletLoginService {
}
private static final String TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s";
public String getAccessToken() throws Exception {
String requestUrl = String.format(TOKEN_URL, mpAppId, mpAppSecret);
URL url = new URL(requestUrl);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
try (BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), "UTF-8"))) {
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
org.json.JSONObject jsonResponse = new org.json.JSONObject(response.toString());
return jsonResponse.getString("access_token");
}
}
private static final String API_URL = "https://api.weixin.qq.com/wxa/business/getuserphonenumber";
public String getPhoneNumber(String code) throws Exception {
URL url = new URL(API_URL + "?access_token=" + this.getAccessToken());
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/json; utf-8");
conn.setRequestProperty("Accept", "application/json");
conn.setDoOutput(true);
JSONObject jsonInput = new JSONObject();
jsonInput.put("code", code);
try (DataOutputStream os = new DataOutputStream(conn.getOutputStream())) {
byte[] input = jsonInput.toString().getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
try (BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8))) {
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
//获取手机号码
return response.toString();
}
}
@Transactional(rollbackFor = Exception.class)
@Override
public Result<Object> bindPhone(String code) {
try {
String phoneNumber = this.getPhoneNumber(code);
return Result.OK(phoneNumber);
}catch (Exception e){
return Result.error(e.getMessage());
}
}
// /**
// * 微信小程序登录绑定手机号码接口
// * @param loginReq


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

@ -0,0 +1,171 @@
package org.jeecg.modules.commonCoupon.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.commonCoupon.entity.CommonCoupon;
import org.jeecg.modules.commonCoupon.service.ICommonCouponService;
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-30
* @Version: V1.0
*/
@Api(tags="优惠券活动")
@RestController
@RequestMapping("/commonCoupon/commonCoupon")
@Slf4j
public class CommonCouponController extends JeecgController<CommonCoupon, ICommonCouponService> {
@Autowired
private ICommonCouponService commonCouponService;
/**
* 分页列表查询
*
* @param commonCoupon
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "优惠券活动-分页列表查询")
@ApiOperation(value="优惠券活动-分页列表查询", notes="优惠券活动-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<CommonCoupon>> queryPageList(CommonCoupon commonCoupon,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<CommonCoupon> queryWrapper = QueryGenerator.initQueryWrapper(commonCoupon, req.getParameterMap());
Page<CommonCoupon> page = new Page<CommonCoupon>(pageNo, pageSize);
IPage<CommonCoupon> pageList = commonCouponService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param commonCoupon
* @return
*/
@AutoLog(value = "优惠券活动-添加")
@ApiOperation(value="优惠券活动-添加", notes="优惠券活动-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody CommonCoupon commonCoupon) {
commonCouponService.save(commonCoupon);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param commonCoupon
* @return
*/
@AutoLog(value = "优惠券活动-编辑")
@ApiOperation(value="优惠券活动-编辑", notes="优惠券活动-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody CommonCoupon commonCoupon) {
commonCouponService.updateById(commonCoupon);
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) {
commonCouponService.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.commonCouponService.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<CommonCoupon> queryById(@RequestParam(name="id",required=true) String id) {
CommonCoupon commonCoupon = commonCouponService.getById(id);
if(commonCoupon==null) {
return Result.error("未找到对应数据");
}
return Result.OK(commonCoupon);
}
/**
* 导出excel
*
* @param request
* @param commonCoupon
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, CommonCoupon commonCoupon) {
return super.exportXls(request, commonCoupon, CommonCoupon.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, CommonCoupon.class);
}
}

+ 78
- 0
module-common/src/main/java/org/jeecg/modules/commonCoupon/entity/CommonCoupon.java View File

@ -0,0 +1,78 @@
package org.jeecg.modules.commonCoupon.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-30
* @Version: V1.0
*/
@Data
@TableName("common_coupon")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="common_coupon对象", description="优惠券活动")
public class CommonCoupon 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.math.BigDecimal money;
/**满多少可用*/
@Excel(name = "满多少可用", width = 15)
@ApiModelProperty(value = "满多少可用")
private java.math.BigDecimal useMoney;
/**结束时间*/
@Excel(name = "结束时间", width = 15)
@ApiModelProperty(value = "结束时间")
private java.util.Date endTime;
/**优惠券备注*/
@Excel(name = "优惠券备注", width = 15)
@ApiModelProperty(value = "优惠券备注")
private java.lang.String type;
/**使用时间*/
@Excel(name = "使用时间", width = 15)
@ApiModelProperty(value = "使用时间")
private java.util.Date stateTime;
/**使用用户*/
@Excel(name = "使用用户", width = 15)
@ApiModelProperty(value = "使用用户")
private java.lang.String userId;
/**使用状态*/
@Excel(name = "使用状态", width = 15)
@ApiModelProperty(value = "使用状态")
private java.lang.Integer state;
}

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

@ -0,0 +1,17 @@
package org.jeecg.modules.commonCoupon.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.commonCoupon.entity.CommonCoupon;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 优惠券活动
* @Author: jeecg-boot
* @Date: 2024-12-30
* @Version: V1.0
*/
public interface CommonCouponMapper extends BaseMapper<CommonCoupon> {
}

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

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

@ -0,0 +1,14 @@
package org.jeecg.modules.commonCoupon.service;
import org.jeecg.modules.commonCoupon.entity.CommonCoupon;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 优惠券活动
* @Author: jeecg-boot
* @Date: 2024-12-30
* @Version: V1.0
*/
public interface ICommonCouponService extends IService<CommonCoupon> {
}

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

@ -0,0 +1,19 @@
package org.jeecg.modules.commonCoupon.service.impl;
import org.jeecg.modules.commonCoupon.entity.CommonCoupon;
import org.jeecg.modules.commonCoupon.mapper.CommonCouponMapper;
import org.jeecg.modules.commonCoupon.service.ICommonCouponService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 优惠券活动
* @Author: jeecg-boot
* @Date: 2024-12-30
* @Version: V1.0
*/
@Service
public class CommonCouponServiceImpl extends ServiceImpl<CommonCouponMapper, CommonCoupon> implements ICommonCouponService {
}

+ 207
- 0
module-common/src/main/java/org/jeecg/modules/commonCoupon/vue/CommonCouponList.vue View File

@ -0,0 +1,207 @@
<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-coupon-modal ref="modalForm" @ok="modalFormOk"></common-coupon-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CommonCouponModal from './modules/CommonCouponModal'
export default {
name: 'CommonCouponList',
mixins:[JeecgListMixin, mixinDevice],
components: {
CommonCouponModal
},
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: 'money'
},
{
title:'满多少可用',
align:"center",
dataIndex: 'useMoney'
},
{
title:'结束时间',
align:"center",
dataIndex: 'endTime'
},
{
title:'优惠券备注',
align:"center",
dataIndex: 'type'
},
{
title:'使用时间',
align:"center",
dataIndex: 'stateTime'
},
{
title:'使用用户',
align:"center",
dataIndex: 'userId'
},
{
title:'使用状态',
align:"center",
dataIndex: 'state'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/commonCoupon/commonCoupon/list",
delete: "/commonCoupon/commonCoupon/delete",
deleteBatch: "/commonCoupon/commonCoupon/deleteBatch",
exportXlsUrl: "/commonCoupon/commonCoupon/exportXls",
importExcelUrl: "commonCoupon/commonCoupon/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'BigDecimal',value:'money',text:'金额',dictCode:''})
fieldList.push({type:'BigDecimal',value:'useMoney',text:'满多少可用',dictCode:''})
fieldList.push({type:'datetime',value:'endTime',text:'结束时间'})
fieldList.push({type:'string',value:'type',text:'优惠券备注',dictCode:''})
fieldList.push({type:'datetime',value:'stateTime',text:'使用时间'})
fieldList.push({type:'string',value:'userId',text:'使用用户',dictCode:''})
fieldList.push({type:'int',value:'state',text:'使用状态',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

+ 134
- 0
module-common/src/main/java/org/jeecg/modules/commonCoupon/vue/modules/CommonCouponForm.vue View File

@ -0,0 +1,134 @@
<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="money">
<a-input-number v-model="model.money" placeholder="请输入金额" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="满多少可用" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="useMoney">
<a-input-number v-model="model.useMoney" placeholder="请输入满多少可用" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="结束时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="endTime">
<j-date placeholder="请选择结束时间" v-model="model.endTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="优惠券备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type">
<a-input v-model="model.type" placeholder="请输入优惠券备注" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="使用时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stateTime">
<j-date placeholder="请选择使用时间" v-model="model.stateTime" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
</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-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: 'CommonCouponForm',
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: "/commonCoupon/commonCoupon/add",
edit: "/commonCoupon/commonCoupon/edit",
queryById: "/commonCoupon/commonCoupon/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/commonCoupon/vue/modules/CommonCouponModal.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-coupon-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></common-coupon-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 CommonCouponForm from './CommonCouponForm'
export default {
name: 'CommonCouponModal',
components: {
CommonCouponForm
},
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/commonCoupon/vue/modules/CommonCouponModal.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-coupon-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></common-coupon-form>
</j-modal>
</template>
<script>
import CommonCouponForm from './CommonCouponForm'
export default {
name: 'CommonCouponModal',
components: {
CommonCouponForm
},
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/commonCoupon/vue3/CommonCoupon.api.ts View File

@ -0,0 +1,61 @@
import {defHttp} from '/@/utils/http/axios';
import {Modal} from 'ant-design-vue';
enum Api {
list = '/commonCoupon/commonCoupon/list',
save='/commonCoupon/commonCoupon/add',
edit='/commonCoupon/commonCoupon/edit',
deleteOne = '/commonCoupon/commonCoupon/delete',
deleteBatch = '/commonCoupon/commonCoupon/deleteBatch',
importExcel = '/commonCoupon/commonCoupon/importExcel',
exportXls = '/commonCoupon/commonCoupon/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});
}

+ 83
- 0
module-common/src/main/java/org/jeecg/modules/commonCoupon/vue3/CommonCoupon.data.ts View File

@ -0,0 +1,83 @@
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: 'money'
},
{
title: '满多少可用',
align:"center",
dataIndex: 'useMoney'
},
{
title: '结束时间',
align:"center",
dataIndex: 'endTime'
},
{
title: '优惠券备注',
align:"center",
dataIndex: 'type'
},
{
title: '使用时间',
align:"center",
dataIndex: 'stateTime'
},
{
title: '使用用户',
align:"center",
dataIndex: 'userId'
},
{
title: '使用状态',
align:"center",
dataIndex: 'state'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '金额',
field: 'money',
component: 'InputNumber',
},
{
label: '满多少可用',
field: 'useMoney',
component: 'InputNumber',
},
{
label: '结束时间',
field: 'endTime',
component: 'Input',
},
{
label: '优惠券备注',
field: 'type',
component: 'Input',
},
{
label: '使用时间',
field: 'stateTime',
component: 'Input',
},
{
label: '使用用户',
field: 'userId',
component: 'Input',
},
{
label: '使用状态',
field: 'state',
component: 'InputNumber',
},
];

+ 162
- 0
module-common/src/main/java/org/jeecg/modules/commonCoupon/vue3/CommonCouponList.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>
<!-- 表单区域 -->
<CommonCouponModal @register="registerModal" @success="handleSuccess"></CommonCouponModal>
</div>
</template>
<script lang="ts" name="commonCoupon-commonCoupon" 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 CommonCouponModal from './components/CommonCouponModal.vue'
import {columns, searchFormSchema} from './commonCoupon.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './commonCoupon.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/commonCoupon/vue3/components/CommonCouponModal.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 '../commonCoupon.data';
import {saveOrUpdate} from '../commonCoupon.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/commonIcon/controller/CommonIconController.java View File

@ -0,0 +1,171 @@
package org.jeecg.modules.commonIcon.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.commonIcon.entity.CommonIcon;
import org.jeecg.modules.commonIcon.service.ICommonIconService;
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-30
* @Version: V1.0
*/
@Api(tags="广告位信息表")
@RestController
@RequestMapping("/commonIcon/commonIcon")
@Slf4j
public class CommonIconController extends JeecgController<CommonIcon, ICommonIconService> {
@Autowired
private ICommonIconService commonIconService;
/**
* 分页列表查询
*
* @param commonIcon
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "广告位信息表-分页列表查询")
@ApiOperation(value="广告位信息表-分页列表查询", notes="广告位信息表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<CommonIcon>> queryPageList(CommonIcon commonIcon,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<CommonIcon> queryWrapper = QueryGenerator.initQueryWrapper(commonIcon, req.getParameterMap());
Page<CommonIcon> page = new Page<CommonIcon>(pageNo, pageSize);
IPage<CommonIcon> pageList = commonIconService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param commonIcon
* @return
*/
@AutoLog(value = "广告位信息表-添加")
@ApiOperation(value="广告位信息表-添加", notes="广告位信息表-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody CommonIcon commonIcon) {
commonIconService.save(commonIcon);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param commonIcon
* @return
*/
@AutoLog(value = "广告位信息表-编辑")
@ApiOperation(value="广告位信息表-编辑", notes="广告位信息表-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody CommonIcon commonIcon) {
commonIconService.updateById(commonIcon);
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) {
commonIconService.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.commonIconService.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<CommonIcon> queryById(@RequestParam(name="id",required=true) String id) {
CommonIcon commonIcon = commonIconService.getById(id);
if(commonIcon==null) {
return Result.error("未找到对应数据");
}
return Result.OK(commonIcon);
}
/**
* 导出excel
*
* @param request
* @param commonIcon
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, CommonIcon commonIcon) {
return super.exportXls(request, commonIcon, CommonIcon.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, CommonIcon.class);
}
}

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

@ -0,0 +1,74 @@
package org.jeecg.modules.commonIcon.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-30
* @Version: V1.0
*/
@Data
@TableName("common_icon")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="common_icon对象", description="广告位信息表")
public class CommonIcon 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 title;
/**价格*/
@Excel(name = "价格", width = 15)
@ApiModelProperty(value = "价格")
private java.math.BigDecimal price;
/**主图*/
@Excel(name = "主图", width = 15)
@ApiModelProperty(value = "主图")
private java.lang.String icon;
/**跳转地址*/
@Excel(name = "跳转地址", width = 15)
@ApiModelProperty(value = "跳转地址")
private java.lang.String url;
/**排序*/
@Excel(name = "排序", width = 15)
@ApiModelProperty(value = "排序")
private java.lang.Integer sort;
/**详情*/
@Excel(name = "详情", width = 15)
@ApiModelProperty(value = "详情")
private java.lang.String details;
}

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

@ -0,0 +1,17 @@
package org.jeecg.modules.commonIcon.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.commonIcon.entity.CommonIcon;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 广告位信息表
* @Author: jeecg-boot
* @Date: 2024-12-30
* @Version: V1.0
*/
public interface CommonIconMapper extends BaseMapper<CommonIcon> {
}

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

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

@ -0,0 +1,14 @@
package org.jeecg.modules.commonIcon.service;
import org.jeecg.modules.commonIcon.entity.CommonIcon;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 广告位信息表
* @Author: jeecg-boot
* @Date: 2024-12-30
* @Version: V1.0
*/
public interface ICommonIconService extends IService<CommonIcon> {
}

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

@ -0,0 +1,19 @@
package org.jeecg.modules.commonIcon.service.impl;
import org.jeecg.modules.commonIcon.entity.CommonIcon;
import org.jeecg.modules.commonIcon.mapper.CommonIconMapper;
import org.jeecg.modules.commonIcon.service.ICommonIconService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 广告位信息表
* @Author: jeecg-boot
* @Date: 2024-12-30
* @Version: V1.0
*/
@Service
public class CommonIconServiceImpl extends ServiceImpl<CommonIconMapper, CommonIcon> implements ICommonIconService {
}

+ 203
- 0
module-common/src/main/java/org/jeecg/modules/commonIcon/vue/CommonIconList.vue View File

@ -0,0 +1,203 @@
<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-icon-modal ref="modalForm" @ok="modalFormOk"></common-icon-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CommonIconModal from './modules/CommonIconModal'
export default {
name: 'CommonIconList',
mixins:[JeecgListMixin, mixinDevice],
components: {
CommonIconModal
},
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: 'title'
},
{
title:'价格',
align:"center",
dataIndex: 'price'
},
{
title:'主图',
align:"center",
dataIndex: 'icon',
scopedSlots: {customRender: 'imgSlot'}
},
{
title:'跳转地址',
align:"center",
dataIndex: 'url'
},
{
title:'排序',
align:"center",
dataIndex: 'sort'
},
{
title:'详情',
align:"center",
dataIndex: 'details',
scopedSlots: {customRender: 'htmlSlot'}
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/commonIcon/commonIcon/list",
delete: "/commonIcon/commonIcon/delete",
deleteBatch: "/commonIcon/commonIcon/deleteBatch",
exportXlsUrl: "/commonIcon/commonIcon/exportXls",
importExcelUrl: "commonIcon/commonIcon/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:'title',text:'标题',dictCode:''})
fieldList.push({type:'BigDecimal',value:'price',text:'价格',dictCode:''})
fieldList.push({type:'Text',value:'icon',text:'主图',dictCode:''})
fieldList.push({type:'string',value:'url',text:'跳转地址',dictCode:''})
fieldList.push({type:'int',value:'sort',text:'排序',dictCode:''})
fieldList.push({type:'Text',value:'details',text:'详情',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

+ 129
- 0
module-common/src/main/java/org/jeecg/modules/commonIcon/vue/modules/CommonIconForm.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="title">
<a-input v-model="model.title" placeholder="请输入标题" ></a-input>
</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="icon">
<j-image-upload isMultiple v-model="model.icon" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="跳转地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="url">
<a-input v-model="model.url" placeholder="请输入跳转地址" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<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-col>
<a-col :span="24">
<a-form-model-item label="详情" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="details">
<j-editor v-model="model.details" />
</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: 'CommonIconForm',
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: "/commonIcon/commonIcon/add",
edit: "/commonIcon/commonIcon/edit",
queryById: "/commonIcon/commonIcon/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/commonIcon/vue/modules/CommonIconModal.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-icon-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></common-icon-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 CommonIconForm from './CommonIconForm'
export default {
name: 'CommonIconModal',
components: {
CommonIconForm
},
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/commonIcon/vue/modules/CommonIconModal.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-icon-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></common-icon-form>
</j-modal>
</template>
<script>
import CommonIconForm from './CommonIconForm'
export default {
name: 'CommonIconModal',
components: {
CommonIconForm
},
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/commonIcon/vue3/CommonIcon.api.ts View File

@ -0,0 +1,61 @@
import {defHttp} from '/@/utils/http/axios';
import {Modal} from 'ant-design-vue';
enum Api {
list = '/commonIcon/commonIcon/list',
save='/commonIcon/commonIcon/add',
edit='/commonIcon/commonIcon/edit',
deleteOne = '/commonIcon/commonIcon/delete',
deleteBatch = '/commonIcon/commonIcon/deleteBatch',
importExcel = '/commonIcon/commonIcon/importExcel',
exportXls = '/commonIcon/commonIcon/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});
}

+ 77
- 0
module-common/src/main/java/org/jeecg/modules/commonIcon/vue3/CommonIcon.data.ts View File

@ -0,0 +1,77 @@
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: 'title'
},
{
title: '价格',
align:"center",
dataIndex: 'price'
},
{
title: '主图',
align:"center",
dataIndex: 'icon',
customRender:render.renderAvatar,
},
{
title: '跳转地址',
align:"center",
dataIndex: 'url'
},
{
title: '排序',
align:"center",
dataIndex: 'sort'
},
{
title: '详情',
align:"center",
dataIndex: 'details',
slots: { customRender: 'htmlSlot' },
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '标题',
field: 'title',
component: 'Input',
},
{
label: '价格',
field: 'price',
component: 'InputNumber',
},
{
label: '主图',
field: 'icon',
component: 'JImageUpload',
componentProps:{
},
},
{
label: '跳转地址',
field: 'url',
component: 'Input',
},
{
label: '排序',
field: 'sort',
component: 'InputNumber',
},
{
label: '详情',
field: 'details',
component: 'JCodeEditor', //TODO String后缀暂未添加
},
];

+ 162
- 0
module-common/src/main/java/org/jeecg/modules/commonIcon/vue3/CommonIconList.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>
<!-- 表单区域 -->
<CommonIconModal @register="registerModal" @success="handleSuccess"></CommonIconModal>
</div>
</template>
<script lang="ts" name="commonIcon-commonIcon" 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 CommonIconModal from './components/CommonIconModal.vue'
import {columns, searchFormSchema} from './commonIcon.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './commonIcon.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/commonIcon/vue3/components/CommonIconModal.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 '../commonIcon.data';
import {saveOrUpdate} from '../commonIcon.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/commonShop/controller/CommonShopController.java View File

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


+ 13
- 1
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-12
* @Date: 2024-12-13
* @Version: V1.0
*/
@Data
@ -109,4 +109,16 @@ 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;
}

+ 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-12
* @Date: 2024-12-13
* @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-12
* @Date: 2024-12-13
* @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-12
* @Date: 2024-12-13
* @Version: V1.0
*/
@Service


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

@ -174,40 +174,35 @@
dataIndex: 'vipPrice'
},
{
title:'多少盒',
align:"center",
dataIndex: 'box'
},
{
title:'斤',
title:'标签',
align:"center",
dataIndex: 'jin'
dataIndex: 'skuIcon'
},
{
title:'一盒多少罐',
title:'分类标识',
align:"center",
dataIndex: 'tank'
dataIndex: 'classId_dictText'
},
{
title:'限购数量',
title:'首页显示',
align:"center",
dataIndex: 'num'
dataIndex: 'indexNo',
customRender: (text) => (text ? filterMultiDictText(this.dictOptions['indexNo'], text) : ''),
},
{
title:'标签',
title:'金卡价',
align:"center",
dataIndex: 'skuIcon'
dataIndex: 'goldPrice'
},
{
title:'分类标识',
title:'银卡价',
align:"center",
dataIndex: 'classId_dictText'
dataIndex: 'silverPrice'
},
{
title:'首页显示',
title:'钻石价',
align:"center",
dataIndex: 'indexNo',
customRender: (text) => (text ? filterMultiDictText(this.dictOptions['indexNo'], text) : ''),
dataIndex: 'diamondPrice'
},
{
title: '操作',
@ -251,14 +246,13 @@
fieldList.push({type:'BigDecimal',value:'price',text:'价格',dictCode:''})
fieldList.push({type:'BigDecimal',value:'oldPrice',text:'原价',dictCode:''})
fieldList.push({type:'BigDecimal',value:'vipPrice',text:'会员价格',dictCode:''})
fieldList.push({type:'int',value:'box',text:'多少盒',dictCode:''})
fieldList.push({type:'int',value:'jin',text:'斤',dictCode:''})
fieldList.push({type:'int',value:'tank',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:''})
this.superFieldList = fieldList
}
}


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

@ -39,43 +39,38 @@
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="多少盒" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="box">
<a-input-number v-model="model.box" placeholder="请输入多少盒" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="斤" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jin">
<a-input-number v-model="model.jin" placeholder="请输入斤" style="width: 100%" />
<a-form-model-item label="标签" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="skuIcon">
<a-input v-model="model.skuIcon" placeholder="请输入标签" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="一盒多少罐" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tank">
<a-input-number v-model="model.tank" placeholder="请输入一盒多少罐" style="width: 100%" />
<a-form-model-item label="详情" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="details">
<j-editor v-model="model.details" />
</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 label="分类标识" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="classId">
<j-search-select-tag v-model="model.classId" dict="common_class,title,id" />
</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>
<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="details">
<j-editor v-model="model.details" />
<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="classId">
<j-search-select-tag v-model="model.classId" dict="common_class,title,id" />
<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="indexNo">
<j-switch v-model="model.indexNo" ></j-switch>
<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-row>


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

@ -40,26 +40,6 @@ export const columns: BasicColumn[] = [
align:"center",
dataIndex: 'vipPrice'
},
{
title: '多少盒',
align:"center",
dataIndex: 'box'
},
{
title: '斤',
align:"center",
dataIndex: 'jin'
},
{
title: '一盒多少罐',
align:"center",
dataIndex: 'tank'
},
{
title: '限购数量',
align:"center",
dataIndex: 'num'
},
{
title: '标签',
align:"center",
@ -78,6 +58,21 @@ export const columns: BasicColumn[] = [
return render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
},
},
{
title: '金卡价',
align:"center",
dataIndex: 'goldPrice'
},
{
title: '银卡价',
align:"center",
dataIndex: 'silverPrice'
},
{
title: '钻石价',
align:"center",
dataIndex: 'diamondPrice'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
@ -133,26 +128,6 @@ export const formSchema: FormSchema[] = [
field: 'vipPrice',
component: 'InputNumber',
},
{
label: '多少盒',
field: 'box',
component: 'InputNumber',
},
{
label: '斤',
field: 'jin',
component: 'InputNumber',
},
{
label: '一盒多少罐',
field: 'tank',
component: 'InputNumber',
},
{
label: '限购数量',
field: 'num',
component: 'InputNumber',
},
{
label: '标签',
field: 'skuIcon',
@ -178,4 +153,19 @@ export const formSchema: FormSchema[] = [
componentProps:{
},
},
{
label: '金卡价',
field: 'goldPrice',
component: 'InputNumber',
},
{
label: '银卡价',
field: 'silverPrice',
component: 'InputNumber',
},
{
label: '钻石价',
field: 'diamondPrice',
component: 'Input',
},
];

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

@ -0,0 +1,171 @@
package org.jeecg.modules.commonVip.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.commonVip.entity.CommonVip;
import org.jeecg.modules.commonVip.service.ICommonVipService;
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-30
* @Version: V1.0
*/
@Api(tags="会员信息内容")
@RestController
@RequestMapping("/commonVip/commonVip")
@Slf4j
public class CommonVipController extends JeecgController<CommonVip, ICommonVipService> {
@Autowired
private ICommonVipService commonVipService;
/**
* 分页列表查询
*
* @param commonVip
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "会员信息内容-分页列表查询")
@ApiOperation(value="会员信息内容-分页列表查询", notes="会员信息内容-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<CommonVip>> queryPageList(CommonVip commonVip,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<CommonVip> queryWrapper = QueryGenerator.initQueryWrapper(commonVip, req.getParameterMap());
Page<CommonVip> page = new Page<CommonVip>(pageNo, pageSize);
IPage<CommonVip> pageList = commonVipService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param commonVip
* @return
*/
@AutoLog(value = "会员信息内容-添加")
@ApiOperation(value="会员信息内容-添加", notes="会员信息内容-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody CommonVip commonVip) {
commonVipService.save(commonVip);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param commonVip
* @return
*/
@AutoLog(value = "会员信息内容-编辑")
@ApiOperation(value="会员信息内容-编辑", notes="会员信息内容-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody CommonVip commonVip) {
commonVipService.updateById(commonVip);
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) {
commonVipService.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.commonVipService.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<CommonVip> queryById(@RequestParam(name="id",required=true) String id) {
CommonVip commonVip = commonVipService.getById(id);
if(commonVip==null) {
return Result.error("未找到对应数据");
}
return Result.OK(commonVip);
}
/**
* 导出excel
*
* @param request
* @param commonVip
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, CommonVip commonVip) {
return super.exportXls(request, commonVip, CommonVip.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, CommonVip.class);
}
}

+ 73
- 0
module-common/src/main/java/org/jeecg/modules/commonVip/entity/CommonVip.java View File

@ -0,0 +1,73 @@
package org.jeecg.modules.commonVip.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-30
* @Version: V1.0
*/
@Data
@TableName("common_vip")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="common_vip对象", description="会员信息内容")
public class CommonVip implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
/**名称*/
@Excel(name = "名称", width = 15)
@ApiModelProperty(value = "名称")
private java.lang.String title;
/**小标题*/
@Excel(name = "小标题", width = 15)
@ApiModelProperty(value = "小标题")
private java.lang.String subTitle;
/**图标*/
@Excel(name = "图标", width = 15)
@ApiModelProperty(value = "图标")
private java.lang.String headImage;
/**累积满多少可成为*/
@Excel(name = "累积满多少可成为", width = 15)
@ApiModelProperty(value = "累积满多少可成为")
private java.math.BigDecimal money;
/**会员权益*/
@Excel(name = "会员权益", width = 15)
@ApiModelProperty(value = "会员权益")
private java.lang.String details;
}

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

@ -0,0 +1,17 @@
package org.jeecg.modules.commonVip.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.commonVip.entity.CommonVip;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 会员信息内容
* @Author: jeecg-boot
* @Date: 2024-12-30
* @Version: V1.0
*/
public interface CommonVipMapper extends BaseMapper<CommonVip> {
}

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

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

@ -0,0 +1,14 @@
package org.jeecg.modules.commonVip.service;
import org.jeecg.modules.commonVip.entity.CommonVip;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 会员信息内容
* @Author: jeecg-boot
* @Date: 2024-12-30
* @Version: V1.0
*/
public interface ICommonVipService extends IService<CommonVip> {
}

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

@ -0,0 +1,19 @@
package org.jeecg.modules.commonVip.service.impl;
import org.jeecg.modules.commonVip.entity.CommonVip;
import org.jeecg.modules.commonVip.mapper.CommonVipMapper;
import org.jeecg.modules.commonVip.service.ICommonVipService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 会员信息内容
* @Author: jeecg-boot
* @Date: 2024-12-30
* @Version: V1.0
*/
@Service
public class CommonVipServiceImpl extends ServiceImpl<CommonVipMapper, CommonVip> implements ICommonVipService {
}

+ 197
- 0
module-common/src/main/java/org/jeecg/modules/commonVip/vue/CommonVipList.vue View File

@ -0,0 +1,197 @@
<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-vip-modal ref="modalForm" @ok="modalFormOk"></common-vip-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CommonVipModal from './modules/CommonVipModal'
export default {
name: 'CommonVipList',
mixins:[JeecgListMixin, mixinDevice],
components: {
CommonVipModal
},
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: 'title'
},
{
title:'小标题',
align:"center",
dataIndex: 'subTitle'
},
{
title:'图标',
align:"center",
dataIndex: 'headImage',
scopedSlots: {customRender: 'imgSlot'}
},
{
title:'累积满多少可成为',
align:"center",
dataIndex: 'money'
},
{
title:'会员权益',
align:"center",
dataIndex: 'details',
scopedSlots: {customRender: 'htmlSlot'}
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/commonVip/commonVip/list",
delete: "/commonVip/commonVip/delete",
deleteBatch: "/commonVip/commonVip/deleteBatch",
exportXlsUrl: "/commonVip/commonVip/exportXls",
importExcelUrl: "commonVip/commonVip/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:'title',text:'名称',dictCode:''})
fieldList.push({type:'string',value:'subTitle',text:'小标题',dictCode:''})
fieldList.push({type:'Text',value:'headImage',text:'图标',dictCode:''})
fieldList.push({type:'BigDecimal',value:'money',text:'累积满多少可成为',dictCode:''})
fieldList.push({type:'Text',value:'details',text:'会员权益',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

+ 124
- 0
module-common/src/main/java/org/jeecg/modules/commonVip/vue/modules/CommonVipForm.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="title">
<a-input v-model="model.title" placeholder="请输入名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="小标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="subTitle">
<a-input v-model="model.subTitle" placeholder="请输入小标题" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="图标" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="headImage">
<j-image-upload isMultiple v-model="model.headImage" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="累积满多少可成为" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="money">
<a-input-number v-model="model.money" placeholder="请输入累积满多少可成为" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="会员权益" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="details">
<j-editor v-model="model.details" />
</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: 'CommonVipForm',
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: "/commonVip/commonVip/add",
edit: "/commonVip/commonVip/edit",
queryById: "/commonVip/commonVip/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/commonVip/vue/modules/CommonVipModal.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-vip-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></common-vip-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 CommonVipForm from './CommonVipForm'
export default {
name: 'CommonVipModal',
components: {
CommonVipForm
},
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/commonVip/vue/modules/CommonVipModal.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-vip-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></common-vip-form>
</j-modal>
</template>
<script>
import CommonVipForm from './CommonVipForm'
export default {
name: 'CommonVipModal',
components: {
CommonVipForm
},
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/commonVip/vue3/CommonVip.api.ts View File

@ -0,0 +1,61 @@
import {defHttp} from '/@/utils/http/axios';
import {Modal} from 'ant-design-vue';
enum Api {
list = '/commonVip/commonVip/list',
save='/commonVip/commonVip/add',
edit='/commonVip/commonVip/edit',
deleteOne = '/commonVip/commonVip/delete',
deleteBatch = '/commonVip/commonVip/deleteBatch',
importExcel = '/commonVip/commonVip/importExcel',
exportXls = '/commonVip/commonVip/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});
}

+ 67
- 0
module-common/src/main/java/org/jeecg/modules/commonVip/vue3/CommonVip.data.ts View File

@ -0,0 +1,67 @@
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: 'title'
},
{
title: '小标题',
align:"center",
dataIndex: 'subTitle'
},
{
title: '图标',
align:"center",
dataIndex: 'headImage',
customRender:render.renderAvatar,
},
{
title: '累积满多少可成为',
align:"center",
dataIndex: 'money'
},
{
title: '会员权益',
align:"center",
dataIndex: 'details',
slots: { customRender: 'htmlSlot' },
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '名称',
field: 'title',
component: 'Input',
},
{
label: '小标题',
field: 'subTitle',
component: 'Input',
},
{
label: '图标',
field: 'headImage',
component: 'JImageUpload',
componentProps:{
},
},
{
label: '累积满多少可成为',
field: 'money',
component: 'InputNumber',
},
{
label: '会员权益',
field: 'details',
component: 'JCodeEditor', //TODO String后缀暂未添加
},
];

+ 162
- 0
module-common/src/main/java/org/jeecg/modules/commonVip/vue3/CommonVipList.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>
<!-- 表单区域 -->
<CommonVipModal @register="registerModal" @success="handleSuccess"></CommonVipModal>
</div>
</template>
<script lang="ts" name="commonVip-commonVip" 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 CommonVipModal from './components/CommonVipModal.vue'
import {columns, searchFormSchema} from './commonVip.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './commonVip.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/commonVip/vue3/components/CommonVipModal.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 '../commonVip.data';
import {saveOrUpdate} from '../commonVip.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>

+ 6
- 6
module-system/src/main/resources/application-dev.yml View File

@ -1,5 +1,5 @@
server:
port: 8000
port: 8001
tomcat:
max-swallow-size: -1
error:
@ -339,12 +339,12 @@ third-app:
# keyPath:
# notifyUrl:
##配置微信 - 三只青蛙大米小程
##配置微信 - 珠宝项目配置
wechat-dm:
mpAppId: wx0839bc52e7849c13
mpAppSecret: c614fd865951c5246e849501204e6f7f
mchId: 1700534180
mchKey: 9bde2770a74c2a460592de2d451ce05f
mpAppId: wx28679cb649907e7e
mpAppSecret: 6b5fbf1439176f7b78209bd237dfdf7e
mchId: 1702891319
mchKey: 6b5fbf1439176f7b78209bd237dfdf7e
keyPath:
notifyUrl:


Loading…
Cancel
Save