From 46923685836bc9fd749d86d1932fb4cbd9d2a495 Mon Sep 17 00:00:00 2001 From: Aug <17674666882@163.com> Date: Fri, 12 Sep 2025 19:55:06 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=9B=BE=E7=89=87=E7=9B=B4=E6=92=AD?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=202=E3=80=81=E6=88=90=E9=95=BF=E6=A1=A3?= =?UTF-8?q?=E6=A1=88=E6=A8=A1=E5=9D=97=203=E3=80=81=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=88=B8=E6=A8=A1=E5=9D=97=204=E3=80=81=E6=88=90=E5=91=98?= =?UTF-8?q?=E5=85=B3=E8=81=94=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/jeecg/modules/pay/MpWxPayService.java | 4 +- .../controller/StudytourCouponController.java | 2 +- .../studytourCoupon/entity/StudytourCoupon.java | 8 +- .../mapper/StudytourCouponMapper.java | 2 +- .../service/IStudytourCouponService.java | 2 +- .../service/impl/StudytourCouponServiceImpl.java | 2 +- .../studytourCoupon/vue/StudytourCouponList.vue | 12 +- .../vue/modules/StudytourCouponForm.vue | 12 +- .../studytourCoupon/vue3/StudytourCoupon.data.ts | 12 +- .../controller/StudytourCouponUserController.java | 2 +- .../entity/StudytourCouponUser.java | 8 +- .../mapper/StudytourCouponUserMapper.java | 2 +- .../service/IStudytourCouponUserService.java | 2 +- .../impl/StudytourCouponUserServiceImpl.java | 2 +- .../vue/StudytourCouponUserList.vue | 6 +- .../vue/modules/StudytourCouponUserForm.vue | 6 +- .../vue3/StudytourCouponUser.data.ts | 6 +- .../controller/StudytourImageController.java | 148 ++++++++++++--- .../studytourImage/entity/StudytourImage.java | 22 +-- .../entity/StudytourImageContent.java | 33 ++-- .../mapper/StudytourImageContentMapper.java | 12 +- .../mapper/StudytourImageMapper.java | 2 +- .../mapper/xml/StudytourImageContentMapper.xml | 16 ++ .../service/IStudytourImageContentService.java | 8 +- .../service/IStudytourImageService.java | 28 ++- .../impl/StudytourImageContentServiceImpl.java | 27 +++ .../service/impl/StudytourImageServiceImpl.java | 62 +++++- .../studytourImage/vo/StudytourImagePage.java | 65 +++++++ .../studytourImage/vue/StudytourImageList.vue | 35 ++-- .../vue/modules/StudytourImageForm.vue | 187 ++++++++++++------ .../vue/modules/StudytourImageModal.vue | 20 +- .../studytourImage/vue3/StudytourImage.api.ts | 7 + .../studytourImage/vue3/StudytourImage.data.ts | 59 +++++- .../studytourImage/vue3/StudytourImageList.vue | 30 +-- .../vue3/components/StudytourImageModal.vue | 63 ++++++- .../impl/StudytourImageContentServiceImpl.java | 19 -- .../vue3/StudytourImageContent.data.ts | 52 ----- .../controller/StudytourRecordController.java} | 84 ++++----- .../studytourRecord/entity/StudytourRecord.java | 80 ++++++++ .../mapper/StudytourRecordMapper.java | 17 ++ .../mapper/xml/StudytourRecordMapper.xml} | 2 +- .../service/IStudytourRecordService.java | 14 ++ .../service/impl/StudytourRecordServiceImpl.java | 19 ++ .../vue/StudytourRecordList.vue} | 60 ++++-- .../vue/modules/StudytourRecordForm.vue} | 38 +++- .../modules/StudytourRecordModal.Style#Drawer.vue} | 8 +- .../vue/modules/StudytourRecordModal.vue} | 8 +- .../vue3/StudytourRecord.api.ts} | 14 +- .../studytourRecord/vue3/StudytourRecord.data.ts | 92 +++++++++ .../vue3/StudytourRecordList.vue} | 14 +- .../vue3/components/StudytourRecordModal.vue} | 4 +- .../org/jeecg/modules/api/service/BindService.java | 25 +++ .../jeecg/modules/api/service/CouponService.java | 25 +++ .../modules/api/service/ExperienceService.java | 19 ++ .../jeecg/modules/api/service/ImageService.java | 23 +++ .../modules/api/service/Impl/BindServiceImpl.java | 177 +++++++++++++++++ .../api/service/Impl/CouponServiceImpl.java | 210 +++++++++++++++++++++ .../api/service/Impl/ExperienceServiceImpl.java | 134 +++++++++++++ .../modules/api/service/Impl/ImageServiceImpl.java | 173 +++++++++++++++++ .../modules/api/service/Impl/OrderServiceImpl.java | 4 +- .../api/studytourController/BindController.java | 54 ++++++ .../api/studytourController/CouponController.java | 57 ++++++ .../studytourController/ExperienceController.java | 29 ++- .../api/studytourController/ImageController.java | 31 ++- 64 files changed, 1997 insertions(+), 403 deletions(-) rename jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/{studytourImageContent => studytourImage}/entity/StudytourImageContent.java (66%) rename jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/{studytourImageContent => studytourImage}/mapper/StudytourImageContentMapper.java (50%) create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/mapper/xml/StudytourImageContentMapper.xml rename jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/{studytourImageContent => studytourImage}/service/IStudytourImageContentService.java (50%) create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/service/impl/StudytourImageContentServiceImpl.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vo/StudytourImagePage.java delete mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImageContent/service/impl/StudytourImageContentServiceImpl.java delete mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImageContent/vue3/StudytourImageContent.data.ts rename jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/{studytourImageContent/controller/StudytourImageContentController.java => studytourRecord/controller/StudytourRecordController.java} (51%) create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourRecord/entity/StudytourRecord.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourRecord/mapper/StudytourRecordMapper.java rename jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/{studytourImageContent/mapper/xml/StudytourImageContentMapper.xml => studytourRecord/mapper/xml/StudytourRecordMapper.xml} (58%) create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourRecord/service/IStudytourRecordService.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourRecord/service/impl/StudytourRecordServiceImpl.java rename jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/{studytourImageContent/vue/StudytourImageContentList.vue => studytourRecord/vue/StudytourRecordList.vue} (72%) rename jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/{studytourImageContent/vue/modules/StudytourImageContentForm.vue => studytourRecord/vue/modules/StudytourRecordForm.vue} (54%) rename jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/{studytourImageContent/vue/modules/StudytourImageContentModal.Style#Drawer.vue => studytourRecord/vue/modules/StudytourRecordModal.Style#Drawer.vue} (84%) rename jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/{studytourImageContent/vue/modules/StudytourImageContentModal.vue => studytourRecord/vue/modules/StudytourRecordModal.vue} (78%) rename jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/{studytourImageContent/vue3/StudytourImageContent.api.ts => studytourRecord/vue3/StudytourRecord.api.ts} (70%) create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourRecord/vue3/StudytourRecord.data.ts rename jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/{studytourImageContent/vue3/StudytourImageContentList.vue => studytourRecord/vue3/StudytourRecordList.vue} (89%) rename jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/{studytourImageContent/vue3/components/StudytourImageContentModal.vue => studytourRecord/vue3/components/StudytourRecordModal.vue} (93%) create mode 100644 jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/BindService.java create mode 100644 jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/CouponService.java create mode 100644 jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/Impl/BindServiceImpl.java create mode 100644 jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/Impl/CouponServiceImpl.java create mode 100644 jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/studytourController/BindController.java create mode 100644 jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/studytourController/CouponController.java diff --git a/han-hai-module-pay/src/main/java/org/jeecg/modules/pay/MpWxPayService.java b/han-hai-module-pay/src/main/java/org/jeecg/modules/pay/MpWxPayService.java index 3bd4e4c..b968e47 100644 --- a/han-hai-module-pay/src/main/java/org/jeecg/modules/pay/MpWxPayService.java +++ b/han-hai-module-pay/src/main/java/org/jeecg/modules/pay/MpWxPayService.java @@ -99,13 +99,13 @@ public class MpWxPayService { request.setTotalFee(price); //总金额|分计 request.setSpbillCreateIp(clientIp); //终端IP // request.setNotifyUrl(wxPay.notifyUrl);//设置回调路径 - request.setNotifyUrl("https://tai-testapi.sanhemovie.com/massage-api/post/notify");//设置回调路径 + request.setNotifyUrl("https:///www.hongyujiaoyu.com/studytour-admin/studytour/order/createOrder");//设置回调路径 request.setProductId(productId); //商品id request.setOpenid(openId); //JSAPI OPENID if (dev){ request.setTotalFee(price); // request.setNotifyUrl(wxPay.notifyUrlDev); - request.setNotifyUrl("https://tai-testapi.sanhemovie.com/massage-api/post/notify");//设置回调路径 + request.setNotifyUrl("https:///www.hongyujiaoyu.com/studytour-admin/studytour/order/createOrder");//设置回调路径 } try { Object order = wxPayService.createOrder(request); diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/controller/StudytourCouponController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/controller/StudytourCouponController.java index 0ae9966..1e80717 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/controller/StudytourCouponController.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/controller/StudytourCouponController.java @@ -39,7 +39,7 @@ import org.jeecg.common.aspect.annotation.AutoLog; /** * @Description: 优惠券表 * @Author: jeecg-boot - * @Date: 2025-08-25 + * @Date: 2025-09-12 * @Version: V1.0 */ @Api(tags="优惠券表") diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/entity/StudytourCoupon.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/entity/StudytourCoupon.java index c7a9a05..3ece1af 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/entity/StudytourCoupon.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/entity/StudytourCoupon.java @@ -20,7 +20,7 @@ import lombok.experimental.Accessors; /** * @Description: 优惠券表 * @Author: jeecg-boot - * @Date: 2025-08-25 + * @Date: 2025-09-12 * @Version: V1.0 */ @Data @@ -54,14 +54,14 @@ public class StudytourCoupon implements Serializable { /**优惠金额*/ @Excel(name = "优惠金额", width = 15) @ApiModelProperty(value = "优惠金额") - private java.math.BigDecimal discount; + private java.math.BigDecimal amount; /**有效期限*/ @Excel(name = "有效期限", width = 15) @ApiModelProperty(value = "有效期限") - private java.util.Date validDate; + private java.util.Date validTime; /**是否可被领取*/ @Excel(name = "是否可被领取", width = 15, dicCode = "is_true") @Dict(dicCode = "is_true") @ApiModelProperty(value = "是否可被领取") - private java.lang.String isReceive; + private java.lang.String isFetch; } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/mapper/StudytourCouponMapper.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/mapper/StudytourCouponMapper.java index 922c9f3..1a2fea4 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/mapper/StudytourCouponMapper.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/mapper/StudytourCouponMapper.java @@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * @Description: 优惠券表 * @Author: jeecg-boot - * @Date: 2025-08-25 + * @Date: 2025-09-12 * @Version: V1.0 */ public interface StudytourCouponMapper extends BaseMapper { diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/service/IStudytourCouponService.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/service/IStudytourCouponService.java index b3024bc..9bf1bf8 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/service/IStudytourCouponService.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/service/IStudytourCouponService.java @@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService; /** * @Description: 优惠券表 * @Author: jeecg-boot - * @Date: 2025-08-25 + * @Date: 2025-09-12 * @Version: V1.0 */ public interface IStudytourCouponService extends IService { diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/service/impl/StudytourCouponServiceImpl.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/service/impl/StudytourCouponServiceImpl.java index 25f6ece..58173f0 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/service/impl/StudytourCouponServiceImpl.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/service/impl/StudytourCouponServiceImpl.java @@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; /** * @Description: 优惠券表 * @Author: jeecg-boot - * @Date: 2025-08-25 + * @Date: 2025-09-12 * @Version: V1.0 */ @Service diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/vue/StudytourCouponList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/vue/StudytourCouponList.vue index 09b9c72..899efc8 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/vue/StudytourCouponList.vue +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/vue/StudytourCouponList.vue @@ -130,17 +130,17 @@ { title:'优惠金额', align:"center", - dataIndex: 'discount' + dataIndex: 'amount' }, { title:'有效期限', align:"center", - dataIndex: 'validDate' + dataIndex: 'validTime' }, { title:'是否可被领取', align:"center", - dataIndex: 'isReceive_dictText' + dataIndex: 'isFetch_dictText' }, { title: '操作', @@ -177,9 +177,9 @@ getSuperFieldList(){ let fieldList=[]; fieldList.push({type:'string',value:'title',text:'名称',dictCode:''}) - fieldList.push({type:'BigDecimal',value:'discount',text:'优惠金额',dictCode:''}) - fieldList.push({type:'datetime',value:'validDate',text:'有效期限'}) - fieldList.push({type:'string',value:'isReceive',text:'是否可被领取',dictCode:'is_true'}) + fieldList.push({type:'BigDecimal',value:'amount',text:'优惠金额',dictCode:''}) + fieldList.push({type:'datetime',value:'validTime',text:'有效期限'}) + fieldList.push({type:'string',value:'isFetch',text:'是否可被领取',dictCode:'is_true'}) this.superFieldList = fieldList } } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/vue/modules/StudytourCouponForm.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/vue/modules/StudytourCouponForm.vue index 2849b8f..c84fce1 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/vue/modules/StudytourCouponForm.vue +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/vue/modules/StudytourCouponForm.vue @@ -9,18 +9,18 @@ - - + + - - + + - - + + diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/vue3/StudytourCoupon.data.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/vue3/StudytourCoupon.data.ts index ee78b6f..a66e03c 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/vue3/StudytourCoupon.data.ts +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCoupon/vue3/StudytourCoupon.data.ts @@ -12,17 +12,17 @@ export const columns: BasicColumn[] = [ { title: '优惠金额', align:"center", - dataIndex: 'discount' + dataIndex: 'amount' }, { title: '有效期限', align:"center", - dataIndex: 'validDate' + dataIndex: 'validTime' }, { title: '是否可被领取', align:"center", - dataIndex: 'isReceive_dictText' + dataIndex: 'isFetch_dictText' }, ]; //查询数据 @@ -37,17 +37,17 @@ export const formSchema: FormSchema[] = [ }, { label: '优惠金额', - field: 'discount', + field: 'amount', component: 'InputNumber', }, { label: '有效期限', - field: 'validDate', + field: 'validTime', component: 'Input', }, { label: '是否可被领取', - field: 'isReceive', + field: 'isFetch', component: 'JDictSelectTag', componentProps:{ dictCode:"is_true" diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/controller/StudytourCouponUserController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/controller/StudytourCouponUserController.java index fa8a71b..61e64f9 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/controller/StudytourCouponUserController.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/controller/StudytourCouponUserController.java @@ -39,7 +39,7 @@ import org.jeecg.common.aspect.annotation.AutoLog; /** * @Description: 用户所持有的优惠券信息表 * @Author: jeecg-boot - * @Date: 2025-08-25 + * @Date: 2025-09-12 * @Version: V1.0 */ @Api(tags="用户所持有的优惠券信息表") diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/entity/StudytourCouponUser.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/entity/StudytourCouponUser.java index 2f3c2b0..68443f9 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/entity/StudytourCouponUser.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/entity/StudytourCouponUser.java @@ -20,7 +20,7 @@ import lombok.experimental.Accessors; /** * @Description: 用户所持有的优惠券信息表 * @Author: jeecg-boot - * @Date: 2025-08-25 + * @Date: 2025-09-12 * @Version: V1.0 */ @Data @@ -54,7 +54,7 @@ public class StudytourCouponUser implements Serializable { /**优惠金额*/ @Excel(name = "优惠金额", width = 15) @ApiModelProperty(value = "优惠金额") - private java.math.BigDecimal discount; + private java.math.BigDecimal discountAmount; /**有效期*/ @Excel(name = "有效期", width = 15) @ApiModelProperty(value = "有效期") @@ -70,8 +70,8 @@ public class StudytourCouponUser implements Serializable { @ApiModelProperty(value = "关联优惠券id") private java.lang.String couponId; /**关联订单id*/ - @Excel(name = "关联订单id", width = 15, dictTable = "studytour_order", dicText = "title", dicCode = "id") - @Dict(dictTable = "studytour_order", dicText = "title", dicCode = "id") + @Excel(name = "关联订单id", width = 15, dictTable = "studytour_order", dicText = "id", dicCode = "id") + @Dict(dictTable = "studytour_order", dicText = "id", dicCode = "id") @ApiModelProperty(value = "关联订单id") private java.lang.String orderId; /**关联用户id*/ diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/mapper/StudytourCouponUserMapper.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/mapper/StudytourCouponUserMapper.java index 1889299..96c5a0c 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/mapper/StudytourCouponUserMapper.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/mapper/StudytourCouponUserMapper.java @@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * @Description: 用户所持有的优惠券信息表 * @Author: jeecg-boot - * @Date: 2025-08-25 + * @Date: 2025-09-12 * @Version: V1.0 */ public interface StudytourCouponUserMapper extends BaseMapper { diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/service/IStudytourCouponUserService.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/service/IStudytourCouponUserService.java index 4b1b0aa..9cdaac8 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/service/IStudytourCouponUserService.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/service/IStudytourCouponUserService.java @@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService; /** * @Description: 用户所持有的优惠券信息表 * @Author: jeecg-boot - * @Date: 2025-08-25 + * @Date: 2025-09-12 * @Version: V1.0 */ public interface IStudytourCouponUserService extends IService { diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/service/impl/StudytourCouponUserServiceImpl.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/service/impl/StudytourCouponUserServiceImpl.java index e1b32e1..32a2022 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/service/impl/StudytourCouponUserServiceImpl.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/service/impl/StudytourCouponUserServiceImpl.java @@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; /** * @Description: 用户所持有的优惠券信息表 * @Author: jeecg-boot - * @Date: 2025-08-25 + * @Date: 2025-09-12 * @Version: V1.0 */ @Service diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/vue/StudytourCouponUserList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/vue/StudytourCouponUserList.vue index 607a497..e46199e 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/vue/StudytourCouponUserList.vue +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/vue/StudytourCouponUserList.vue @@ -130,7 +130,7 @@ { title:'优惠金额', align:"center", - dataIndex: 'discount' + dataIndex: 'discountAmount' }, { title:'有效期', @@ -192,11 +192,11 @@ getSuperFieldList(){ let fieldList=[]; fieldList.push({type:'string',value:'title',text:'优惠券名称',dictCode:''}) - fieldList.push({type:'BigDecimal',value:'discount',text:'优惠金额',dictCode:''}) + fieldList.push({type:'BigDecimal',value:'discountAmount',text:'优惠金额',dictCode:''}) fieldList.push({type:'datetime',value:'validDate',text:'有效期'}) fieldList.push({type:'string',value:'status',text:'使用状态',dictCode:'coupon_status'}) fieldList.push({type:'string',value:'couponId',text:'关联优惠券id',dictCode:"studytour_coupon,title,id"}) - fieldList.push({type:'string',value:'orderId',text:'关联订单id',dictCode:"studytour_order,title,id"}) + fieldList.push({type:'string',value:'orderId',text:'关联订单id',dictCode:"studytour_order,id,id"}) fieldList.push({type:'string',value:'userId',text:'关联用户id',dictCode:"han_hai_member,nick_name,id"}) this.superFieldList = fieldList } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/vue/modules/StudytourCouponUserForm.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/vue/modules/StudytourCouponUserForm.vue index fc63866..c08ba43 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/vue/modules/StudytourCouponUserForm.vue +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/vue/modules/StudytourCouponUserForm.vue @@ -9,8 +9,8 @@ - - + + @@ -30,7 +30,7 @@ - + diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/vue3/StudytourCouponUser.data.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/vue3/StudytourCouponUser.data.ts index b14efc8..9a5ec7d 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/vue3/StudytourCouponUser.data.ts +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourCouponUser/vue3/StudytourCouponUser.data.ts @@ -12,7 +12,7 @@ export const columns: BasicColumn[] = [ { title: '优惠金额', align:"center", - dataIndex: 'discount' + dataIndex: 'discountAmount' }, { title: '有效期', @@ -52,7 +52,7 @@ export const formSchema: FormSchema[] = [ }, { label: '优惠金额', - field: 'discount', + field: 'discountAmount', component: 'InputNumber', }, { @@ -81,7 +81,7 @@ export const formSchema: FormSchema[] = [ field: 'orderId', component: 'JDictSelectTag', componentProps:{ - dictCode:"studytour_order,title,id" + dictCode:"studytour_order,id,id" }, }, { diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/controller/StudytourImageController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/controller/StudytourImageController.java index 127b29e..8d1a1fc 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/controller/StudytourImageController.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/controller/StudytourImageController.java @@ -1,36 +1,42 @@ package org.jeecg.modules.studytourImage.controller; +import java.io.UnsupportedEncodingException; +import java.io.IOException; +import java.net.URLDecoder; +import java.util.ArrayList; 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.studytourImage.entity.StudytourImage; -import org.jeecg.modules.studytourImage.service.IStudytourImageService; - -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.jeecg.common.system.vo.LoginUser; +import org.apache.shiro.SecurityUtils; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.studytourImage.entity.StudytourImageContent; +import org.jeecg.modules.studytourImage.entity.StudytourImage; +import org.jeecg.modules.studytourImage.vo.StudytourImagePage; +import org.jeecg.modules.studytourImage.service.IStudytourImageService; +import org.jeecg.modules.studytourImage.service.IStudytourImageContentService; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; +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 com.alibaba.fastjson.JSON; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -39,16 +45,18 @@ import org.jeecg.common.aspect.annotation.AutoLog; /** * @Description: 图片直播表 * @Author: jeecg-boot - * @Date: 2025-08-25 + * @Date: 2025-09-12 * @Version: V1.0 */ @Api(tags="图片直播表") @RestController @RequestMapping("/studytourImage/studytourImage") @Slf4j -public class StudytourImageController extends JeecgController { +public class StudytourImageController { @Autowired private IStudytourImageService studytourImageService; + @Autowired + private IStudytourImageContentService studytourImageContentService; /** * 分页列表查询 @@ -75,28 +83,36 @@ public class StudytourImageController extends JeecgController add(@RequestBody StudytourImage studytourImage) { - studytourImageService.save(studytourImage); + public Result add(@RequestBody StudytourImagePage studytourImagePage) { + StudytourImage studytourImage = new StudytourImage(); + BeanUtils.copyProperties(studytourImagePage, studytourImage); + studytourImageService.saveMain(studytourImage, studytourImagePage.getStudytourImageContentList()); return Result.OK("添加成功!"); } /** * 编辑 * - * @param studytourImage + * @param studytourImagePage * @return */ @AutoLog(value = "图片直播表-编辑") @ApiOperation(value="图片直播表-编辑", notes="图片直播表-编辑") @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) - public Result edit(@RequestBody StudytourImage studytourImage) { - studytourImageService.updateById(studytourImage); + public Result edit(@RequestBody StudytourImagePage studytourImagePage) { + StudytourImage studytourImage = new StudytourImage(); + BeanUtils.copyProperties(studytourImagePage, studytourImage); + StudytourImage studytourImageEntity = studytourImageService.getById(studytourImage.getId()); + if(studytourImageEntity==null) { + return Result.error("未找到对应数据"); + } + studytourImageService.updateMain(studytourImage, studytourImagePage.getStudytourImageContentList()); return Result.OK("编辑成功!"); } @@ -110,7 +126,7 @@ public class StudytourImageController extends JeecgController delete(@RequestParam(name="id",required=true) String id) { - studytourImageService.removeById(id); + studytourImageService.delMain(id); return Result.OK("删除成功!"); } @@ -124,8 +140,8 @@ public class StudytourImageController extends JeecgController deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.studytourImageService.removeByIds(Arrays.asList(ids.split(","))); - return Result.OK("批量删除成功!"); + this.studytourImageService.delBatchMain(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); } /** @@ -143,6 +159,21 @@ public class StudytourImageController extends JeecgController> queryStudytourImageContentListByMainId(@RequestParam(name="id",required=true) String id) { + List studytourImageContentList = studytourImageContentService.selectByMainId(id); + return Result.OK(studytourImageContentList); } /** @@ -153,11 +184,43 @@ public class StudytourImageController extends JeecgController queryWrapper = QueryGenerator.initQueryWrapper(studytourImage, request.getParameterMap()); + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + + //Step.2 获取导出数据 + List queryList = studytourImageService.list(queryWrapper); + // 过滤选中数据 + String selections = request.getParameter("selections"); + List studytourImageList = new ArrayList(); + if(oConvertUtils.isEmpty(selections)) { + studytourImageList = queryList; + }else { + List selectionList = Arrays.asList(selections.split(",")); + studytourImageList = queryList.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList()); + } + + // Step.3 组装pageList + List pageList = new ArrayList(); + for (StudytourImage main : studytourImageList) { + StudytourImagePage vo = new StudytourImagePage(); + BeanUtils.copyProperties(main, vo); + List studytourImageContentList = studytourImageContentService.selectByMainId(main.getId()); + vo.setStudytourImageContentList(studytourImageContentList); + pageList.add(vo); + } + + // Step.4 AutoPoi 导出Excel + ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); + mv.addObject(NormalExcelConstants.FILE_NAME, "图片直播表列表"); + mv.addObject(NormalExcelConstants.CLASS, StudytourImagePage.class); + mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("图片直播表数据", "导出人:"+sysUser.getRealname(), "图片直播表")); + mv.addObject(NormalExcelConstants.DATA_LIST, pageList); + return mv; } /** - * 通过excel导入数据 + * 通过excel导入数据 * * @param request * @param response @@ -165,7 +228,34 @@ public class StudytourImageController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { - return super.importExcel(request, response, StudytourImage.class); + MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; + Map fileMap = multipartRequest.getFileMap(); + for (Map.Entry entity : fileMap.entrySet()) { + MultipartFile file = entity.getValue();// 获取上传文件对象 + ImportParams params = new ImportParams(); + params.setTitleRows(2); + params.setHeadRows(1); + params.setNeedSave(true); + try { + List list = ExcelImportUtil.importExcel(file.getInputStream(), StudytourImagePage.class, params); + for (StudytourImagePage page : list) { + StudytourImage po = new StudytourImage(); + BeanUtils.copyProperties(page, po); + studytourImageService.saveMain(po, page.getStudytourImageContentList()); + } + return Result.OK("文件导入成功!数据行数:" + list.size()); + } catch (Exception e) { + log.error(e.getMessage(),e); + return Result.error("文件导入失败:"+e.getMessage()); + } finally { + try { + file.getInputStream().close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + return Result.OK("文件导入失败!"); } } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/entity/StudytourImage.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/entity/StudytourImage.java index 26c0fb1..2e23d2e 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/entity/StudytourImage.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/entity/StudytourImage.java @@ -3,7 +3,6 @@ package org.jeecg.modules.studytourImage.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; @@ -14,20 +13,16 @@ import org.jeecgframework.poi.excel.annotation.Excel; import org.jeecg.common.aspect.annotation.Dict; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; /** * @Description: 图片直播表 * @Author: jeecg-boot - * @Date: 2025-08-25 + * @Date: 2025-09-12 * @Version: V1.0 */ +@ApiModel(value="studytour_image对象", description="图片直播表") @Data @TableName("studytour_image") -@Accessors(chain = true) -@EqualsAndHashCode(callSuper = false) -@ApiModel(value="studytour_image对象", description="图片直播表") public class StudytourImage implements Serializable { private static final long serialVersionUID = 1L; @@ -55,9 +50,14 @@ public class StudytourImage implements Serializable { @Excel(name = "地址", width = 15) @ApiModelProperty(value = "地址") private java.lang.String address; - /**关联活动id*/ - @Excel(name = "关联活动id", width = 15, dictTable = "studytour_activity", dicText = "title", dicCode = "id") - @Dict(dictTable = "studytour_activity", dicText = "title", dicCode = "id") - @ApiModelProperty(value = "关联活动id") + /**关联活动*/ + @Excel(name = "关联活动", width = 15, dictTable = "studytour_activity", dicText = "title", dicCode = "id") + @Dict(dictTable = "studytour_activity", dicText = "title", dicCode = "id") + @ApiModelProperty(value = "关联活动") private java.lang.String activityId; + /**关联用户*/ + @Excel(name = "关联用户", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") + @Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") + @ApiModelProperty(value = "关联用户") + private java.lang.String userId; } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImageContent/entity/StudytourImageContent.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/entity/StudytourImageContent.java similarity index 66% rename from jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImageContent/entity/StudytourImageContent.java rename to jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/entity/StudytourImageContent.java index 55efb76..793c116 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImageContent/entity/StudytourImageContent.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/entity/StudytourImageContent.java @@ -1,9 +1,6 @@ -package org.jeecg.modules.studytourImageContent.entity; +package org.jeecg.modules.studytourImage.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; @@ -11,23 +8,20 @@ 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 java.util.Date; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; +import java.io.UnsupportedEncodingException; /** * @Description: 用户图片直播表 * @Author: jeecg-boot - * @Date: 2025-08-25 + * @Date: 2025-09-12 * @Version: V1.0 */ +@ApiModel(value="studytour_image_content对象", description="用户图片直播表") @Data @TableName("studytour_image_content") -@Accessors(chain = true) -@EqualsAndHashCode(callSuper = false) -@ApiModel(value="studytour_image_content对象", description="用户图片直播表") public class StudytourImageContent implements Serializable { private static final long serialVersionUID = 1L; @@ -51,14 +45,15 @@ public class StudytourImageContent implements Serializable { @Excel(name = "图片", width = 15) @ApiModelProperty(value = "图片") private java.lang.String image; - /**关联图片直播id*/ - @Excel(name = "关联图片直播id", width = 15, dictTable = "studytour_image", dicText = "id", dicCode = "id") - @Dict(dictTable = "studytour_image", dicText = "id", dicCode = "id") - @ApiModelProperty(value = "关联图片直播id") + /**地址*/ + @Excel(name = "地址", width = 15) + @ApiModelProperty(value = "地址") + private java.lang.String address; + /**关联图片直播*/ + @ApiModelProperty(value = "关联图片直播") private java.lang.String imageId; - /**关联用户id*/ - @Excel(name = "关联用户id", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") - @Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") - @ApiModelProperty(value = "关联用户id") + /**关联用户*/ + @Excel(name = "关联用户", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") + @ApiModelProperty(value = "关联用户") private java.lang.String userId; } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImageContent/mapper/StudytourImageContentMapper.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/mapper/StudytourImageContentMapper.java similarity index 50% rename from jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImageContent/mapper/StudytourImageContentMapper.java rename to jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/mapper/StudytourImageContentMapper.java index 3bc9c39..4a68366 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImageContent/mapper/StudytourImageContentMapper.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/mapper/StudytourImageContentMapper.java @@ -1,17 +1,19 @@ -package org.jeecg.modules.studytourImageContent.mapper; +package org.jeecg.modules.studytourImage.mapper; import java.util.List; - -import org.apache.ibatis.annotations.Param; -import org.jeecg.modules.studytourImageContent.entity.StudytourImageContent; +import org.jeecg.modules.studytourImage.entity.StudytourImageContent; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; /** * @Description: 用户图片直播表 * @Author: jeecg-boot - * @Date: 2025-08-25 + * @Date: 2025-09-12 * @Version: V1.0 */ public interface StudytourImageContentMapper extends BaseMapper { + public boolean deleteByMainId(@Param("mainId") String mainId); + + public List selectByMainId(@Param("mainId") String mainId); } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/mapper/StudytourImageMapper.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/mapper/StudytourImageMapper.java index c7ff02d..4f2a044 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/mapper/StudytourImageMapper.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/mapper/StudytourImageMapper.java @@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * @Description: 图片直播表 * @Author: jeecg-boot - * @Date: 2025-08-25 + * @Date: 2025-09-12 * @Version: V1.0 */ public interface StudytourImageMapper extends BaseMapper { diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/mapper/xml/StudytourImageContentMapper.xml b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/mapper/xml/StudytourImageContentMapper.xml new file mode 100644 index 0000000..68fea3b --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/mapper/xml/StudytourImageContentMapper.xml @@ -0,0 +1,16 @@ + + + + + + DELETE + FROM studytour_image_content + WHERE + image_id = #{mainId} + + + diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImageContent/service/IStudytourImageContentService.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/service/IStudytourImageContentService.java similarity index 50% rename from jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImageContent/service/IStudytourImageContentService.java rename to jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/service/IStudytourImageContentService.java index bc2d5a2..601cf7a 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImageContent/service/IStudytourImageContentService.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/service/IStudytourImageContentService.java @@ -1,14 +1,16 @@ -package org.jeecg.modules.studytourImageContent.service; +package org.jeecg.modules.studytourImage.service; -import org.jeecg.modules.studytourImageContent.entity.StudytourImageContent; +import org.jeecg.modules.studytourImage.entity.StudytourImageContent; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; /** * @Description: 用户图片直播表 * @Author: jeecg-boot - * @Date: 2025-08-25 + * @Date: 2025-09-12 * @Version: V1.0 */ public interface IStudytourImageContentService extends IService { + public List selectByMainId(String mainId); } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/service/IStudytourImageService.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/service/IStudytourImageService.java index ba96729..5db376a 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/service/IStudytourImageService.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/service/IStudytourImageService.java @@ -1,14 +1,40 @@ package org.jeecg.modules.studytourImage.service; +import org.jeecg.modules.studytourImage.entity.StudytourImageContent; import org.jeecg.modules.studytourImage.entity.StudytourImage; import com.baomidou.mybatisplus.extension.service.IService; +import java.io.Serializable; +import java.util.Collection; +import java.util.List; /** * @Description: 图片直播表 * @Author: jeecg-boot - * @Date: 2025-08-25 + * @Date: 2025-09-12 * @Version: V1.0 */ public interface IStudytourImageService extends IService { + /** + * 添加一对多 + * + */ + public void saveMain(StudytourImage studytourImage,List studytourImageContentList) ; + + /** + * 修改一对多 + * + */ + public void updateMain(StudytourImage studytourImage,List studytourImageContentList); + + /** + * 删除一对多 + */ + public void delMain (String id); + + /** + * 批量删除一对多 + */ + public void delBatchMain (Collection idList); + } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/service/impl/StudytourImageContentServiceImpl.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/service/impl/StudytourImageContentServiceImpl.java new file mode 100644 index 0000000..60eb66a --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/service/impl/StudytourImageContentServiceImpl.java @@ -0,0 +1,27 @@ +package org.jeecg.modules.studytourImage.service.impl; + +import org.jeecg.modules.studytourImage.entity.StudytourImageContent; +import org.jeecg.modules.studytourImage.mapper.StudytourImageContentMapper; +import org.jeecg.modules.studytourImage.service.IStudytourImageContentService; +import org.springframework.stereotype.Service; +import java.util.List; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * @Description: 用户图片直播表 + * @Author: jeecg-boot + * @Date: 2025-09-12 + * @Version: V1.0 + */ +@Service +public class StudytourImageContentServiceImpl extends ServiceImpl implements IStudytourImageContentService { + + @Autowired + private StudytourImageContentMapper studytourImageContentMapper; + + @Override + public List selectByMainId(String mainId) { + return studytourImageContentMapper.selectByMainId(mainId); + } +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/service/impl/StudytourImageServiceImpl.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/service/impl/StudytourImageServiceImpl.java index 8b23cc9..57fd349 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/service/impl/StudytourImageServiceImpl.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/service/impl/StudytourImageServiceImpl.java @@ -1,19 +1,77 @@ package org.jeecg.modules.studytourImage.service.impl; import org.jeecg.modules.studytourImage.entity.StudytourImage; +import org.jeecg.modules.studytourImage.entity.StudytourImageContent; +import org.jeecg.modules.studytourImage.mapper.StudytourImageContentMapper; import org.jeecg.modules.studytourImage.mapper.StudytourImageMapper; import org.jeecg.modules.studytourImage.service.IStudytourImageService; import org.springframework.stereotype.Service; - import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import java.io.Serializable; +import java.util.List; +import java.util.Collection; /** * @Description: 图片直播表 * @Author: jeecg-boot - * @Date: 2025-08-25 + * @Date: 2025-09-12 * @Version: V1.0 */ @Service public class StudytourImageServiceImpl extends ServiceImpl implements IStudytourImageService { + @Autowired + private StudytourImageMapper studytourImageMapper; + @Autowired + private StudytourImageContentMapper studytourImageContentMapper; + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveMain(StudytourImage studytourImage, List studytourImageContentList) { + studytourImageMapper.insert(studytourImage); + if(studytourImageContentList!=null && studytourImageContentList.size()>0) { + for(StudytourImageContent entity:studytourImageContentList) { + //外键设置 + entity.setImageId(studytourImage.getId()); + studytourImageContentMapper.insert(entity); + } + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateMain(StudytourImage studytourImage,List studytourImageContentList) { + studytourImageMapper.updateById(studytourImage); + + //1.先删除子表数据 + studytourImageContentMapper.deleteByMainId(studytourImage.getId()); + + //2.子表数据重新插入 + if(studytourImageContentList!=null && studytourImageContentList.size()>0) { + for(StudytourImageContent entity:studytourImageContentList) { + //外键设置 + entity.setImageId(studytourImage.getId()); + studytourImageContentMapper.insert(entity); + } + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delMain(String id) { + studytourImageContentMapper.deleteByMainId(id); + studytourImageMapper.deleteById(id); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delBatchMain(Collection idList) { + for(Serializable id:idList) { + studytourImageContentMapper.deleteByMainId(id.toString()); + studytourImageMapper.deleteById(id); + } + } + } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vo/StudytourImagePage.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vo/StudytourImagePage.java new file mode 100644 index 0000000..1c85046 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vo/StudytourImagePage.java @@ -0,0 +1,65 @@ +package org.jeecg.modules.studytourImage.vo; + +import java.util.List; +import org.jeecg.modules.studytourImage.entity.StudytourImage; +import org.jeecg.modules.studytourImage.entity.StudytourImageContent; +import lombok.Data; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecgframework.poi.excel.annotation.ExcelEntity; +import org.jeecgframework.poi.excel.annotation.ExcelCollection; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import java.util.Date; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @Description: 图片直播表 + * @Author: jeecg-boot + * @Date: 2025-09-12 + * @Version: V1.0 + */ +@Data +@ApiModel(value="studytour_imagePage对象", description="图片直播表") +public class StudytourImagePage { + + /**主键*/ + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**图片*/ + @Excel(name = "图片", width = 15) + @ApiModelProperty(value = "图片") + private java.lang.String image; + /**地址*/ + @Excel(name = "地址", width = 15) + @ApiModelProperty(value = "地址") + private java.lang.String address; + /**关联活动*/ + @Excel(name = "关联活动", width = 15, dictTable = "studytour_activity", dicText = "title", dicCode = "id") + @Dict(dictTable = "studytour_activity", dicText = "title", dicCode = "id") + @ApiModelProperty(value = "关联活动") + private java.lang.String activityId; + /**关联用户*/ + @Excel(name = "关联用户", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") + @Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") + @ApiModelProperty(value = "关联用户") + private java.lang.String userId; + + @ExcelCollection(name="用户图片直播表") + @ApiModelProperty(value = "用户图片直播表") + private List studytourImageContentList; + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vue/StudytourImageList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vue/StudytourImageList.vue index deed38a..1a13b28 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vue/StudytourImageList.vue +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vue/StudytourImageList.vue @@ -8,7 +8,7 @@ - +
新增 @@ -36,15 +36,15 @@ \ No newline at end of file + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vue/modules/StudytourImageModal.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vue/modules/StudytourImageModal.vue index add1d56..d694215 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vue/modules/StudytourImageModal.vue +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vue/modules/StudytourImageModal.vue @@ -1,26 +1,27 @@ \ No newline at end of file + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vue3/StudytourImage.api.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vue3/StudytourImage.api.ts index fd3d5b7..cca14f2 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vue3/StudytourImage.api.ts +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vue3/StudytourImage.api.ts @@ -9,16 +9,23 @@ enum Api { deleteBatch = '/studytourImage/studytourImage/deleteBatch', importExcel = '/studytourImage/studytourImage/importExcel', exportXls = '/studytourImage/studytourImage/exportXls', + studytourImageContentList = '/studytourImage/studytourImage/queryStudytourImageContentByMainId', } /** * 导出api * @param params */ export const getExportUrl = Api.exportXls; + /** * 导入api */ export const getImportUrl = Api.importExcel; +/** + * 查询子表数据 + * @param params + */ +export const studytourImageContentList = Api.studytourImageContentList; /** * 列表接口 * @param params diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vue3/StudytourImage.data.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vue3/StudytourImage.data.ts index 5a80cce..7390e52 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vue3/StudytourImage.data.ts +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vue3/StudytourImage.data.ts @@ -2,6 +2,7 @@ import {BasicColumn} from '/@/components/Table'; import {FormSchema} from '/@/components/Table'; import { rules} from '/@/utils/helper/validator'; import { render } from '/@/utils/common/renderUtils'; +import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types' //列表数据 export const columns: BasicColumn[] = [ { @@ -16,10 +17,15 @@ export const columns: BasicColumn[] = [ dataIndex: 'address' }, { - title: '关联活动id', + title: '关联活动', align:"center", dataIndex: 'activityId_dictText' }, + { + title: '关联用户', + align:"center", + dataIndex: 'userId_dictText' + }, ]; //查询数据 export const searchFormSchema: FormSchema[] = [ @@ -39,11 +45,56 @@ export const formSchema: FormSchema[] = [ component: 'Input', }, { - label: '关联活动id', + label: '关联活动', field: 'activityId', - component: 'JDictSelectTag', + component: 'JSearchSelect', componentProps:{ - dictCode:"studytour_activity,title,id" + dict:"studytour_activity,title,id" + }, + dynamicRules: ({model,schema}) => { + return [ + { required: false}, + {...rules.duplicateCheckRule('studytour_image', 'activity_id',model,schema,true)[0]}, + ]; }, }, + { + label: '关联用户', + field: 'userId', + component: 'JSearchSelect', + componentProps:{ + dict:"han_hai_member,nick_name,id" + }, + }, ]; +//子表单数据 +//子表表格配置 +export const studytourImageContentColumns: JVxeColumn[] = [ + { + title: '图片', + key: 'image', + type: JVxeTypes.image, + token:true, + responseName:"message", + width:"200px", + placeholder: '请输入${title}', + defaultValue:'', + }, + { + title: '地址', + key: 'address', + type: JVxeTypes.input, + width:"200px", + placeholder: '请输入${title}', + defaultValue:'', + }, + { + title: '关联用户', + key: 'userId', + type: JVxeTypes.selectSearch, + dictCode:"han_hai_member,nick_name,id", + width:"200px", + placeholder: '请输入${title}', + defaultValue:'', + }, + ] diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vue3/StudytourImageList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vue3/StudytourImageList.vue index e647e24..a01821d 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vue3/StudytourImageList.vue +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/studytourImage/vue3/StudytourImageList.vue @@ -42,15 +42,15 @@