From c5a664ec6b1280195dcb691dad03c7431a1daec1 Mon Sep 17 00:00:00 2001 From: lzx_win <2602107437@qq.com> Date: Tue, 5 Nov 2024 00:56:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CityActivityController.java | 2 +- .../modules/cityActivity/entity/CityActivity.java | 103 ++++++++-- .../cityActivity/mapper/CityActivityMapper.java | 2 +- .../cityActivity/service/ICityActivityService.java | 2 +- .../service/impl/CityActivityServiceImpl.java | 2 +- .../modules/cityActivity/vue/CityActivityList.vue | 147 ++++++++++---- .../cityActivity/vue/modules/CityActivityForm.vue | 102 ++++++++-- .../modules/cityActivity/vue3/CityActivity.data.ts | 213 +++++++++++++++++---- .../controller/CityActivityTypeController.java | 171 +++++++++++++++++ .../cityActivityType/entity/CityActivityType.java | 54 ++++++ .../mapper/CityActivityTypeMapper.java | 17 ++ .../mapper/xml/CityActivityTypeMapper.xml | 5 + .../service/ICityActivityTypeService.java | 14 ++ .../service/impl/CityActivityTypeServiceImpl.java | 19 ++ .../cityActivityType/vue/CityActivityTypeList.vue | 171 +++++++++++++++++ .../vue/modules/CityActivityTypeForm.vue | 104 ++++++++++ .../modules/CityActivityTypeModal.Style#Drawer.vue | 84 ++++++++ .../vue/modules/CityActivityTypeModal.vue | 60 ++++++ .../cityActivityType/vue3/CityActivityType.api.ts | 61 ++++++ .../cityActivityType/vue3/CityActivityType.data.ts | 23 +++ .../cityActivityType/vue3/CityActivityTypeList.vue | 162 ++++++++++++++++ .../vue3/components/CityActivityTypeModal.vue | 58 ++++++ .../cityJd/controller/CityJdController.java | 32 ++-- .../org/jeecg/modules/cityJd/entity/CityJd.java | 6 +- .../jeecg/modules/cityJd/mapper/CityJdMapper.java | 4 +- .../modules/cityJd/service/ICityJdService.java | 4 +- .../cityJd/service/impl/CityJdServiceImpl.java | 4 +- .../org/jeecg/modules/cityJd/vue/CityJdList.vue | 4 +- .../org/jeecg/modules/cityJd/vue3/CityJdList.vue | 4 +- .../api/bean/WeChatTemplateMessageSender.java | 77 ++++++++ .../jeecg/modules/api/service/YaoDuApiService.java | 5 + .../api/service/impl/YaoDuApiServiceImpl.java | 138 ++++++++++++- .../modules/api/yaoduapi/YaoDuApiController.java | 17 ++ 33 files changed, 1736 insertions(+), 135 deletions(-) create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/controller/CityActivityTypeController.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/entity/CityActivityType.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/mapper/CityActivityTypeMapper.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/mapper/xml/CityActivityTypeMapper.xml create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/service/ICityActivityTypeService.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/service/impl/CityActivityTypeServiceImpl.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/CityActivityTypeList.vue create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/modules/CityActivityTypeForm.vue create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/modules/CityActivityTypeModal.Style#Drawer.vue create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/modules/CityActivityTypeModal.vue create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/CityActivityType.api.ts create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/CityActivityType.data.ts create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/CityActivityTypeList.vue create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/components/CityActivityTypeModal.vue create mode 100644 jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/bean/WeChatTemplateMessageSender.java diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/controller/CityActivityController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/controller/CityActivityController.java index dada239..593dff9 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/controller/CityActivityController.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/controller/CityActivityController.java @@ -39,7 +39,7 @@ import org.jeecg.common.aspect.annotation.AutoLog; /** * @Description: 活动信息表 * @Author: jeecg-boot - * @Date: 2024-10-14 + * @Date: 2024-10-31 * @Version: V1.0 */ @Api(tags="活动信息表") diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/entity/CityActivity.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/entity/CityActivity.java index 884bf49..5100271 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/entity/CityActivity.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/entity/CityActivity.java @@ -20,7 +20,7 @@ import lombok.experimental.Accessors; /** * @Description: 活动信息表 * @Author: jeecg-boot - * @Date: 2024-10-14 + * @Date: 2024-10-31 * @Version: V1.0 */ @Data @@ -31,53 +31,120 @@ import lombok.experimental.Accessors; public class CityActivity implements Serializable { private static final long serialVersionUID = 1L; - /**主键*/ + /**id*/ @TableId(type = IdType.ASSIGN_ID) - @ApiModelProperty(value = "主键") + @ApiModelProperty(value = "id") private java.lang.String id; /**创建人*/ @ApiModelProperty(value = "创建人") private java.lang.String createBy; /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") @ApiModelProperty(value = "创建日期") private java.util.Date createTime; /**更新人*/ @ApiModelProperty(value = "更新人") private java.lang.String updateBy; /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") @ApiModelProperty(value = "更新日期") private java.util.Date updateTime; - /**标题*/ - @Excel(name = "标题", width = 15) - @ApiModelProperty(value = "标题") + /**帖子内容*/ + @Excel(name = "帖子内容", width = 15) + @ApiModelProperty(value = "帖子内容") private java.lang.String title; /**图片*/ @Excel(name = "图片", width = 15) @ApiModelProperty(value = "图片") private java.lang.String image; /**发布人*/ - @Excel(name = "发布人", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") - @Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") + @Excel(name = "发布人", width = 15) @ApiModelProperty(value = "发布人") private java.lang.String userId; - /**审核状态*/ - @Excel(name = "审核状态", width = 15) - @ApiModelProperty(value = "审核状态") - private java.lang.Integer isState; - /**发布人名称*/ - @Excel(name = "发布人名称", width = 15) - @ApiModelProperty(value = "发布人名称") - private java.lang.String userName; /**发布人头像*/ @Excel(name = "发布人头像", width = 15) @ApiModelProperty(value = "发布人头像") private java.lang.String userImage; + /**发布昵称*/ + @Excel(name = "发布昵称", width = 15) + @ApiModelProperty(value = "发布昵称") + private java.lang.String userName; + /**审核状态*/ + @Excel(name = "审核状态", width = 15) + @ApiModelProperty(value = "审核状态") + private java.lang.Integer isState; + /**置顶*/ + @Excel(name = "置顶", width = 15) + @ApiModelProperty(value = "置顶") + private java.lang.String isTop; + /**分类*/ + @Excel(name = "分类", width = 15) + @ApiModelProperty(value = "分类") + private java.lang.String classId; /**浏览量*/ @Excel(name = "浏览量", width = 15) @ApiModelProperty(value = "浏览量") - private java.lang.Integer browseNum; + private java.lang.Integer isBrowse; + /**踩量*/ + @Excel(name = "踩量", width = 15) + @ApiModelProperty(value = "踩量") + private java.lang.Integer isDown; + /**点赞量*/ + @Excel(name = "点赞量", width = 15) + @ApiModelProperty(value = "点赞量") + private java.lang.Integer isUp; /**评论量*/ @Excel(name = "评论量", width = 15) @ApiModelProperty(value = "评论量") - private java.lang.Integer commentNum; + private java.lang.Integer isComment; + /**所属区域*/ + @Excel(name = "所属区域", width = 15) + @ApiModelProperty(value = "所属区域") + private java.lang.String addId; + /**详细地址*/ + @Excel(name = "详细地址", width = 15) + @ApiModelProperty(value = "详细地址") + private java.lang.String address; + /**纬度*/ + @Excel(name = "纬度", width = 15) + @ApiModelProperty(value = "纬度") + private java.lang.String latitude; + /**经度*/ + @Excel(name = "经度", width = 15) + @ApiModelProperty(value = "经度") + private java.lang.String longitude; + /**认证方式*/ + @Excel(name = "认证方式", width = 15) + @ApiModelProperty(value = "认证方式") + private java.lang.String isContent; + /**性别*/ + @Excel(name = "性别", width = 15) + @ApiModelProperty(value = "性别") + private java.lang.String sex; + /**多少年*/ + @Excel(name = "多少年", width = 15) + @ApiModelProperty(value = "多少年") + private java.lang.Integer yearDate; + /**联系方式*/ + @Excel(name = "联系方式", width = 15) + @ApiModelProperty(value = "联系方式") + private java.lang.String phone; + /**j价格*/ + @Excel(name = "j价格", width = 15) + @ApiModelProperty(value = "j价格") + private java.math.BigDecimal price; + /**总人数*/ + @Excel(name = "总人数", width = 15) + @ApiModelProperty(value = "总人数") + private java.lang.Integer sum; + /**参与人数*/ + @Excel(name = "参与人数", width = 15) + @ApiModelProperty(value = "参与人数") + private java.lang.Integer num; + /**活动类型*/ + @Excel(name = "活动类型", width = 15) + @ApiModelProperty(value = "活动类型") + private java.lang.String type; } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/mapper/CityActivityMapper.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/mapper/CityActivityMapper.java index bf5a87b..8a270d4 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/mapper/CityActivityMapper.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/mapper/CityActivityMapper.java @@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * @Description: 活动信息表 * @Author: jeecg-boot - * @Date: 2024-10-14 + * @Date: 2024-10-31 * @Version: V1.0 */ public interface CityActivityMapper extends BaseMapper { diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/service/ICityActivityService.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/service/ICityActivityService.java index 87ed99f..57b6e54 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/service/ICityActivityService.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/service/ICityActivityService.java @@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService; /** * @Description: 活动信息表 * @Author: jeecg-boot - * @Date: 2024-10-14 + * @Date: 2024-10-31 * @Version: V1.0 */ public interface ICityActivityService extends IService { diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/service/impl/CityActivityServiceImpl.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/service/impl/CityActivityServiceImpl.java index e05c66f..b681277 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/service/impl/CityActivityServiceImpl.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/service/impl/CityActivityServiceImpl.java @@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; /** * @Description: 活动信息表 * @Author: jeecg-boot - * @Date: 2024-10-14 + * @Date: 2024-10-31 * @Version: V1.0 */ @Service diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/vue/CityActivityList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/vue/CityActivityList.vue index b8e5efc..25d3447 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/vue/CityActivityList.vue +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/vue/CityActivityList.vue @@ -4,21 +4,6 @@
- - - - - - - - 查询 - 重置 - - {{ toggleSearchStatus ? '收起' : '展开' }} - - - -
@@ -114,7 +99,6 @@ import { mixinDevice } from '@/utils/mixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin' import CityActivityModal from './modules/CityActivityModal' - import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' export default { name: 'CityActivityList', @@ -138,13 +122,7 @@ } }, { - title:'创建日期', - align:"center", - sorter: true, - dataIndex: 'createTime' - }, - { - title:'标题', + title:'帖子内容', align:"center", dataIndex: 'title' }, @@ -159,31 +137,111 @@ align:"center", dataIndex: 'userId_dictText' }, + { + title:'发布人头像', + align:"center", + dataIndex: 'userImage', + scopedSlots: {customRender: 'imgSlot'} + }, + { + title:'发布昵称', + align:"center", + dataIndex: 'userName' + }, { title:'审核状态', align:"center", dataIndex: 'isState' }, { - title:'发布人名称', + title:'置顶', align:"center", - dataIndex: 'userName' + dataIndex: 'isTop' }, { - title:'发布人头像', + title:'分类', align:"center", - dataIndex: 'userImage', - scopedSlots: {customRender: 'imgSlot'} + dataIndex: 'classId' }, { title:'浏览量', align:"center", - dataIndex: 'browseNum' + dataIndex: 'isBrowse' + }, + { + title:'踩量', + align:"center", + dataIndex: 'isDown' + }, + { + title:'点赞量', + align:"center", + dataIndex: 'isUp' }, { title:'评论量', align:"center", - dataIndex: 'commentNum' + dataIndex: 'isComment' + }, + { + title:'所属区域', + align:"center", + dataIndex: 'addId' + }, + { + title:'详细地址', + align:"center", + dataIndex: 'address' + }, + { + title:'纬度', + align:"center", + dataIndex: 'latitude' + }, + { + title:'经度', + align:"center", + dataIndex: 'longitude' + }, + { + title:'认证方式', + align:"center", + dataIndex: 'isContent' + }, + { + title:'性别', + align:"center", + dataIndex: 'sex' + }, + { + title:'多少年', + align:"center", + dataIndex: 'yearDate' + }, + { + title:'联系方式', + align:"center", + dataIndex: 'phone' + }, + { + title:'j价格', + align:"center", + dataIndex: 'price' + }, + { + title:'总人数', + align:"center", + dataIndex: 'sum' + }, + { + title:'参与人数', + align:"center", + dataIndex: 'num' + }, + { + title:'活动类型', + align:"center", + dataIndex: 'type' }, { title: '操作', @@ -219,15 +277,30 @@ }, getSuperFieldList(){ let fieldList=[]; - fieldList.push({type:'datetime',value:'createTime',text:'创建日期'}) - fieldList.push({type:'Text',value:'title',text:'标题',dictCode:''}) + fieldList.push({type:'Text',value:'title',text:'帖子内容',dictCode:''}) fieldList.push({type:'Text',value:'image',text:'图片',dictCode:''}) - fieldList.push({type:'sel_search',value:'userId',text:'发布人',dictTable:"han_hai_member", dictText:'nick_name', dictCode:'id'}) - fieldList.push({type:'int',value:'isState',text:'审核状态',dictCode:''}) - fieldList.push({type:'string',value:'userName',text:'发布人名称',dictCode:''}) + fieldList.push({type:'sel_search',value:'userId',text:'发布人',dictTable:"", dictText:'', dictCode:''}) fieldList.push({type:'Text',value:'userImage',text:'发布人头像',dictCode:''}) - fieldList.push({type:'int',value:'browseNum',text:'浏览量',dictCode:''}) - fieldList.push({type:'int',value:'commentNum',text:'评论量',dictCode:''}) + fieldList.push({type:'string',value:'userName',text:'发布昵称',dictCode:''}) + fieldList.push({type:'int',value:'isState',text:'审核状态',dictCode:''}) + fieldList.push({type:'string',value:'isTop',text:'置顶',dictCode:''}) + fieldList.push({type:'string',value:'classId',text:'分类',dictCode:''}) + fieldList.push({type:'int',value:'isBrowse',text:'浏览量',dictCode:''}) + fieldList.push({type:'int',value:'isDown',text:'踩量',dictCode:''}) + fieldList.push({type:'int',value:'isUp',text:'点赞量',dictCode:''}) + fieldList.push({type:'int',value:'isComment',text:'评论量',dictCode:''}) + fieldList.push({type:'string',value:'addId',text:'所属区域',dictCode:''}) + fieldList.push({type:'Text',value:'address',text:'详细地址',dictCode:''}) + fieldList.push({type:'string',value:'latitude',text:'纬度',dictCode:''}) + fieldList.push({type:'string',value:'longitude',text:'经度',dictCode:''}) + fieldList.push({type:'string',value:'isContent',text:'认证方式',dictCode:''}) + fieldList.push({type:'string',value:'sex',text:'性别',dictCode:''}) + fieldList.push({type:'int',value:'yearDate',text:'多少年',dictCode:''}) + fieldList.push({type:'string',value:'phone',text:'联系方式',dictCode:''}) + fieldList.push({type:'BigDecimal',value:'price',text:'j价格',dictCode:''}) + fieldList.push({type:'int',value:'sum',text:'总人数',dictCode:''}) + fieldList.push({type:'int',value:'num',text:'参与人数',dictCode:''}) + fieldList.push({type:'string',value:'type',text:'活动类型',dictCode:''}) this.superFieldList = fieldList } } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/vue/modules/CityActivityForm.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/vue/modules/CityActivityForm.vue index f02a925..8c79b8d 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/vue/modules/CityActivityForm.vue +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/vue/modules/CityActivityForm.vue @@ -4,8 +4,8 @@ - - + + @@ -15,7 +15,17 @@ - + + + + + + + + + + + @@ -24,23 +34,93 @@ - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/vue3/CityActivity.data.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/vue3/CityActivity.data.ts index fb52342..eaaafc5 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/vue3/CityActivity.data.ts +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/vue3/CityActivity.data.ts @@ -5,13 +5,7 @@ import { render } from '/@/utils/common/renderUtils'; //列表数据 export const columns: BasicColumn[] = [ { - title: '创建日期', - align:"center", - sorter: true, - dataIndex: 'createTime' - }, - { - title: '标题', + title: '帖子内容', align:"center", dataIndex: 'title' }, @@ -26,49 +20,120 @@ export const columns: BasicColumn[] = [ align:"center", dataIndex: 'userId_dictText' }, + { + title: '发布人头像', + align:"center", + dataIndex: 'userImage', + customRender:render.renderAvatar, + }, + { + title: '发布昵称', + align:"center", + dataIndex: 'userName' + }, { title: '审核状态', align:"center", dataIndex: 'isState' }, { - title: '发布人名称', + title: '置顶', align:"center", - dataIndex: 'userName' + dataIndex: 'isTop' }, { - title: '发布人头像', + title: '分类', align:"center", - dataIndex: 'userImage', - customRender:render.renderAvatar, + dataIndex: 'classId' }, { title: '浏览量', align:"center", - dataIndex: 'browseNum' + dataIndex: 'isBrowse' + }, + { + title: '踩量', + align:"center", + dataIndex: 'isDown' + }, + { + title: '点赞量', + align:"center", + dataIndex: 'isUp' }, { title: '评论量', align:"center", - dataIndex: 'commentNum' + dataIndex: 'isComment' + }, + { + title: '所属区域', + align:"center", + dataIndex: 'addId' + }, + { + title: '详细地址', + align:"center", + dataIndex: 'address' + }, + { + title: '纬度', + align:"center", + dataIndex: 'latitude' + }, + { + title: '经度', + align:"center", + dataIndex: 'longitude' + }, + { + title: '认证方式', + align:"center", + dataIndex: 'isContent' + }, + { + title: '性别', + align:"center", + dataIndex: 'sex' + }, + { + title: '多少年', + align:"center", + dataIndex: 'yearDate' + }, + { + title: '联系方式', + align:"center", + dataIndex: 'phone' + }, + { + title: 'j价格', + align:"center", + dataIndex: 'price' + }, + { + title: '总人数', + align:"center", + dataIndex: 'sum' + }, + { + title: '参与人数', + align:"center", + dataIndex: 'num' + }, + { + title: '活动类型', + align:"center", + dataIndex: 'type' }, ]; //查询数据 export const searchFormSchema: FormSchema[] = [ - { - label: "发布人", - field: "userId", - component: 'JSearchSelect', - componentProps:{ - dict:"han_hai_member,nick_name,id" - }, - colProps: {span: 6}, - }, ]; //表单数据 export const formSchema: FormSchema[] = [ { - label: '标题', + label: '帖子内容', field: 'title', component: 'InputTextArea',//TODO 注意string转换问题 }, @@ -84,34 +149,114 @@ export const formSchema: FormSchema[] = [ field: 'userId', component: 'JSearchSelect', componentProps:{ - dict:"han_hai_member,nick_name,id" + dict:"" }, }, + { + label: '发布人头像', + field: 'userImage', + component: 'JImageUpload', + componentProps:{ + }, + }, + { + label: '发布昵称', + field: 'userName', + component: 'Input', + }, { label: '审核状态', field: 'isState', component: 'InputNumber', }, { - label: '发布人名称', - field: 'userName', + label: '置顶', + field: 'isTop', component: 'Input', }, { - label: '发布人头像', - field: 'userImage', - component: 'JImageUpload', - componentProps:{ - }, + label: '分类', + field: 'classId', + component: 'Input', }, { label: '浏览量', - field: 'browseNum', + field: 'isBrowse', + component: 'InputNumber', + }, + { + label: '踩量', + field: 'isDown', + component: 'InputNumber', + }, + { + label: '点赞量', + field: 'isUp', component: 'InputNumber', }, { label: '评论量', - field: 'commentNum', + field: 'isComment', + component: 'InputNumber', + }, + { + label: '所属区域', + field: 'addId', + component: 'Input', + }, + { + label: '详细地址', + field: 'address', + component: 'InputTextArea',//TODO 注意string转换问题 + }, + { + label: '纬度', + field: 'latitude', + component: 'Input', + }, + { + label: '经度', + field: 'longitude', + component: 'Input', + }, + { + label: '认证方式', + field: 'isContent', + component: 'Input', + }, + { + label: '性别', + field: 'sex', + component: 'Input', + }, + { + label: '多少年', + field: 'yearDate', component: 'InputNumber', }, + { + label: '联系方式', + field: 'phone', + component: 'Input', + }, + { + label: 'j价格', + field: 'price', + component: 'InputNumber', + }, + { + label: '总人数', + field: 'sum', + component: 'InputNumber', + }, + { + label: '参与人数', + field: 'num', + component: 'InputNumber', + }, + { + label: '活动类型', + field: 'type', + component: 'Input', + }, ]; diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/controller/CityActivityTypeController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/controller/CityActivityTypeController.java new file mode 100644 index 0000000..1afbc00 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/controller/CityActivityTypeController.java @@ -0,0 +1,171 @@ +package org.jeecg.modules.cityActivityType.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.cityActivityType.entity.CityActivityType; +import org.jeecg.modules.cityActivityType.service.ICityActivityTypeService; + +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-10-31 + * @Version: V1.0 + */ +@Api(tags="活动类型") +@RestController +@RequestMapping("/cityActivityType/cityActivityType") +@Slf4j +public class CityActivityTypeController extends JeecgController { + @Autowired + private ICityActivityTypeService cityActivityTypeService; + + /** + * 分页列表查询 + * + * @param cityActivityType + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "活动类型-分页列表查询") + @ApiOperation(value="活动类型-分页列表查询", notes="活动类型-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(CityActivityType cityActivityType, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(cityActivityType, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = cityActivityTypeService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param cityActivityType + * @return + */ + @AutoLog(value = "活动类型-添加") + @ApiOperation(value="活动类型-添加", notes="活动类型-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody CityActivityType cityActivityType) { + cityActivityTypeService.save(cityActivityType); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param cityActivityType + * @return + */ + @AutoLog(value = "活动类型-编辑") + @ApiOperation(value="活动类型-编辑", notes="活动类型-编辑") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody CityActivityType cityActivityType) { + cityActivityTypeService.updateById(cityActivityType); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "活动类型-通过id删除") + @ApiOperation(value="活动类型-通过id删除", notes="活动类型-通过id删除") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + cityActivityTypeService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "活动类型-批量删除") + @ApiOperation(value="活动类型-批量删除", notes="活动类型-批量删除") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.cityActivityTypeService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "活动类型-通过id查询") + @ApiOperation(value="活动类型-通过id查询", notes="活动类型-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + CityActivityType cityActivityType = cityActivityTypeService.getById(id); + if(cityActivityType==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(cityActivityType); + } + + /** + * 导出excel + * + * @param request + * @param cityActivityType + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, CityActivityType cityActivityType) { + return super.exportXls(request, cityActivityType, CityActivityType.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, CityActivityType.class); + } + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/entity/CityActivityType.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/entity/CityActivityType.java new file mode 100644 index 0000000..20af29f --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/entity/CityActivityType.java @@ -0,0 +1,54 @@ +package org.jeecg.modules.cityActivityType.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-10-31 + * @Version: V1.0 + */ +@Data +@TableName("city_activity_type") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="city_activity_type对象", description="活动类型") +public class CityActivityType 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 name; +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/mapper/CityActivityTypeMapper.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/mapper/CityActivityTypeMapper.java new file mode 100644 index 0000000..4fea39a --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/mapper/CityActivityTypeMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.cityActivityType.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.cityActivityType.entity.CityActivityType; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 活动类型 + * @Author: jeecg-boot + * @Date: 2024-10-31 + * @Version: V1.0 + */ +public interface CityActivityTypeMapper extends BaseMapper { + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/mapper/xml/CityActivityTypeMapper.xml b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/mapper/xml/CityActivityTypeMapper.xml new file mode 100644 index 0000000..7cdddfe --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/mapper/xml/CityActivityTypeMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/service/ICityActivityTypeService.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/service/ICityActivityTypeService.java new file mode 100644 index 0000000..b480b40 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/service/ICityActivityTypeService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.cityActivityType.service; + +import org.jeecg.modules.cityActivityType.entity.CityActivityType; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 活动类型 + * @Author: jeecg-boot + * @Date: 2024-10-31 + * @Version: V1.0 + */ +public interface ICityActivityTypeService extends IService { + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/service/impl/CityActivityTypeServiceImpl.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/service/impl/CityActivityTypeServiceImpl.java new file mode 100644 index 0000000..39ab757 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/service/impl/CityActivityTypeServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.cityActivityType.service.impl; + +import org.jeecg.modules.cityActivityType.entity.CityActivityType; +import org.jeecg.modules.cityActivityType.mapper.CityActivityTypeMapper; +import org.jeecg.modules.cityActivityType.service.ICityActivityTypeService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 活动类型 + * @Author: jeecg-boot + * @Date: 2024-10-31 + * @Version: V1.0 + */ +@Service +public class CityActivityTypeServiceImpl extends ServiceImpl implements ICityActivityTypeService { + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/CityActivityTypeList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/CityActivityTypeList.vue new file mode 100644 index 0000000..24ddada --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/CityActivityTypeList.vue @@ -0,0 +1,171 @@ + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/modules/CityActivityTypeForm.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/modules/CityActivityTypeForm.vue new file mode 100644 index 0000000..b147b71 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/modules/CityActivityTypeForm.vue @@ -0,0 +1,104 @@ + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/modules/CityActivityTypeModal.Style#Drawer.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/modules/CityActivityTypeModal.Style#Drawer.vue new file mode 100644 index 0000000..d4d293e --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/modules/CityActivityTypeModal.Style#Drawer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/modules/CityActivityTypeModal.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/modules/CityActivityTypeModal.vue new file mode 100644 index 0000000..ab167ef --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/modules/CityActivityTypeModal.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/CityActivityType.api.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/CityActivityType.api.ts new file mode 100644 index 0000000..b436d50 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/CityActivityType.api.ts @@ -0,0 +1,61 @@ +import {defHttp} from '/@/utils/http/axios'; +import {Modal} from 'ant-design-vue'; + +enum Api { + list = '/cityActivityType/cityActivityType/list', + save='/cityActivityType/cityActivityType/add', + edit='/cityActivityType/cityActivityType/edit', + deleteOne = '/cityActivityType/cityActivityType/delete', + deleteBatch = '/cityActivityType/cityActivityType/deleteBatch', + importExcel = '/cityActivityType/cityActivityType/importExcel', + exportXls = '/cityActivityType/cityActivityType/exportXls', +} +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; +/** + * 列表接口 + * @param params + */ +export const list = (params) => + defHttp.get({url: Api.list, params}); + +/** + * 删除单个 + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} +/** + * 批量删除 + * @param params + */ +export const batchDelete = (params, handleSuccess) => { + Modal.confirm({ + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} +/** + * 保存或者更新 + * @param params + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({url: url, params}); +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/CityActivityType.data.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/CityActivityType.data.ts new file mode 100644 index 0000000..0a35023 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/CityActivityType.data.ts @@ -0,0 +1,23 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '活动类型', + align:"center", + dataIndex: 'name' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '活动类型', + field: 'name', + component: 'Input', + }, +]; diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/CityActivityTypeList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/CityActivityTypeList.vue new file mode 100644 index 0000000..99551b0 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/CityActivityTypeList.vue @@ -0,0 +1,162 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/components/CityActivityTypeModal.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/components/CityActivityTypeModal.vue new file mode 100644 index 0000000..897c2b0 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/components/CityActivityTypeModal.vue @@ -0,0 +1,58 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/controller/CityJdController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/controller/CityJdController.java index 26b52c3..77801d5 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/controller/CityJdController.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/controller/CityJdController.java @@ -37,12 +37,12 @@ import io.swagger.annotations.ApiOperation; import org.jeecg.common.aspect.annotation.AutoLog; /** - * @Description: 城市景点 + * @Description: 景点列表 * @Author: jeecg-boot - * @Date: 2024-10-27 + * @Date: 2024-10-31 * @Version: V1.0 */ -@Api(tags="城市景点") +@Api(tags="景点列表") @RestController @RequestMapping("/cityJd/cityJd") @Slf4j @@ -59,8 +59,8 @@ public class CityJdController extends JeecgController { * @param req * @return */ - //@AutoLog(value = "城市景点-分页列表查询") - @ApiOperation(value="城市景点-分页列表查询", notes="城市景点-分页列表查询") + //@AutoLog(value = "景点列表-分页列表查询") + @ApiOperation(value="景点列表-分页列表查询", notes="景点列表-分页列表查询") @GetMapping(value = "/list") public Result> queryPageList(CityJd cityJd, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @@ -78,8 +78,8 @@ public class CityJdController extends JeecgController { * @param cityJd * @return */ - @AutoLog(value = "城市景点-添加") - @ApiOperation(value="城市景点-添加", notes="城市景点-添加") + @AutoLog(value = "景点列表-添加") + @ApiOperation(value="景点列表-添加", notes="景点列表-添加") @PostMapping(value = "/add") public Result add(@RequestBody CityJd cityJd) { cityJdService.save(cityJd); @@ -92,8 +92,8 @@ public class CityJdController extends JeecgController { * @param cityJd * @return */ - @AutoLog(value = "城市景点-编辑") - @ApiOperation(value="城市景点-编辑", notes="城市景点-编辑") + @AutoLog(value = "景点列表-编辑") + @ApiOperation(value="景点列表-编辑", notes="景点列表-编辑") @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) public Result edit(@RequestBody CityJd cityJd) { cityJdService.updateById(cityJd); @@ -106,8 +106,8 @@ public class CityJdController extends JeecgController { * @param id * @return */ - @AutoLog(value = "城市景点-通过id删除") - @ApiOperation(value="城市景点-通过id删除", notes="城市景点-通过id删除") + @AutoLog(value = "景点列表-通过id删除") + @ApiOperation(value="景点列表-通过id删除", notes="景点列表-通过id删除") @DeleteMapping(value = "/delete") public Result delete(@RequestParam(name="id",required=true) String id) { cityJdService.removeById(id); @@ -120,8 +120,8 @@ public class CityJdController extends JeecgController { * @param ids * @return */ - @AutoLog(value = "城市景点-批量删除") - @ApiOperation(value="城市景点-批量删除", notes="城市景点-批量删除") + @AutoLog(value = "景点列表-批量删除") + @ApiOperation(value="景点列表-批量删除", notes="景点列表-批量删除") @DeleteMapping(value = "/deleteBatch") public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { this.cityJdService.removeByIds(Arrays.asList(ids.split(","))); @@ -134,8 +134,8 @@ public class CityJdController extends JeecgController { * @param id * @return */ - //@AutoLog(value = "城市景点-通过id查询") - @ApiOperation(value="城市景点-通过id查询", notes="城市景点-通过id查询") + //@AutoLog(value = "景点列表-通过id查询") + @ApiOperation(value="景点列表-通过id查询", notes="景点列表-通过id查询") @GetMapping(value = "/queryById") public Result queryById(@RequestParam(name="id",required=true) String id) { CityJd cityJd = cityJdService.getById(id); @@ -153,7 +153,7 @@ public class CityJdController extends JeecgController { */ @RequestMapping(value = "/exportXls") public ModelAndView exportXls(HttpServletRequest request, CityJd cityJd) { - return super.exportXls(request, cityJd, CityJd.class, "城市景点"); + return super.exportXls(request, cityJd, CityJd.class, "景点列表"); } /** diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/entity/CityJd.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/entity/CityJd.java index 6eefb57..11883a3 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/entity/CityJd.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/entity/CityJd.java @@ -18,16 +18,16 @@ import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; /** - * @Description: 城市景点 + * @Description: 景点列表 * @Author: jeecg-boot - * @Date: 2024-10-27 + * @Date: 2024-10-31 * @Version: V1.0 */ @Data @TableName("city_jd") @Accessors(chain = true) @EqualsAndHashCode(callSuper = false) -@ApiModel(value="city_jd对象", description="城市景点") +@ApiModel(value="city_jd对象", description="景点列表") public class CityJd implements Serializable { private static final long serialVersionUID = 1L; diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/mapper/CityJdMapper.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/mapper/CityJdMapper.java index 9d9135e..5302395 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/mapper/CityJdMapper.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/mapper/CityJdMapper.java @@ -7,9 +7,9 @@ import org.jeecg.modules.cityJd.entity.CityJd; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** - * @Description: 城市景点 + * @Description: 景点列表 * @Author: jeecg-boot - * @Date: 2024-10-27 + * @Date: 2024-10-31 * @Version: V1.0 */ public interface CityJdMapper extends BaseMapper { diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/service/ICityJdService.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/service/ICityJdService.java index 585db70..224ba8a 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/service/ICityJdService.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/service/ICityJdService.java @@ -4,9 +4,9 @@ import org.jeecg.modules.cityJd.entity.CityJd; import com.baomidou.mybatisplus.extension.service.IService; /** - * @Description: 城市景点 + * @Description: 景点列表 * @Author: jeecg-boot - * @Date: 2024-10-27 + * @Date: 2024-10-31 * @Version: V1.0 */ public interface ICityJdService extends IService { diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/service/impl/CityJdServiceImpl.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/service/impl/CityJdServiceImpl.java index 16ad7ff..0694a11 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/service/impl/CityJdServiceImpl.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/service/impl/CityJdServiceImpl.java @@ -8,9 +8,9 @@ import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; /** - * @Description: 城市景点 + * @Description: 景点列表 * @Author: jeecg-boot - * @Date: 2024-10-27 + * @Date: 2024-10-31 * @Version: V1.0 */ @Service diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/vue/CityJdList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/vue/CityJdList.vue index 8532bc7..6a18abb 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/vue/CityJdList.vue +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/vue/CityJdList.vue @@ -12,7 +12,7 @@
新增 - 导出 + 导出 导入 @@ -108,7 +108,7 @@ }, data () { return { - description: '城市景点管理页面', + description: '景点列表管理页面', // 表头 columns: [ { diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/vue3/CityJdList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/vue3/CityJdList.vue index e5cbf0f..23a8c26 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/vue3/CityJdList.vue +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/vue3/CityJdList.vue @@ -53,7 +53,7 @@ //注册table数据 const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({ tableProps:{ - title: '城市景点', + title: '景点列表', api: list, columns, canResize:false, @@ -70,7 +70,7 @@ }, }, exportConfig: { - name:"城市景点", + name:"景点列表", url: getExportUrl, }, importConfig: { diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/bean/WeChatTemplateMessageSender.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/bean/WeChatTemplateMessageSender.java new file mode 100644 index 0000000..8c4d338 --- /dev/null +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/bean/WeChatTemplateMessageSender.java @@ -0,0 +1,77 @@ +package org.jeecg.modules.api.bean; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +@Component +public class WeChatTemplateMessageSender { + + private static final String APP_ID = "wxa4d29e67e8a58d38"; + private static final String APP_SECRET = "866e4ba72bd86a4c79403b6b1341461b"; + private static final String TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + APP_ID + "&secret=" + APP_SECRET; + private static final String TEMPLATE_MESSAGE_URL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="; +// +// public static void main(String[] args) throws IOException { +// String accessToken = getAccessToken(); +// sendTemplateMessage(accessToken, "user_open_id", "template_id", new HashMap() {{ +// put("first", new HashMap() {{ +// put("value", "Hello, this is a test message!"); +// put("color", "#173177"); +// }}); +// put("keyword1", new HashMap() {{ +// put("value", "Keyword1 Value"); +// put("color", "#173177"); +// }}); +// put("keyword2", new HashMap() {{ +// put("value", "Keyword2 Value"); +// put("color", "#173177"); +// }}); +// put("remark", new HashMap() {{ +// put("value", "This is a remark."); +// put("color", "#173177"); +// }}); +// }}); +// } + + private static String getAccessToken() throws IOException { + try (CloseableHttpClient httpClient = HttpClients.createDefault()) { + HttpPost httpPost = new HttpPost(TOKEN_URL); + CloseableHttpResponse response = httpClient.execute(httpPost); + String responseString = EntityUtils.toString(response.getEntity()); + Map responseMap = new ObjectMapper().readValue(responseString, Map.class); + return (String) responseMap.get("access_token"); + } + } + + private static void sendTemplateMessage(String accessToken, String toUser, String templateId, Map data) throws IOException { + String url = TEMPLATE_MESSAGE_URL + accessToken; + + Map requestBody = new HashMap<>(); + requestBody.put("touser", toUser); + requestBody.put("template_id", templateId); + requestBody.put("data", data); + + ObjectMapper objectMapper = new ObjectMapper(); + String jsonRequest = objectMapper.writeValueAsString(requestBody); + + try (CloseableHttpClient httpClient = HttpClients.createDefault()) { + HttpPost httpPost = new HttpPost(url); + httpPost.setEntity(new StringEntity(jsonRequest, "UTF-8")); + httpPost.setHeader("Content-Type", "application/json"); + + CloseableHttpResponse response = httpClient.execute(httpPost); + String responseString = EntityUtils.toString(response.getEntity()); + System.out.println("Response: " + responseString); + } + } +} \ No newline at end of file diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/YaoDuApiService.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/YaoDuApiService.java index 8815e0c..0567f4d 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/YaoDuApiService.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/YaoDuApiService.java @@ -168,6 +168,11 @@ public interface YaoDuApiService { //发布车找人信息 Result publishCat(String token, CityCat cat); + //模板消息通知 + Result sendTemplateMessage(String templateId,String openid); + + //获取活动类型 + Result getActivityType(); } diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/YaoDuApiServiceImpl.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/YaoDuApiServiceImpl.java index 9983a8a..2bef0dd 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/YaoDuApiServiceImpl.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/YaoDuApiServiceImpl.java @@ -7,10 +7,17 @@ import com.alibaba.fastjson.TypeReference; import com.aliyun.oss.OSS; import com.aliyun.oss.OSSClientBuilder; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.fasterxml.jackson.databind.ObjectMapper; import com.google.gson.Gson; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.lang.StringUtils; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; import org.jeecg.common.api.vo.Result; import org.jeecg.common.util.RedisUtil; import org.jeecg.config.shiro.ShiroRealm; @@ -26,6 +33,8 @@ import org.jeecg.modules.citiyUserAuthentication.entity.CitiyUserAuthentication; import org.jeecg.modules.citiyUserAuthentication.service.ICitiyUserAuthenticationService; import org.jeecg.modules.cityActivity.entity.CityActivity; import org.jeecg.modules.cityActivity.service.ICityActivityService; +import org.jeecg.modules.cityActivityType.entity.CityActivityType; +import org.jeecg.modules.cityActivityType.service.ICityActivityTypeService; import org.jeecg.modules.cityAdd.entity.CityAdd; import org.jeecg.modules.cityAdd.service.ICityAddService; import org.jeecg.modules.cityAddr.entity.CityAddr; @@ -150,6 +159,12 @@ public class YaoDuApiServiceImpl implements YaoDuApiService { @Value("${jeecg.oss.bucketName}") private String bucketName; + private static final String APP_ID = "wxa4d29e67e8a58d38"; + private static final String APP_SECRET = "866e4ba72bd86a4c79403b6b1341461b"; + private static final String TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + APP_ID + "&secret=" + APP_SECRET; + private static final String TEMPLATE_MESSAGE_URL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="; + + //缓存 @Resource private RedisUtil redisUtil; @@ -160,6 +175,9 @@ public class YaoDuApiServiceImpl implements YaoDuApiService { //人找车 @Resource private ICityMemberService cityMemberService; + //获取活动类型 + @Resource + private ICityActivityTypeService cityActivityTypeService; //获取个人信息接口 @Override @@ -303,8 +321,8 @@ public class YaoDuApiServiceImpl implements YaoDuApiService { } newRecords.add(cityTrends); } - //随机排序帖子列表数据,每次刷新展示的数据不同 - Collections.shuffle(newRecords); +// //随机排序帖子列表数据,每次刷新展示的数据不同 +// Collections.shuffle(newRecords); page1.setRecords(newRecords); return Result.OK(page1); @@ -425,7 +443,40 @@ public class YaoDuApiServiceImpl implements YaoDuApiService { .lambdaQuery() .orderByDesc(CityActivity::getCreateTime) .page(page); + //获取评论数量 + List records = page1.getRecords(); + //创建一个新的集合 + List newRecords = new ArrayList<>(); + for (CityActivity cityTrends : records) { + cityTrends.setIsComment(Math.toIntExact(cityCommentService.lambdaQuery().eq(CityComment::getOrderId, cityTrends.getId()).count())); + HanHaiMember one = hanHaiMemberService.lambdaQuery().eq(HanHaiMember::getId, cityTrends.getUserId()).one(); + if(StringUtils.isBlank(one.getName())){ + cityTrends.setUserName(one.getNickName()); + }else{ + cityTrends.setUserName(one.getName()); + } + cityTrends.setUserImage(one.getHeadImage()); + + //获取今年是多少年 + cityTrends.setYearDate(LocalDate.now().getYear() - one.getYearDate()); + cityTrends.setAddId(one.getAddress()); + if (one.getIdCardOpen() == null){ + cityTrends.setIsContent(""); + }else if (one.getIdCardOpen()== 1){ + cityTrends.setIsContent("个人实名"); + } else if (one.getIdCardOpen()== 2){ + cityTrends.setIsContent("店铺实名"); + }else{ + cityTrends.setIsContent(""); + } + newRecords.add(cityTrends); + } +// //随机排序帖子列表数据,每次刷新展示的数据不同 +// Collections.shuffle(newRecords); + page1.setRecords(newRecords); + return Result.OK(page1); + } @@ -871,6 +922,8 @@ public class YaoDuApiServiceImpl implements YaoDuApiService { public Result comment(String token,CityComment cityComment) { HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); + + //验证 Integer i = this.sendMsgSecCheck(hanHaiMember.getAppletOpenid(), cityComment.getUserValue()); if(i>100){ @@ -1081,4 +1134,85 @@ public class YaoDuApiServiceImpl implements YaoDuApiService { } + @Override + public Result sendTemplateMessage(String templateId, String openid) { + try { + String accessToken = getAccessToken2(); + if (accessToken != null && !accessToken.isEmpty()) { + this.sendTemplateMessage2(accessToken, openid, templateId, createTemplateData()); + return Result.OK("发送成功"); + } else { + return Result.error("无法获取Access Token"); + } + } catch (Exception e) { + e.printStackTrace(); + return Result.error("发送失败:" + e.getMessage()); + } + } + + + private Map createTemplateData() { + Map data = new HashMap<>(); + data.put("first", new HashMap() {{ + put("value", "Hello, this is a test message!"); + put("color", "#173177"); + }}); + data.put("keyword1", new HashMap() {{ + put("value", "Keyword1 Value"); + put("color", "#173177"); + }}); + data.put("keyword2", new HashMap() {{ + put("value", "Keyword2 Value"); + put("color", "#173177"); + }}); + data.put("remark", new HashMap() {{ + put("value", "This is a remark."); + put("color", "#173177"); + }}); + return data; + } + + + + public String getAccessToken2() throws IOException { + try (CloseableHttpClient httpClient = HttpClients.createDefault()) { + HttpPost httpPost = new HttpPost(TOKEN_URL); + CloseableHttpResponse response = httpClient.execute(httpPost); + String responseString = EntityUtils.toString(response.getEntity()); + Map responseMap = new ObjectMapper().readValue(responseString, Map.class); + return (String) responseMap.get("access_token"); + } + } + + + + public void sendTemplateMessage2(String accessToken, String toUser, String templateId, Map data) throws IOException { + String url = TEMPLATE_MESSAGE_URL + accessToken; + + Map requestBody = new HashMap<>(); + requestBody.put("touser", toUser); + requestBody.put("template_id", templateId); + requestBody.put("data", data); + + ObjectMapper objectMapper = new ObjectMapper(); + String jsonRequest = objectMapper.writeValueAsString(requestBody); + + try (CloseableHttpClient httpClient = HttpClients.createDefault()) { + HttpPost httpPost = new HttpPost(url); + httpPost.setEntity(new StringEntity(jsonRequest, "UTF-8")); + httpPost.setHeader("Content-Type", "application/json"); + + CloseableHttpResponse response = httpClient.execute(httpPost); + String responseString = EntityUtils.toString(response.getEntity()); + System.out.println("Response: " + responseString); + } + } + + + //获取活动类型 + @Override + public Result getActivityType() { + List list = cityActivityTypeService.list(); + return Result.OK(list); + } } diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/yaoduapi/YaoDuApiController.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/yaoduapi/YaoDuApiController.java index cd89b75..74eaec4 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/yaoduapi/YaoDuApiController.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/yaoduapi/YaoDuApiController.java @@ -225,4 +225,21 @@ public class YaoDuApiController { return yaoDuApiService.getJiangHuInfo(pageBean); } + + //模板消息通知测试 + @ApiOperation(value="模板消息通知测试") + @GetMapping(value = "/sendTemplateMessage") + public Result sendTemplateMessage() { + String templateId = "uXZnHWrjtcX9JHlnMpdlWmzgJp71sKxCRiMn3TrE-EE"; + String touser = "oFzrW4tqZUvN9T0RQzWPdCT1St68"; + return yaoDuApiService.sendTemplateMessage(templateId,touser); + } + + + //获取活动类型 + @ApiOperation(value="获取活动类型") + @GetMapping(value = "/getActivityType") + public Result getActivityType() { + return yaoDuApiService.getActivityType(); + } }