Browse Source

修复提交

master
主管理员 8 months ago
parent
commit
c5a664ec6b
33 changed files with 1736 additions and 135 deletions
  1. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/controller/CityActivityController.java
  2. +85
    -18
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/entity/CityActivity.java
  3. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/mapper/CityActivityMapper.java
  4. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/service/ICityActivityService.java
  5. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/service/impl/CityActivityServiceImpl.java
  6. +110
    -37
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/vue/CityActivityList.vue
  7. +91
    -11
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/vue/modules/CityActivityForm.vue
  8. +179
    -34
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/vue3/CityActivity.data.ts
  9. +171
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/controller/CityActivityTypeController.java
  10. +54
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/entity/CityActivityType.java
  11. +17
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/mapper/CityActivityTypeMapper.java
  12. +5
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/mapper/xml/CityActivityTypeMapper.xml
  13. +14
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/service/ICityActivityTypeService.java
  14. +19
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/service/impl/CityActivityTypeServiceImpl.java
  15. +171
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/CityActivityTypeList.vue
  16. +104
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/modules/CityActivityTypeForm.vue
  17. +84
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/modules/CityActivityTypeModal.Style#Drawer.vue
  18. +60
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/modules/CityActivityTypeModal.vue
  19. +61
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/CityActivityType.api.ts
  20. +23
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/CityActivityType.data.ts
  21. +162
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/CityActivityTypeList.vue
  22. +58
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/components/CityActivityTypeModal.vue
  23. +16
    -16
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/controller/CityJdController.java
  24. +3
    -3
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/entity/CityJd.java
  25. +2
    -2
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/mapper/CityJdMapper.java
  26. +2
    -2
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/service/ICityJdService.java
  27. +2
    -2
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/service/impl/CityJdServiceImpl.java
  28. +2
    -2
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/vue/CityJdList.vue
  29. +2
    -2
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/vue3/CityJdList.vue
  30. +77
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/bean/WeChatTemplateMessageSender.java
  31. +5
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/YaoDuApiService.java
  32. +136
    -2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/YaoDuApiServiceImpl.java
  33. +17
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/yaoduapi/YaoDuApiController.java

+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/controller/CityActivityController.java View File

@ -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="活动信息表")


+ 85
- 18
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/entity/CityActivity.java View File

@ -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;
}

+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/mapper/CityActivityMapper.java View File

@ -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<CityActivity> {


+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/service/ICityActivityService.java View File

@ -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<CityActivity> {


+ 1
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/service/impl/CityActivityServiceImpl.java View File

@ -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


+ 110
- 37
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/vue/CityActivityList.vue View File

@ -4,21 +4,6 @@
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="发布人">
<j-search-select-tag placeholder="请选择发布人" v-model="queryParam.userId" dict="han_hai_member,nick_name,id"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</span>
</a-col>
</a-row>
</a-form>
</div>
@ -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
}
}


+ 91
- 11
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/vue/modules/CityActivityForm.vue View File

@ -4,8 +4,8 @@
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="title">
<a-textarea v-model="model.title" rows="4" placeholder="请输入标题" />
<a-form-model-item label="帖子内容" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="title">
<a-textarea v-model="model.title" rows="4" placeholder="请输入帖子内容" />
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -15,7 +15,17 @@
</a-col>
<a-col :span="24">
<a-form-model-item label="发布人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userId">
<j-search-select-tag v-model="model.userId" dict="han_hai_member,nick_name,id" />
<j-search-select-tag v-model="model.userId" dict="" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="发布人头像" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userImage">
<j-image-upload isMultiple v-model="model.userImage" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="发布昵称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userName">
<a-input v-model="model.userName" placeholder="请输入发布昵称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -24,23 +34,93 @@
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="发布人名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userName">
<a-input v-model="model.userName" placeholder="请输入发布人名称" ></a-input>
<a-form-model-item label="置顶" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isTop">
<a-input v-model="model.isTop" placeholder="请输入置顶" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="发布人头像" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userImage">
<j-image-upload isMultiple v-model="model.userImage" ></j-image-upload>
<a-form-model-item label="分类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="classId">
<a-input v-model="model.classId" placeholder="请输入分类" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="浏览量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isBrowse">
<a-input-number v-model="model.isBrowse" placeholder="请输入浏览量" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="踩量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isDown">
<a-input-number v-model="model.isDown" placeholder="请输入踩量" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="点赞量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isUp">
<a-input-number v-model="model.isUp" placeholder="请输入点赞量" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="评论量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isComment">
<a-input-number v-model="model.isComment" placeholder="请输入评论量" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="所属区域" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="addId">
<a-input v-model="model.addId" placeholder="请输入所属区域" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="详细地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="address">
<a-textarea v-model="model.address" rows="4" placeholder="请输入详细地址" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="纬度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="latitude">
<a-input v-model="model.latitude" placeholder="请输入纬度" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="经度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="longitude">
<a-input v-model="model.longitude" placeholder="请输入经度" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="认证方式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isContent">
<a-input v-model="model.isContent" placeholder="请输入认证方式" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="性别" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sex">
<a-input v-model="model.sex" placeholder="请输入性别" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="多少年" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="yearDate">
<a-input-number v-model="model.yearDate" placeholder="请输入多少年" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="联系方式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="phone">
<a-input v-model="model.phone" placeholder="请输入联系方式" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="j价格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="price">
<a-input-number v-model="model.price" placeholder="请输入j价格" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="总人数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sum">
<a-input-number v-model="model.sum" placeholder="请输入总人数" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="浏览量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="browseNum">
<a-input-number v-model="model.browseNum" placeholder="请输入浏览量" style="width: 100%" />
<a-form-model-item label="参与人数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num">
<a-input-number v-model="model.num" placeholder="请输入参与人数" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="评论量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="commentNum">
<a-input-number v-model="model.commentNum" placeholder="请输入评论量" style="width: 100%" />
<a-form-model-item label="活动类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type">
<a-input v-model="model.type" placeholder="请输入活动类型" ></a-input>
</a-form-model-item>
</a-col>
</a-row>


