From 8d5eb08d25d86832ccbf91cb167b4cdcea05ca77 Mon Sep 17 00:00:00 2001 From: lzx_win <2602107437@qq.com> Date: Wed, 24 Sep 2025 15:21:35 +0800 Subject: [PATCH] Changes --- .../homeGroup/controller/HomeGroupController.java | 171 +++++++++++++++++ .../jeecg/modules/homeGroup/entity/HomeGroup.java | 98 ++++++++++ .../modules/homeGroup/mapper/HomeGroupMapper.java | 17 ++ .../homeGroup/mapper/xml/HomeGroupMapper.xml | 5 + .../homeGroup/service/IHomeGroupService.java | 14 ++ .../service/impl/HomeGroupServiceImpl.java | 19 ++ .../jeecg/modules/homeGroup/vue/HomeGroupList.vue | 212 +++++++++++++++++++++ .../homeGroup/vue/modules/HomeGroupForm.vue | 129 +++++++++++++ .../vue/modules/HomeGroupModal.Style#Drawer.vue | 84 ++++++++ .../homeGroup/vue/modules/HomeGroupModal.vue | 60 ++++++ .../jeecg/modules/homeGroup/vue3/HomeGroup.api.ts | 61 ++++++ .../jeecg/modules/homeGroup/vue3/HomeGroup.data.ts | 80 ++++++++ .../jeecg/modules/homeGroup/vue3/HomeGroupList.vue | 162 ++++++++++++++++ .../homeGroup/vue3/components/HomeGroupModal.vue | 58 ++++++ .../modules/api/service/YaoDuGroupService.java | 21 ++ .../api/service/impl/YaoDuGroupServiceImpl.java | 105 ++++++++++ .../modules/api/yaoduapi/YaoDuGroupController.java | 53 ++++++ .../src/main/resources/application-dev.yml | 8 +- 18 files changed, 1353 insertions(+), 4 deletions(-) create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/controller/HomeGroupController.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/entity/HomeGroup.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/mapper/HomeGroupMapper.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/mapper/xml/HomeGroupMapper.xml create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/service/IHomeGroupService.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/service/impl/HomeGroupServiceImpl.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue/HomeGroupList.vue create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue/modules/HomeGroupForm.vue create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue/modules/HomeGroupModal.Style#Drawer.vue create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue/modules/HomeGroupModal.vue create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue3/HomeGroup.api.ts create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue3/HomeGroup.data.ts create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue3/HomeGroupList.vue create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue3/components/HomeGroupModal.vue create mode 100644 jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/YaoDuGroupService.java create mode 100644 jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/YaoDuGroupServiceImpl.java create mode 100644 jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/yaoduapi/YaoDuGroupController.java diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/controller/HomeGroupController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/controller/HomeGroupController.java new file mode 100644 index 0000000..d5d7cfc --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/controller/HomeGroupController.java @@ -0,0 +1,171 @@ +package org.jeecg.modules.homeGroup.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.homeGroup.entity.HomeGroup; +import org.jeecg.modules.homeGroup.service.IHomeGroupService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; +import org.jeecg.common.system.base.controller.JeecgController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.jeecg.common.aspect.annotation.AutoLog; + + /** + * @Description: 同城群信息表 + * @Author: jeecg-boot + * @Date: 2025-09-24 + * @Version: V1.0 + */ +@Api(tags="同城群信息表") +@RestController +@RequestMapping("/homeGroup/homeGroup") +@Slf4j +public class HomeGroupController extends JeecgController { + @Autowired + private IHomeGroupService homeGroupService; + + /** + * 分页列表查询 + * + * @param homeGroup + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "同城群信息表-分页列表查询") + @ApiOperation(value="同城群信息表-分页列表查询", notes="同城群信息表-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(HomeGroup homeGroup, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(homeGroup, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = homeGroupService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param homeGroup + * @return + */ + @AutoLog(value = "同城群信息表-添加") + @ApiOperation(value="同城群信息表-添加", notes="同城群信息表-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody HomeGroup homeGroup) { + homeGroupService.save(homeGroup); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param homeGroup + * @return + */ + @AutoLog(value = "同城群信息表-编辑") + @ApiOperation(value="同城群信息表-编辑", notes="同城群信息表-编辑") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody HomeGroup homeGroup) { + homeGroupService.updateById(homeGroup); + 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) { + homeGroupService.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.homeGroupService.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) { + HomeGroup homeGroup = homeGroupService.getById(id); + if(homeGroup==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(homeGroup); + } + + /** + * 导出excel + * + * @param request + * @param homeGroup + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, HomeGroup homeGroup) { + return super.exportXls(request, homeGroup, HomeGroup.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, HomeGroup.class); + } + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/entity/HomeGroup.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/entity/HomeGroup.java new file mode 100644 index 0000000..115739b --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/entity/HomeGroup.java @@ -0,0 +1,98 @@ +package org.jeecg.modules.homeGroup.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import java.util.List; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.*; +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.experimental.Accessors; + +/** + * @Description: 同城群信息表 + * @Author: jeecg-boot + * @Date: 2025-09-24 + * @Version: V1.0 + */ +@Data +@TableName("home_group") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="home_group对象", description="同城群信息表") +public class HomeGroup implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**群名称*/ + @Excel(name = "群名称", width = 15) + @ApiModelProperty(value = "群名称") + private java.lang.String title; + /**用户*/ + @Excel(name = "用户", width = 15) + @ApiModelProperty(value = "用户") + private java.lang.String userId; + /**群头像*/ + @Excel(name = "群头像", width = 15) + @ApiModelProperty(value = "群头像") + private java.lang.String image; + /**群说明*/ + @Excel(name = "群说明", width = 15) + @ApiModelProperty(value = "群说明") + private java.lang.String titleText; + /**人数*/ + @Excel(name = "人数", width = 15) + @ApiModelProperty(value = "人数") + private java.lang.Integer num; + /**所属区域*/ + @Excel(name = "所属区域", width = 15, dictTable = "city_addr", dicText = "name", dicCode = "id") + @Dict(dictTable = "city_addr", dicText = "name", dicCode = "id") + @ApiModelProperty(value = "所属区域") + private java.lang.String classId; + /**公告*/ + @Excel(name = "公告", width = 15) + @ApiModelProperty(value = "公告") + private java.lang.String notice; + /**二维码*/ + @Excel(name = "二维码", width = 15) + @ApiModelProperty(value = "二维码") + private java.lang.String qrCode; + + @TableField(exist = false) + private List userList; + + @Data + public class HomeGroupUser{ + /**用户名称*/ + @ApiModelProperty(value = "用户名称") + private java.lang.String userName; + /**用户头像*/ + @ApiModelProperty(value = "用户头像") + private java.lang.String image; + } +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/mapper/HomeGroupMapper.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/mapper/HomeGroupMapper.java new file mode 100644 index 0000000..26d1ff0 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/mapper/HomeGroupMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.homeGroup.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.homeGroup.entity.HomeGroup; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 同城群信息表 + * @Author: jeecg-boot + * @Date: 2025-09-24 + * @Version: V1.0 + */ +public interface HomeGroupMapper extends BaseMapper { + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/mapper/xml/HomeGroupMapper.xml b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/mapper/xml/HomeGroupMapper.xml new file mode 100644 index 0000000..2c18bb0 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/mapper/xml/HomeGroupMapper.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/homeGroup/service/IHomeGroupService.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/service/IHomeGroupService.java new file mode 100644 index 0000000..bb05f85 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/service/IHomeGroupService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.homeGroup.service; + +import org.jeecg.modules.homeGroup.entity.HomeGroup; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 同城群信息表 + * @Author: jeecg-boot + * @Date: 2025-09-24 + * @Version: V1.0 + */ +public interface IHomeGroupService extends IService { + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/service/impl/HomeGroupServiceImpl.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/service/impl/HomeGroupServiceImpl.java new file mode 100644 index 0000000..2cbeef2 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/service/impl/HomeGroupServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.homeGroup.service.impl; + +import org.jeecg.modules.homeGroup.entity.HomeGroup; +import org.jeecg.modules.homeGroup.mapper.HomeGroupMapper; +import org.jeecg.modules.homeGroup.service.IHomeGroupService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 同城群信息表 + * @Author: jeecg-boot + * @Date: 2025-09-24 + * @Version: V1.0 + */ +@Service +public class HomeGroupServiceImpl extends ServiceImpl implements IHomeGroupService { + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue/HomeGroupList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue/HomeGroupList.vue new file mode 100644 index 0000000..3c2a1e3 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue/HomeGroupList.vue @@ -0,0 +1,212 @@ + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue/modules/HomeGroupForm.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue/modules/HomeGroupForm.vue new file mode 100644 index 0000000..008aa2f --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue/modules/HomeGroupForm.vue @@ -0,0 +1,129 @@ + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue/modules/HomeGroupModal.Style#Drawer.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue/modules/HomeGroupModal.Style#Drawer.vue new file mode 100644 index 0000000..faf3622 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue/modules/HomeGroupModal.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/homeGroup/vue/modules/HomeGroupModal.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue/modules/HomeGroupModal.vue new file mode 100644 index 0000000..2c61099 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue/modules/HomeGroupModal.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/homeGroup/vue3/HomeGroup.api.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue3/HomeGroup.api.ts new file mode 100644 index 0000000..a5e9103 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue3/HomeGroup.api.ts @@ -0,0 +1,61 @@ +import {defHttp} from '/@/utils/http/axios'; +import {Modal} from 'ant-design-vue'; + +enum Api { + list = '/homeGroup/homeGroup/list', + save='/homeGroup/homeGroup/add', + edit='/homeGroup/homeGroup/edit', + deleteOne = '/homeGroup/homeGroup/delete', + deleteBatch = '/homeGroup/homeGroup/deleteBatch', + importExcel = '/homeGroup/homeGroup/importExcel', + exportXls = '/homeGroup/homeGroup/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/homeGroup/vue3/HomeGroup.data.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue3/HomeGroup.data.ts new file mode 100644 index 0000000..ab4b5ea --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue3/HomeGroup.data.ts @@ -0,0 +1,80 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '群名称', + align:"center", + dataIndex: 'title' + }, + { + title: '群头像', + align:"center", + dataIndex: 'image' + }, + { + title: '群说明', + align:"center", + dataIndex: 'titleText' + }, + { + title: '人数', + align:"center", + dataIndex: 'num' + }, + { + title: '所属区域', + align:"center", + dataIndex: 'classId_dictText' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ + { + label: "所属区域", + field: "classId", + component: 'JSearchSelect', + componentProps:{ + dict:"city_addr,name,id" + }, + colProps: {span: 6}, + }, +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '群名称', + field: 'title', + component: 'Input', + }, + { + label: '群头像', + field: 'image', + component: 'Input', + }, + { + label: '群说明', + field: 'titleText', + component: 'Input', + }, + { + label: '人数', + field: 'num', + component: 'InputNumber', + }, + { + label: '所属区域', + field: 'classId', + component: 'JSearchSelect', + componentProps:{ + dict:"city_addr,name,id" + }, + }, + { + label: '公告', + field: 'notice', + component: 'JCodeEditor', //TODO String后缀暂未添加 + }, +]; diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue3/HomeGroupList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue3/HomeGroupList.vue new file mode 100644 index 0000000..f7a1c0c --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue3/HomeGroupList.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/homeGroup/vue3/components/HomeGroupModal.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue3/components/HomeGroupModal.vue new file mode 100644 index 0000000..becd42b --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/vue3/components/HomeGroupModal.vue @@ -0,0 +1,58 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/YaoDuGroupService.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/YaoDuGroupService.java new file mode 100644 index 0000000..6c362ee --- /dev/null +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/YaoDuGroupService.java @@ -0,0 +1,21 @@ +package org.jeecg.modules.api.service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.jeecg.modules.api.bean.YaoDuOrderBean; +import org.jeecg.modules.homeGroup.entity.HomeGroup; + +import java.util.List; + +public interface YaoDuGroupService { + + Page list(String cityId, String title, YaoDuOrderBean bean); + + HomeGroup saveOrUpdate(String token, HomeGroup group); + + void delete(String token, String id); + + HomeGroup queryById(String id); + + Page getMyPublishedList(String token, YaoDuOrderBean bean); + +} diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/YaoDuGroupServiceImpl.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/YaoDuGroupServiceImpl.java new file mode 100644 index 0000000..1e94dd9 --- /dev/null +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/YaoDuGroupServiceImpl.java @@ -0,0 +1,105 @@ +package org.jeecg.modules.api.service.impl; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import jodd.util.StringUtil; +import org.jeecg.config.shiro.ShiroRealm; +import org.jeecg.modules.api.bean.YaoDuOrderBean; +import org.jeecg.modules.api.service.YaoDuGroupService; +import org.jeecg.modules.hanHaiMember.entity.HanHaiMember; +import org.jeecg.modules.hanHaiMember.service.IHanHaiMemberService; +import org.jeecg.modules.homeGroup.entity.HomeGroup; +import org.jeecg.modules.homeGroup.service.IHomeGroupService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +@Service +public class YaoDuGroupServiceImpl implements YaoDuGroupService { + + @Autowired + private IHomeGroupService homeGroupService; + @Autowired + private IHanHaiMemberService hanHaiMemberService; + //权限配置 + @Resource + private ShiroRealm shiroRealm; + + @Override + public Page list(String cityId, String title, YaoDuOrderBean bean){ + Page page = new Page(bean.getPageNo(), bean.getPageSize()); + Page page1 = homeGroupService + .lambdaQuery() + .orderByDesc(HomeGroup::getCreateTime) + .eq(StringUtil.isNotEmpty(cityId), HomeGroup::getClassId, cityId) + .like(StringUtil.isNotEmpty(title), HomeGroup::getTitle, title) + .page(page); + return page1; + } + + @Override + public HomeGroup saveOrUpdate(String token, HomeGroup group){ + HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); + group.setUserId(hanHaiMember.getId()); + homeGroupService.saveOrUpdate(group); + return group; + } + + @Override + public void delete(String token, String id){ + HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); + homeGroupService.removeById(id); + } + + @Override + public HomeGroup queryById(String id){ + HomeGroup byId = homeGroupService.getById(id); + + // 随机从用户列表中获取3个用户 + List allUsers = hanHaiMemberService + .lambdaQuery() +// .ne(HanHaiMember::getHeadImage, "") +// .isNotNull(HanHaiMember::getHeadImage) + .select(HanHaiMember::getNickName, HanHaiMember::getHeadImage) + .list(); + + if (allUsers != null && !allUsers.isEmpty()) { + // 随机打乱用户列表 + Collections.shuffle(allUsers); + + // 取前3个用户(如果用户总数少于3个,则取全部) + int userCount = Math.min(Math.min(byId.getNum(), 3), allUsers.size()); + List randomUsers = allUsers.subList(0, userCount); + + // 创建HomeGroupUser列表 + List userList = new ArrayList<>(); + for (HanHaiMember member : randomUsers) { + HomeGroup.HomeGroupUser groupUser = byId.new HomeGroupUser(); + groupUser.setUserName(member.getNickName()); + groupUser.setImage(member.getHeadImage()); + userList.add(groupUser); + } + + // 设置到HomeGroup对象中 + byId.setUserList(userList); + } + + return byId; + } + + @Override + public Page getMyPublishedList(String token, YaoDuOrderBean bean){ + HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); + Page page = new Page(bean.getPageNo(), bean.getPageSize()); + Page page1 = homeGroupService + .lambdaQuery() + .orderByDesc(HomeGroup::getCreateTime) + .eq(HomeGroup::getUserId, hanHaiMember.getId()) + .page(page); + return page1; + } + +} diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/yaoduapi/YaoDuGroupController.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/yaoduapi/YaoDuGroupController.java new file mode 100644 index 0000000..c09a77c --- /dev/null +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/yaoduapi/YaoDuGroupController.java @@ -0,0 +1,53 @@ +package org.jeecg.modules.api.yaoduapi; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.api.vo.Result; +import org.jeecg.modules.api.bean.YaoDuOrderBean; +import org.jeecg.modules.api.service.YaoDuGroupService; +import org.jeecg.modules.homeGroup.entity.HomeGroup; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +@Api(tags="瑶都万能墙接口 - 同城群") +@RestController +@RequestMapping("/city/group") +@Slf4j +public class YaoDuGroupController { + + @Autowired + private YaoDuGroupService yaoDuGroupService; + + @ApiOperation(value="获取同城群列表") + @GetMapping(value = "/list") + public Result list(String classId, String title, YaoDuOrderBean bean) { + return Result.OK(yaoDuGroupService.list(classId, title, bean)); + } + + @ApiOperation(value="编辑同城群") + @PostMapping(value = "/saveOrUpdate") + public Result saveOrUpdate(@RequestHeader("X-Access-Token") String token, HomeGroup group) { + return Result.OK(yaoDuGroupService.saveOrUpdate(token, group)); + } + + @ApiOperation(value="删除同城群") + @DeleteMapping(value = "/delete") + public Result delete(@RequestHeader("X-Access-Token") String token, @RequestParam String id) { + yaoDuGroupService.delete(token, id); + return Result.OK(); + } + + @ApiOperation(value="根据ID查询同城群") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam String id) { + return Result.OK(yaoDuGroupService.queryById(id)); + } + + @ApiOperation(value="查询自己发布的同城群列表") + @GetMapping(value = "/getMyPublishedList") + public Result getMyPublishedList(@RequestHeader("X-Access-Token") String token, YaoDuOrderBean bean) { + return Result.OK(yaoDuGroupService.getMyPublishedList(token, bean)); + } + +} diff --git a/jeecg-boot-module-system/src/main/resources/application-dev.yml b/jeecg-boot-module-system/src/main/resources/application-dev.yml index 7a58ab9..2c4f208 100644 --- a/jeecg-boot-module-system/src/main/resources/application-dev.yml +++ b/jeecg-boot-module-system/src/main/resources/application-dev.yml @@ -192,11 +192,11 @@ jeecg : excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/** #阿里云oss存储和大鱼短信秘钥配置 oss: - accessKey: LTAI5tMan18fjJPUtr3Aim2W - secretKey: lhALqqgYijc115wY8c1KfTYkbSnq5I + accessKey: LTAI5tQSs47izVy8DLVdwUU9 + secretKey: qHI7C3PaXYZySr84HTToviC71AYlFq endpoint: oss-cn-shenzhen.aliyuncs.com - bucketName: mangoimageapplet - staticDomain: https://dianpin-img.xzaiyp.top + bucketName: hanhaiimage + staticDomain: https://image.hhlm1688.com # ElasticSearch 6设置 elasticsearch: cluster-name: jeecg-ES