+ 179
- 34
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivity/vue3/CityActivity.data.ts View File

@ -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',
},
];

+ 171
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/controller/CityActivityTypeController.java View File

@ -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<CityActivityType, ICityActivityTypeService> {
@Autowired
private ICityActivityTypeService cityActivityTypeService;
/**
* 分页列表查询
*
* @param cityActivityType
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "活动类型-分页列表查询")
@ApiOperation(value="活动类型-分页列表查询", notes="活动类型-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<CityActivityType>> queryPageList(CityActivityType cityActivityType,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<CityActivityType> queryWrapper = QueryGenerator.initQueryWrapper(cityActivityType, req.getParameterMap());
Page<CityActivityType> page = new Page<CityActivityType>(pageNo, pageSize);
IPage<CityActivityType> pageList = cityActivityTypeService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param cityActivityType
* @return
*/
@AutoLog(value = "活动类型-添加")
@ApiOperation(value="活动类型-添加", notes="活动类型-添加")
@PostMapping(value = "/add")
public Result<String> 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<String> 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<String> 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<String> 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<CityActivityType> 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);
}
}

+ 54
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/entity/CityActivityType.java View File

@ -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;
}

+ 17
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/mapper/CityActivityTypeMapper.java View File

@ -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<CityActivityType> {
}

+ 5
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/mapper/xml/CityActivityTypeMapper.xml View File

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

+ 14
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/service/ICityActivityTypeService.java View File

@ -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<CityActivityType> {
}

+ 19
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/service/impl/CityActivityTypeServiceImpl.java View File

@ -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<CityActivityTypeMapper, CityActivityType> implements ICityActivityTypeService {
}

+ 171
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/CityActivityTypeList.vue View File

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

+ 104
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/modules/CityActivityTypeForm.vue View File

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

+ 84
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/modules/CityActivityTypeModal.Style#Drawer.vue View File

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

+ 60
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue/modules/CityActivityTypeModal.vue View File

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

+ 61
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/CityActivityType.api.ts View File

@ -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});
}

+ 23
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/CityActivityType.data.ts View File

@ -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',
},
];

+ 162
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/CityActivityTypeList.vue View File

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

+ 58
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityActivityType/vue3/components/CityActivityTypeModal.vue View File

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

+ 16
- 16
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/controller/CityJdController.java View File

@ -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<CityJd, ICityJdService> {
* @param req
* @return
*/
//@AutoLog(value = "城市景点-分页列表查询")
@ApiOperation(value="城市景点-分页列表查询", notes="城市景点-分页列表查询")
//@AutoLog(value = "景点列表-分页列表查询")
@ApiOperation(value="景点列表-分页列表查询", notes="景点列表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<CityJd>> queryPageList(CityJd cityJd,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@ -78,8 +78,8 @@ public class CityJdController extends JeecgController<CityJd, ICityJdService> {
* @param cityJd
* @return
*/
@AutoLog(value = "城市景点-添加")
@ApiOperation(value="城市景点-添加", notes="城市景点-添加")
@AutoLog(value = "景点列表-添加")
@ApiOperation(value="景点列表-添加", notes="景点列表-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody CityJd cityJd) {
cityJdService.save(cityJd);
@ -92,8 +92,8 @@ public class CityJdController extends JeecgController<CityJd, ICityJdService> {
* @param cityJd
* @return
*/
@AutoLog(value = "城市景点-编辑")
@ApiOperation(value="城市景点-编辑", notes="城市景点-编辑")
@AutoLog(value = "景点列表-编辑")
@ApiOperation(value="景点列表-编辑", notes="景点列表-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody CityJd cityJd) {
cityJdService.updateById(cityJd);
@ -106,8 +106,8 @@ public class CityJdController extends JeecgController<CityJd, ICityJdService> {
* @param id
* @return
*/
@AutoLog(value = "城市景点-通过id删除")
@ApiOperation(value="城市景点-通过id删除", notes="城市景点-通过id删除")
@AutoLog(value = "景点列表-通过id删除")
@ApiOperation(value="景点列表-通过id删除", notes="景点列表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
cityJdService.removeById(id);
@ -120,8 +120,8 @@ public class CityJdController extends JeecgController<CityJd, ICityJdService> {
* @param ids
* @return
*/
@AutoLog(value = "城市景点-批量删除")
@ApiOperation(value="城市景点-批量删除", notes="城市景点-批量删除")
@AutoLog(value = "景点列表-批量删除")
@ApiOperation(value="景点列表-批量删除", notes="景点列表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.cityJdService.removeByIds(Arrays.asList(ids.split(",")));
@ -134,8 +134,8 @@ public class CityJdController extends JeecgController<CityJd, ICityJdService> {
* @param id
* @return
*/
//@AutoLog(value = "城市景点-通过id查询")
@ApiOperation(value="城市景点-通过id查询", notes="城市景点-通过id查询")
//@AutoLog(value = "景点列表-通过id查询")
@ApiOperation(value="景点列表-通过id查询", notes="景点列表-通过id查询")
@GetMapping(value = "/queryById")
public Result<CityJd> queryById(@RequestParam(name="id",required=true) String id) {
CityJd cityJd = cityJdService.getById(id);
@ -153,7 +153,7 @@ public class CityJdController extends JeecgController<CityJd, ICityJdService> {
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, CityJd cityJd) {
return super.exportXls(request, cityJd, CityJd.class, "城市景点");
return super.exportXls(request, cityJd, CityJd.class, "景点列表");
}
/**


+ 3
- 3
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/entity/CityJd.java View File

@ -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;


+ 2
- 2
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/mapper/CityJdMapper.java View File

@ -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<CityJd> {


+ 2
- 2
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/service/ICityJdService.java View File

@ -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<CityJd> {


+ 2
- 2
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/service/impl/CityJdServiceImpl.java View File

@ -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


+ 2
- 2
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/vue/CityJdList.vue View File

@ -12,7 +12,7 @@
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('城市景点')">导出</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('景点列表')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
@ -108,7 +108,7 @@
},
data () {
return {
description: '城市景点管理页面',
description: '景点列表管理页面',
//
columns: [
{


+ 2
- 2
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityJd/vue3/CityJdList.vue View File

@ -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: {


+ 77
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/bean/WeChatTemplateMessageSender.java View File

@ -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<String, Object>() {{
// put("first", new HashMap<String, String>() {{
// put("value", "Hello, this is a test message!");
// put("color", "#173177");
// }});
// put("keyword1", new HashMap<String, String>() {{
// put("value", "Keyword1 Value");
// put("color", "#173177");
// }});
// put("keyword2", new HashMap<String, String>() {{
// put("value", "Keyword2 Value");
// put("color", "#173177");
// }});
// put("remark", new HashMap<String, String>() {{
// 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<String, Object> responseMap = new ObjectMapper().readValue(responseString, Map.class);
return (String) responseMap.get("access_token");
}
}
private static void sendTemplateMessage(String accessToken, String toUser, String templateId, Map<String, Object> data) throws IOException {
String url = TEMPLATE_MESSAGE_URL + accessToken;
Map<String, Object> 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);
}
}
}

+ 5
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/YaoDuApiService.java View File

@ -168,6 +168,11 @@ public interface YaoDuApiService {
//发布车找人信息
Result<?> publishCat(String token, CityCat cat);
//模板消息通知
Result<?> sendTemplateMessage(String templateId,String openid);
//获取活动类型
Result<?> getActivityType();
}

+ 136
- 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/YaoDuApiServiceImpl.java View File

@ -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<CityActivity> records = page1.getRecords();
//创建一个新的集合
List<CityActivity> 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<String, Object> createTemplateData() {
Map<String, Object> data = new HashMap<>();
data.put("first", new HashMap<String, String>() {{
put("value", "Hello, this is a test message!");
put("color", "#173177");
}});
data.put("keyword1", new HashMap<String, String>() {{
put("value", "Keyword1 Value");
put("color", "#173177");
}});
data.put("keyword2", new HashMap<String, String>() {{
put("value", "Keyword2 Value");
put("color", "#173177");
}});
data.put("remark", new HashMap<String, String>() {{
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<String, Object> responseMap = new ObjectMapper().readValue(responseString, Map.class);
return (String) responseMap.get("access_token");
}
}
public void sendTemplateMessage2(String accessToken, String toUser, String templateId, Map<String, Object> data) throws IOException {
String url = TEMPLATE_MESSAGE_URL + accessToken;
Map<String, Object> 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<CityActivityType> list = cityActivityTypeService.list();
return Result.OK(list);
}
}

+ 17
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/yaoduapi/YaoDuApiController.java View File

@ -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();
}
}

Loading…
Cancel
Save