From 7deb2f80d45c4596655d13e05b3afe755c7a3377 Mon Sep 17 00:00:00 2001 From: lzx_mac <2602107437@qq.com> Date: Fri, 6 Dec 2024 01:20:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=9F=E6=88=BF=E7=B1=BB=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin-pc/.env.development | 2 +- admin-pc/.env.production | 2 +- .../java/org/jeecg/api/bean/HousePageList.java | 2 + .../jeecg/api/controller/ApiIndexController.java | 57 +++- .../org/jeecg/api/service/ApiIndexService.java | 9 + .../api/service/impl/ApiIndexServiceImpl.java | 33 ++ .../commCity/controller/CommCityController.java | 229 +++++++++++++ .../jeecg/modules/commCity/entity/CommCity.java | 63 ++++ .../modules/commCity/mapper/CommCityMapper.java | 22 ++ .../modules/commCity/mapper/xml/CommCityMapper.xml | 9 + .../modules/commCity/service/ICommCityService.java | 38 +++ .../commCity/service/impl/CommCityServiceImpl.java | 191 +++++++++++ .../jeecg/modules/commCity/vue/CommCityList.vue | 353 +++++++++++++++++++++ .../modules/commCity/vue/modules/CommCityModal.vue | 156 +++++++++ .../jeecg/modules/commCity/vue3/CommCity.api.ts | 82 +++++ .../jeecg/modules/commCity/vue3/CommCity.data.ts | 38 +++ .../jeecg/modules/commCity/vue3/CommCityList.vue | 272 ++++++++++++++++ .../commCity/vue3/components/CommCityModal.vue | 87 +++++ .../controller/CommonHomeController.java | 2 +- .../modules/commonHome/entity/CommonHome.java | 15 +- .../commonHome/mapper/CommonHomeMapper.java | 2 +- .../commonHome/service/ICommonHomeService.java | 2 +- .../service/impl/CommonHomeServiceImpl.java | 2 +- .../modules/commonHome/vue/CommonHomeList.vue | 25 ++ .../commonHome/vue/modules/CommonHomeForm.vue | 15 + .../modules/commonHome/vue3/CommonHome.data.ts | 42 +++ .../controller/CommonNewsController.java | 2 +- .../modules/commonNews/entity/CommonNews.java | 10 +- .../commonNews/mapper/CommonNewsMapper.java | 2 +- .../commonNews/service/ICommonNewsService.java | 2 +- .../service/impl/CommonNewsServiceImpl.java | 2 +- .../modules/commonNews/vue/CommonNewsList.vue | 19 +- .../commonNews/vue/modules/CommonNewsForm.vue | 10 + .../modules/commonNews/vue3/CommonNews.data.ts | 29 +- 34 files changed, 1795 insertions(+), 31 deletions(-) create mode 100644 module-common/src/main/java/org/jeecg/modules/commCity/controller/CommCityController.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commCity/entity/CommCity.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commCity/mapper/CommCityMapper.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commCity/mapper/xml/CommCityMapper.xml create mode 100644 module-common/src/main/java/org/jeecg/modules/commCity/service/ICommCityService.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commCity/service/impl/CommCityServiceImpl.java create mode 100644 module-common/src/main/java/org/jeecg/modules/commCity/vue/CommCityList.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commCity/vue/modules/CommCityModal.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commCity/vue3/CommCity.api.ts create mode 100644 module-common/src/main/java/org/jeecg/modules/commCity/vue3/CommCity.data.ts create mode 100644 module-common/src/main/java/org/jeecg/modules/commCity/vue3/CommCityList.vue create mode 100644 module-common/src/main/java/org/jeecg/modules/commCity/vue3/components/CommCityModal.vue diff --git a/admin-pc/.env.development b/admin-pc/.env.development index d3438ac..3067050 100644 --- a/admin-pc/.env.development +++ b/admin-pc/.env.development @@ -1,5 +1,5 @@ NODE_ENV=development -VUE_APP_API_BASE_URL=http://localhost:8001/houserent-admin/ +VUE_APP_API_BASE_URL=http://localhost:8000/houserent-admin/ VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview diff --git a/admin-pc/.env.production b/admin-pc/.env.production index 07b8555..66152e0 100644 --- a/admin-pc/.env.production +++ b/admin-pc/.env.production @@ -1,4 +1,4 @@ NODE_ENV=production -VUE_APP_API_BASE_URL=http://localhost:8001/houserent-admin/ +VUE_APP_API_BASE_URL=http://localhost:8000/houserent-admin/ VUE_APP_CAS_BASE_URL=http://localhost:8888/cas VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/api/bean/HousePageList.java b/module-common/src/main/java/org/jeecg/api/bean/HousePageList.java index d409f88..97185d8 100644 --- a/module-common/src/main/java/org/jeecg/api/bean/HousePageList.java +++ b/module-common/src/main/java/org/jeecg/api/bean/HousePageList.java @@ -6,6 +6,8 @@ import lombok.Data; @Data public class HousePageList { + private String iconClass; + private String classId; /**显示条数*/ @ApiModelProperty(value = "显示条数" ) diff --git a/module-common/src/main/java/org/jeecg/api/controller/ApiIndexController.java b/module-common/src/main/java/org/jeecg/api/controller/ApiIndexController.java index b8fb62e..3f72157 100644 --- a/module-common/src/main/java/org/jeecg/api/controller/ApiIndexController.java +++ b/module-common/src/main/java/org/jeecg/api/controller/ApiIndexController.java @@ -8,11 +8,9 @@ import org.jeecg.api.bean.HousePageList; import org.jeecg.api.service.ApiIndexService; import org.jeecg.common.api.vo.Result; import org.jeecg.modules.commonHome.entity.CommonHome; +import org.jeecg.modules.commonNews.entity.CommonNews; import org.jeecg.modules.hanHaiMember.service.IHanHaiMemberService; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -70,17 +68,47 @@ public class ApiIndexController { return apiIndexService.getMyHousePageList(token,bean); } + + //查询经济人发布的 + @ApiOperation(value="查询经济人发布的", notes="查询经济人发布的") + @GetMapping(value = "/getMyVipPageList") + public Result getMyVipPageList(@RequestHeader("X-Access-Token") String token,HousePageList bean) + { + return apiIndexService.getMyHousePageList(token,bean); + } + + + + + + //发布或编辑房源 @ApiOperation(value="发布或编辑房源", notes="发布或编辑房源") - @GetMapping(value = "/saveOrUpdateHouse") + @PostMapping(value = "/saveOrUpdateHouse") public Result saveOrUpdateHouse(@RequestHeader("X-Access-Token") String token, CommonHome home) { return apiIndexService.saveOrUpdateHouse(token,home); } + + //删除房源信息 + @ApiOperation(value="删除房源信息", notes="删除房源信息") + @GetMapping(value = "/deleteHouse") + public Result deleteHouse(@RequestHeader("X-Access-Token") String token,String houseId) + { + return apiIndexService.deleteHouse(token,houseId); + } + + + + + + + + //经纪人账号密码登录 @ApiOperation(value="经纪人账号密码登录", notes="经纪人账号密码登录") - @GetMapping(value = "/login") + @PostMapping(value = "/login") public Result login(@RequestHeader("X-Access-Token") String token,String username,String password) { return apiIndexService.login(username,password); @@ -89,7 +117,7 @@ public class ApiIndexController { //房东输入邀请码登录 @ApiOperation(value="房东输入邀请码登录", notes="房东输入邀请码登录") - @GetMapping(value = "/loginByInviteCode") + @PostMapping(value = "/loginByInviteCode") public Result loginByInviteCode(@RequestHeader("X-Access-Token") String token,String inviteCode) { return apiIndexService.loginByInviteCode(inviteCode); @@ -113,6 +141,17 @@ public class ApiIndexController { } + //发布或编辑发现 + @ApiOperation(value="发布或编辑发现", notes="发布或编辑发现") + @PostMapping(value = "/saveOrUpdateFind") + public Result saveOrUpdateFind(@RequestHeader("X-Access-Token") String token, CommonNews news) + { + return apiIndexService.saveOrUpdateFind(token,news); + } + + + + //获取发现列表详情 @ApiOperation(value="获取发现列表详情", notes="获取发现列表详情") @GetMapping(value = "/getFindDetail") @@ -120,4 +159,8 @@ public class ApiIndexController { { return apiIndexService.getFindDetail(houseId); } + + + + } diff --git a/module-common/src/main/java/org/jeecg/api/service/ApiIndexService.java b/module-common/src/main/java/org/jeecg/api/service/ApiIndexService.java index e25ffd2..dc5f5c3 100644 --- a/module-common/src/main/java/org/jeecg/api/service/ApiIndexService.java +++ b/module-common/src/main/java/org/jeecg/api/service/ApiIndexService.java @@ -3,6 +3,7 @@ package org.jeecg.api.service; import org.jeecg.api.bean.HousePageList; import org.jeecg.common.api.vo.Result; import org.jeecg.modules.commonHome.entity.CommonHome; +import org.jeecg.modules.commonNews.entity.CommonNews; import org.springframework.web.bind.annotation.RequestHeader; public interface ApiIndexService { @@ -27,6 +28,9 @@ public interface ApiIndexService { //发布或编辑房源 Result saveOrUpdateHouse(String token, CommonHome home); + //删除房源信息 + Result deleteHouse(String token,String houseId); + //经济人账号密码登录 Result login(String username, String password); @@ -43,8 +47,13 @@ public interface ApiIndexService { //获取发现列表页面数据带分页 Result getFindPageList(HousePageList bean); + //发布或编辑发现 + Result saveOrUpdateFind(String token, CommonNews news); + //获取发现列表详情 Result getFindDetail(String houseId); + + } diff --git a/module-common/src/main/java/org/jeecg/api/service/impl/ApiIndexServiceImpl.java b/module-common/src/main/java/org/jeecg/api/service/impl/ApiIndexServiceImpl.java index 1415b2c..d06a1a2 100644 --- a/module-common/src/main/java/org/jeecg/api/service/impl/ApiIndexServiceImpl.java +++ b/module-common/src/main/java/org/jeecg/api/service/impl/ApiIndexServiceImpl.java @@ -3,6 +3,7 @@ package org.jeecg.api.service.impl; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; import org.jeecg.api.bean.HousePageList; import org.jeecg.api.service.ApiIndexService; import org.jeecg.api.untils.HttpConf; @@ -78,6 +79,24 @@ public class ApiIndexServiceImpl implements ApiIndexService { .lambdaQuery() .orderByDesc(CommonHome::getCreateTime) .page(page); + + if(pageBean.getClassId()!=null){ + page1 = homeService + .lambdaQuery() + .eq(CommonHome::getClassId,pageBean.getClassId()) + .orderByDesc(CommonHome::getCreateTime) + .page(page); + } + + //如果区域标识不为空 + if(StringUtils.isNotBlank(pageBean.getIconClass())){ + page1 = homeService + .lambdaQuery() + .eq(CommonHome::getIconClass,pageBean.getIconClass()) + .orderByDesc(CommonHome::getCreateTime) + .page(page); + + } return Result.OK(page1); } @@ -100,6 +119,7 @@ public class ApiIndexServiceImpl implements ApiIndexService { .eq(CommonHome::getUserId,hanHaiMember.getId()) .orderByDesc(CommonHome::getCreateTime) .page(page); + return Result.OK(page1); } @@ -115,6 +135,13 @@ public class ApiIndexServiceImpl implements ApiIndexService { return Result.OK("发布成功"); } + //删除房源信息 + @Override + public Result deleteHouse(String token,String houseId) { + homeService.removeById(houseId); + return Result.OK("删除成功"); + } + //经济人账号密码登录 @Override @@ -151,6 +178,12 @@ public class ApiIndexServiceImpl implements ApiIndexService { return Result.OK(page1); } + //发布或编辑发现 + @Override + public Result saveOrUpdateFind(String token, CommonNews news){ + newsService.saveOrUpdate(news); + return Result.OK("发布成功"); + } //获取发现列表详情 diff --git a/module-common/src/main/java/org/jeecg/modules/commCity/controller/CommCityController.java b/module-common/src/main/java/org/jeecg/modules/commCity/controller/CommCityController.java new file mode 100644 index 0000000..5086532 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commCity/controller/CommCityController.java @@ -0,0 +1,229 @@ +package org.jeecg.modules.commCity.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.commCity.entity.CommCity; +import org.jeecg.modules.commCity.service.ICommCityService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; +import org.jeecg.common.system.base.controller.JeecgController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.jeecg.common.aspect.annotation.AutoLog; + + /** + * @Description: 城市列表 + * @Author: jeecg-boot + * @Date: 2024-12-05 + * @Version: V1.0 + */ +@Api(tags="城市列表") +@RestController +@RequestMapping("/commCity/commCity") +@Slf4j +public class CommCityController extends JeecgController{ + @Autowired + private ICommCityService commCityService; + + /** + * 分页列表查询 + * + * @param commCity + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "城市列表-分页列表查询") + @ApiOperation(value="城市列表-分页列表查询", notes="城市列表-分页列表查询") + @GetMapping(value = "/rootList") + public Result> queryPageList(CommCity commCity, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + String hasQuery = req.getParameter("hasQuery"); + if(hasQuery != null && "true".equals(hasQuery)){ + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(commCity, req.getParameterMap()); + List list = commCityService.queryTreeListNoPage(queryWrapper); + IPage pageList = new Page<>(1, 10, list.size()); + pageList.setRecords(list); + return Result.OK(pageList); + }else{ + String parentId = commCity.getPid(); + if (oConvertUtils.isEmpty(parentId)) { + parentId = "0"; + } + commCity.setPid(null); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(commCity, req.getParameterMap()); + // 使用 eq 防止模糊查询 + queryWrapper.eq("pid", parentId); + Page page = new Page(pageNo, pageSize); + IPage pageList = commCityService.page(page, queryWrapper); + return Result.OK(pageList); + } + } + + /** + * 获取子数据 + * @param commCity + * @param req + * @return + */ + //@AutoLog(value = "城市列表-获取子数据") + @ApiOperation(value="城市列表-获取子数据", notes="城市列表-获取子数据") + @GetMapping(value = "/childList") + public Result> queryPageList(CommCity commCity,HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(commCity, req.getParameterMap()); + List list = commCityService.list(queryWrapper); + IPage pageList = new Page<>(1, 10, list.size()); + pageList.setRecords(list); + return Result.OK(pageList); + } + + /** + * 批量查询子节点 + * @param parentIds 父ID(多个采用半角逗号分割) + * @return 返回 IPage + * @param parentIds + * @return + */ + //@AutoLog(value = "城市列表-批量获取子数据") + @ApiOperation(value="城市列表-批量获取子数据", notes="城市列表-批量获取子数据") + @GetMapping("/getChildListBatch") + public Result getChildListBatch(@RequestParam("parentIds") String parentIds) { + try { + QueryWrapper queryWrapper = new QueryWrapper<>(); + List parentIdList = Arrays.asList(parentIds.split(",")); + queryWrapper.in("pid", parentIdList); + List list = commCityService.list(queryWrapper); + IPage pageList = new Page<>(1, 10, list.size()); + pageList.setRecords(list); + return Result.OK(pageList); + } catch (Exception e) { + log.error(e.getMessage(), e); + return Result.error("批量查询子节点失败:" + e.getMessage()); + } + } + + /** + * 添加 + * + * @param commCity + * @return + */ + @AutoLog(value = "城市列表-添加") + @ApiOperation(value="城市列表-添加", notes="城市列表-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody CommCity commCity) { + commCityService.addCommCity(commCity); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param commCity + * @return + */ + @AutoLog(value = "城市列表-编辑") + @ApiOperation(value="城市列表-编辑", notes="城市列表-编辑") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody CommCity commCity) { + commCityService.updateCommCity(commCity); + 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) { + commCityService.deleteCommCity(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.commCityService.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) { + CommCity commCity = commCityService.getById(id); + if(commCity==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(commCity); + } + + /** + * 导出excel + * + * @param request + * @param commCity + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, CommCity commCity) { + return super.exportXls(request, commCity, CommCity.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, CommCity.class); + } + +} diff --git a/module-common/src/main/java/org/jeecg/modules/commCity/entity/CommCity.java b/module-common/src/main/java/org/jeecg/modules/commCity/entity/CommCity.java new file mode 100644 index 0000000..031ddc7 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commCity/entity/CommCity.java @@ -0,0 +1,63 @@ +package org.jeecg.modules.commCity.entity; + +import java.io.Serializable; +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 java.io.UnsupportedEncodingException; + +/** + * @Description: 城市列表 + * @Author: jeecg-boot + * @Date: 2024-12-05 + * @Version: V1.0 + */ +@Data +@TableName("comm_city") +@ApiModel(value="comm_city对象", description="城市列表") +public class CommCity 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 pid; + /**是否有子节点*/ + @Excel(name = "是否有子节点", width = 15, dicCode = "yn") + @Dict(dicCode = "yn") + @ApiModelProperty(value = "是否有子节点") + private java.lang.String hasChild; + /**地址名称*/ + @Excel(name = "地址名称", width = 15) + @ApiModelProperty(value = "地址名称") + private java.lang.String title; + /**排序*/ + @Excel(name = "排序", width = 15) + @ApiModelProperty(value = "排序") + private java.lang.Integer sort; +} diff --git a/module-common/src/main/java/org/jeecg/modules/commCity/mapper/CommCityMapper.java b/module-common/src/main/java/org/jeecg/modules/commCity/mapper/CommCityMapper.java new file mode 100644 index 0000000..c06666f --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commCity/mapper/CommCityMapper.java @@ -0,0 +1,22 @@ +package org.jeecg.modules.commCity.mapper; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.commCity.entity.CommCity; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 城市列表 + * @Author: jeecg-boot + * @Date: 2024-12-05 + * @Version: V1.0 + */ +public interface CommCityMapper extends BaseMapper { + + /** + * 编辑节点状态 + * @param id + * @param status + */ + void updateTreeNodeStatus(@Param("id") String id,@Param("status") String status); + +} diff --git a/module-common/src/main/java/org/jeecg/modules/commCity/mapper/xml/CommCityMapper.xml b/module-common/src/main/java/org/jeecg/modules/commCity/mapper/xml/CommCityMapper.xml new file mode 100644 index 0000000..874f85a --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commCity/mapper/xml/CommCityMapper.xml @@ -0,0 +1,9 @@ + + + + + + update comm_city set has_child = #{status} where id = #{id} + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commCity/service/ICommCityService.java b/module-common/src/main/java/org/jeecg/modules/commCity/service/ICommCityService.java new file mode 100644 index 0000000..ff2d409 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commCity/service/ICommCityService.java @@ -0,0 +1,38 @@ +package org.jeecg.modules.commCity.service; + +import org.jeecg.modules.commCity.entity.CommCity; +import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.common.exception.JeecgBootException; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import java.util.List; + +/** + * @Description: 城市列表 + * @Author: jeecg-boot + * @Date: 2024-12-05 + * @Version: V1.0 + */ +public interface ICommCityService extends IService { + + /**根节点父ID的值*/ + public static final String ROOT_PID_VALUE = "0"; + + /**树节点有子节点状态值*/ + public static final String HASCHILD = "1"; + + /**树节点无子节点状态值*/ + public static final String NOCHILD = "0"; + + /**新增节点*/ + void addCommCity(CommCity commCity); + + /**修改节点*/ + void updateCommCity(CommCity commCity) throws JeecgBootException; + + /**删除节点*/ + void deleteCommCity(String id) throws JeecgBootException; + + /**查询所有数据,无分页*/ + List queryTreeListNoPage(QueryWrapper queryWrapper); + +} diff --git a/module-common/src/main/java/org/jeecg/modules/commCity/service/impl/CommCityServiceImpl.java b/module-common/src/main/java/org/jeecg/modules/commCity/service/impl/CommCityServiceImpl.java new file mode 100644 index 0000000..6cc23a6 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commCity/service/impl/CommCityServiceImpl.java @@ -0,0 +1,191 @@ +package org.jeecg.modules.commCity.service.impl; + +import org.jeecg.common.exception.JeecgBootException; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.commCity.entity.CommCity; +import org.jeecg.modules.commCity.mapper.CommCityMapper; +import org.jeecg.modules.commCity.service.ICommCityService; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 城市列表 + * @Author: jeecg-boot + * @Date: 2024-12-05 + * @Version: V1.0 + */ +@Service +public class CommCityServiceImpl extends ServiceImpl implements ICommCityService { + + @Override + public void addCommCity(CommCity commCity) { + //新增时设置hasChild为0 + commCity.setHasChild(ICommCityService.NOCHILD); + if(oConvertUtils.isEmpty(commCity.getPid())){ + commCity.setPid(ICommCityService.ROOT_PID_VALUE); + }else{ + //如果当前节点父ID不为空 则设置父节点的hasChildren 为1 + CommCity parent = baseMapper.selectById(commCity.getPid()); + if(parent!=null && !"1".equals(parent.getHasChild())){ + parent.setHasChild("1"); + baseMapper.updateById(parent); + } + } + baseMapper.insert(commCity); + } + + @Override + public void updateCommCity(CommCity commCity) { + CommCity entity = this.getById(commCity.getId()); + if(entity==null) { + throw new JeecgBootException("未找到对应实体"); + } + String old_pid = entity.getPid(); + String new_pid = commCity.getPid(); + if(!old_pid.equals(new_pid)) { + updateOldParentNode(old_pid); + if(oConvertUtils.isEmpty(new_pid)){ + commCity.setPid(ICommCityService.ROOT_PID_VALUE); + } + if(!ICommCityService.ROOT_PID_VALUE.equals(commCity.getPid())) { + baseMapper.updateTreeNodeStatus(commCity.getPid(), ICommCityService.HASCHILD); + } + } + baseMapper.updateById(commCity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteCommCity(String id) throws JeecgBootException { + //查询选中节点下所有子节点一并删除 + id = this.queryTreeChildIds(id); + if(id.indexOf(",")>0) { + StringBuffer sb = new StringBuffer(); + String[] idArr = id.split(","); + for (String idVal : idArr) { + if(idVal != null){ + CommCity commCity = this.getById(idVal); + String pidVal = commCity.getPid(); + //查询此节点上一级是否还有其他子节点 + List dataList = baseMapper.selectList(new QueryWrapper().eq("pid", pidVal).notIn("id",Arrays.asList(idArr))); + if((dataList == null || dataList.size()==0) && !Arrays.asList(idArr).contains(pidVal) + && !sb.toString().contains(pidVal)){ + //如果当前节点原本有子节点 现在木有了,更新状态 + sb.append(pidVal).append(","); + } + } + } + //批量删除节点 + baseMapper.deleteBatchIds(Arrays.asList(idArr)); + //修改已无子节点的标识 + String[] pidArr = sb.toString().split(","); + for(String pid : pidArr){ + this.updateOldParentNode(pid); + } + }else{ + CommCity commCity = this.getById(id); + if(commCity==null) { + throw new JeecgBootException("未找到对应实体"); + } + updateOldParentNode(commCity.getPid()); + baseMapper.deleteById(id); + } + } + + @Override + public List queryTreeListNoPage(QueryWrapper queryWrapper) { + List dataList = baseMapper.selectList(queryWrapper); + List mapList = new ArrayList<>(); + for(CommCity data : dataList){ + String pidVal = data.getPid(); + //递归查询子节点的根节点 + if(pidVal != null && !"0".equals(pidVal)){ + CommCity rootVal = this.getTreeRoot(pidVal); + if(rootVal != null && !mapList.contains(rootVal)){ + mapList.add(rootVal); + } + }else{ + if(!mapList.contains(data)){ + mapList.add(data); + } + } + } + return mapList; + } + + /** + * 根据所传pid查询旧的父级节点的子节点并修改相应状态值 + * @param pid + */ + private void updateOldParentNode(String pid) { +// if(!ICommCityService.ROOT_PID_VALUE.equals(pid)) { +// Integer count = baseMapper.selectCount(new QueryWrapper().eq("pid", pid)); +// if(count==null || count<=1) { +// baseMapper.updateTreeNodeStatus(pid, ICommCityService.NOCHILD); +// } +// } + } + + /** + * 递归查询节点的根节点 + * @param pidVal + * @return + */ + private CommCity getTreeRoot(String pidVal){ + CommCity data = baseMapper.selectById(pidVal); + if(data != null && !"0".equals(data.getPid())){ + return this.getTreeRoot(data.getPid()); + }else{ + return data; + } + } + + /** + * 根据id查询所有子节点id + * @param ids + * @return + */ + private String queryTreeChildIds(String ids) { + //获取id数组 + String[] idArr = ids.split(","); + StringBuffer sb = new StringBuffer(); + for (String pidVal : idArr) { + if(pidVal != null){ + if(!sb.toString().contains(pidVal)){ + if(sb.toString().length() > 0){ + sb.append(","); + } + sb.append(pidVal); + this.getTreeChildIds(pidVal,sb); + } + } + } + return sb.toString(); + } + + /** + * 递归查询所有子节点 + * @param pidVal + * @param sb + * @return + */ + private StringBuffer getTreeChildIds(String pidVal,StringBuffer sb){ + List dataList = baseMapper.selectList(new QueryWrapper().eq("pid", pidVal)); + if(dataList != null && dataList.size()>0){ + for(CommCity tree : dataList) { + if(!sb.toString().contains(tree.getId())){ + sb.append(",").append(tree.getId()); + } + this.getTreeChildIds(tree.getId(),sb); + } + } + return sb; + } + +} diff --git a/module-common/src/main/java/org/jeecg/modules/commCity/vue/CommCityList.vue b/module-common/src/main/java/org/jeecg/modules/commCity/vue/CommCityList.vue new file mode 100644 index 0000000..b046d92 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commCity/vue/CommCityList.vue @@ -0,0 +1,353 @@ + + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commCity/vue/modules/CommCityModal.vue b/module-common/src/main/java/org/jeecg/modules/commCity/vue/modules/CommCityModal.vue new file mode 100644 index 0000000..b3e168c --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commCity/vue/modules/CommCityModal.vue @@ -0,0 +1,156 @@ + + + \ No newline at end of file diff --git a/module-common/src/main/java/org/jeecg/modules/commCity/vue3/CommCity.api.ts b/module-common/src/main/java/org/jeecg/modules/commCity/vue3/CommCity.api.ts new file mode 100644 index 0000000..e7eae8e --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commCity/vue3/CommCity.api.ts @@ -0,0 +1,82 @@ +import {defHttp} from "/@/utils/http/axios"; +import {Modal} from 'ant-design-vue'; + +enum Api { + list = '/commCity/commCity/rootList', + save='/commCity/commCity/add', + edit='/commCity/commCity/edit', + deleteCommCity = '/sys/commCity/delete', + deleteBatch = '/commCity/commCity/deleteBatch', + importExcel = '/commCity/commCity/importExcel', + exportXls = '/commCity/commCity/exportXls', + loadTreeData = '/commCity/commCity/loadTreeRoot', + getChildList = '/commCity/commCity/childList', + getChildListBatch = '/commCity/commCity/getChildListBatch', +} +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; +/** + * 导入api + * @param params + */ +export const getImportUrl = Api.importExcel; +/** + * 列表接口 + * @param params + */ +export const list = (params) => + defHttp.get({url: Api.list, params}); +/** + * 删除 + */ +export const deleteCommCity = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteCommCity, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} +/** + * 批量删除 + * @param params + */ +export const batchDeleteCommCity = (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 saveOrUpdateDict = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({url: url, params}); +} +/** + * 查询全部树形节点数据 + * @param params + */ +export const loadTreeData = (params) => + defHttp.get({url: Api.loadTreeData,params}); +/** + * 查询子节点数据 + * @param params + */ +export const getChildList = (params) => + defHttp.get({url: Api.getChildList, params}); +/** + * 批量查询子节点数据 + * @param params + */ +export const getChildListBatch = (params) => + defHttp.get({url: Api.getChildListBatch, params},{isTransformResponse:false}); diff --git a/module-common/src/main/java/org/jeecg/modules/commCity/vue3/CommCity.data.ts b/module-common/src/main/java/org/jeecg/modules/commCity/vue3/CommCity.data.ts new file mode 100644 index 0000000..9834381 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commCity/vue3/CommCity.data.ts @@ -0,0 +1,38 @@ +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: 'sort' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '父级节点', + field: 'pid', + component: 'Input', + }, + { + label: '地址名称', + field: 'title', + component: 'Input', + }, + { + label: '排序', + field: 'sort', + component: 'InputNumber', + }, +]; diff --git a/module-common/src/main/java/org/jeecg/modules/commCity/vue3/CommCityList.vue b/module-common/src/main/java/org/jeecg/modules/commCity/vue3/CommCityList.vue new file mode 100644 index 0000000..4e0e372 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commCity/vue3/CommCityList.vue @@ -0,0 +1,272 @@ + + + + + diff --git a/module-common/src/main/java/org/jeecg/modules/commCity/vue3/components/CommCityModal.vue b/module-common/src/main/java/org/jeecg/modules/commCity/vue3/components/CommCityModal.vue new file mode 100644 index 0000000..47f6d14 --- /dev/null +++ b/module-common/src/main/java/org/jeecg/modules/commCity/vue3/components/CommCityModal.vue @@ -0,0 +1,87 @@ + + diff --git a/module-common/src/main/java/org/jeecg/modules/commonHome/controller/CommonHomeController.java b/module-common/src/main/java/org/jeecg/modules/commonHome/controller/CommonHomeController.java index 54d0c12..d6d648d 100644 --- a/module-common/src/main/java/org/jeecg/modules/commonHome/controller/CommonHomeController.java +++ b/module-common/src/main/java/org/jeecg/modules/commonHome/controller/CommonHomeController.java @@ -39,7 +39,7 @@ import org.jeecg.common.aspect.annotation.AutoLog; /** * @Description: 房源信息表 * @Author: jeecg-boot - * @Date: 2024-12-03 + * @Date: 2024-12-05 * @Version: V1.0 */ @Api(tags="房源信息表") diff --git a/module-common/src/main/java/org/jeecg/modules/commonHome/entity/CommonHome.java b/module-common/src/main/java/org/jeecg/modules/commonHome/entity/CommonHome.java index 8877b82..37a17c8 100644 --- a/module-common/src/main/java/org/jeecg/modules/commonHome/entity/CommonHome.java +++ b/module-common/src/main/java/org/jeecg/modules/commonHome/entity/CommonHome.java @@ -20,7 +20,7 @@ import lombok.experimental.Accessors; /** * @Description: 房源信息表 * @Author: jeecg-boot - * @Date: 2024-12-03 + * @Date: 2024-12-05 * @Version: V1.0 */ @Data @@ -225,4 +225,17 @@ public class CommonHome implements Serializable { @Excel(name = "用户", width = 15) @ApiModelProperty(value = "用户") private java.lang.String userId; + /**经度*/ + @Excel(name = "经度", width = 15) + @ApiModelProperty(value = "经度") + private java.lang.String longitude; + /**纬度*/ + @Excel(name = "纬度", width = 15) + @ApiModelProperty(value = "纬度") + private java.lang.String latitude; + /**所属区域*/ + @Excel(name = "所属区域", width = 15, dictTable = "common_icon_image", dicText = "title", dicCode = "id") + @Dict(dictTable = "common_icon_image", dicText = "title", dicCode = "id") + @ApiModelProperty(value = "所属区域") + private java.lang.String iconClass; } diff --git a/module-common/src/main/java/org/jeecg/modules/commonHome/mapper/CommonHomeMapper.java b/module-common/src/main/java/org/jeecg/modules/commonHome/mapper/CommonHomeMapper.java index 048702d..83d9aec 100644 --- a/module-common/src/main/java/org/jeecg/modules/commonHome/mapper/CommonHomeMapper.java +++ b/module-common/src/main/java/org/jeecg/modules/commonHome/mapper/CommonHomeMapper.java @@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * @Description: 房源信息表 * @Author: jeecg-boot - * @Date: 2024-12-03 + * @Date: 2024-12-05 * @Version: V1.0 */ public interface CommonHomeMapper extends BaseMapper { diff --git a/module-common/src/main/java/org/jeecg/modules/commonHome/service/ICommonHomeService.java b/module-common/src/main/java/org/jeecg/modules/commonHome/service/ICommonHomeService.java index ecc5201..96f4b49 100644 --- a/module-common/src/main/java/org/jeecg/modules/commonHome/service/ICommonHomeService.java +++ b/module-common/src/main/java/org/jeecg/modules/commonHome/service/ICommonHomeService.java @@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService; /** * @Description: 房源信息表 * @Author: jeecg-boot - * @Date: 2024-12-03 + * @Date: 2024-12-05 * @Version: V1.0 */ public interface ICommonHomeService extends IService { diff --git a/module-common/src/main/java/org/jeecg/modules/commonHome/service/impl/CommonHomeServiceImpl.java b/module-common/src/main/java/org/jeecg/modules/commonHome/service/impl/CommonHomeServiceImpl.java index 1c8685f..e028251 100644 --- a/module-common/src/main/java/org/jeecg/modules/commonHome/service/impl/CommonHomeServiceImpl.java +++ b/module-common/src/main/java/org/jeecg/modules/commonHome/service/impl/CommonHomeServiceImpl.java @@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; /** * @Description: 房源信息表 * @Author: jeecg-boot - * @Date: 2024-12-03 + * @Date: 2024-12-05 * @Version: V1.0 */ @Service diff --git a/module-common/src/main/java/org/jeecg/modules/commonHome/vue/CommonHomeList.vue b/module-common/src/main/java/org/jeecg/modules/commonHome/vue/CommonHomeList.vue index f438f3d..24fa549 100644 --- a/module-common/src/main/java/org/jeecg/modules/commonHome/vue/CommonHomeList.vue +++ b/module-common/src/main/java/org/jeecg/modules/commonHome/vue/CommonHomeList.vue @@ -14,6 +14,13 @@ + 查询 @@ -373,6 +380,21 @@ align:"center", dataIndex: 'userId' }, + { + title:'经度', + align:"center", + dataIndex: 'longitude' + }, + { + title:'纬度', + align:"center", + dataIndex: 'latitude' + }, + { + title:'所属区域', + align:"center", + dataIndex: 'iconClass_dictText' + }, { title: '操作', dataIndex: 'action', @@ -452,6 +474,9 @@ fieldList.push({type:'Text',value:'homeImage',text:'产权证照片',dictCode:''}) fieldList.push({type:'Text',value:'homeBz',text:'备注',dictCode:''}) fieldList.push({type:'string',value:'userId',text:'用户',dictCode:''}) + fieldList.push({type:'string',value:'longitude',text:'经度',dictCode:''}) + fieldList.push({type:'string',value:'latitude',text:'纬度',dictCode:''}) + fieldList.push({type:'sel_search',value:'iconClass',text:'所属区域',dictTable:"common_icon_image", dictText:'title', dictCode:'id'}) this.superFieldList = fieldList } } diff --git a/module-common/src/main/java/org/jeecg/modules/commonHome/vue/modules/CommonHomeForm.vue b/module-common/src/main/java/org/jeecg/modules/commonHome/vue/modules/CommonHomeForm.vue index f189b90..e3f7780 100644 --- a/module-common/src/main/java/org/jeecg/modules/commonHome/vue/modules/CommonHomeForm.vue +++ b/module-common/src/main/java/org/jeecg/modules/commonHome/vue/modules/CommonHomeForm.vue @@ -223,6 +223,21 @@ + + + + + + + + + + + + + + + diff --git a/module-common/src/main/java/org/jeecg/modules/commonHome/vue3/CommonHome.data.ts b/module-common/src/main/java/org/jeecg/modules/commonHome/vue3/CommonHome.data.ts index 6c8b70d..c97a94d 100644 --- a/module-common/src/main/java/org/jeecg/modules/commonHome/vue3/CommonHome.data.ts +++ b/module-common/src/main/java/org/jeecg/modules/commonHome/vue3/CommonHome.data.ts @@ -235,6 +235,21 @@ export const columns: BasicColumn[] = [ align:"center", dataIndex: 'userId' }, + { + title: '经度', + align:"center", + dataIndex: 'longitude' + }, + { + title: '纬度', + align:"center", + dataIndex: 'latitude' + }, + { + title: '所属区域', + align:"center", + dataIndex: 'iconClass_dictText' + }, ]; //查询数据 export const searchFormSchema: FormSchema[] = [ @@ -256,6 +271,15 @@ export const searchFormSchema: FormSchema[] = [ }, colProps: {span: 6}, }, + { + label: "所属区域", + field: "iconClass", + component: 'JSearchSelect', + componentProps:{ + dict:"common_icon_image,title,id" + }, + colProps: {span: 6}, + }, ]; //表单数据 export const formSchema: FormSchema[] = [ @@ -495,4 +519,22 @@ export const formSchema: FormSchema[] = [ field: 'userId', component: 'Input', }, + { + label: '经度', + field: 'longitude', + component: 'Input', + }, + { + label: '纬度', + field: 'latitude', + component: 'Input', + }, + { + label: '所属区域', + field: 'iconClass', + component: 'JSearchSelect', + componentProps:{ + dict:"common_icon_image,title,id" + }, + }, ]; diff --git a/module-common/src/main/java/org/jeecg/modules/commonNews/controller/CommonNewsController.java b/module-common/src/main/java/org/jeecg/modules/commonNews/controller/CommonNewsController.java index e0316ad..59e4a8b 100644 --- a/module-common/src/main/java/org/jeecg/modules/commonNews/controller/CommonNewsController.java +++ b/module-common/src/main/java/org/jeecg/modules/commonNews/controller/CommonNewsController.java @@ -39,7 +39,7 @@ import org.jeecg.common.aspect.annotation.AutoLog; /** * @Description: 新闻动态表 * @Author: jeecg-boot - * @Date: 2024-12-03 + * @Date: 2024-12-05 * @Version: V1.0 */ @Api(tags="新闻动态表") diff --git a/module-common/src/main/java/org/jeecg/modules/commonNews/entity/CommonNews.java b/module-common/src/main/java/org/jeecg/modules/commonNews/entity/CommonNews.java index 33028c5..fd917a4 100644 --- a/module-common/src/main/java/org/jeecg/modules/commonNews/entity/CommonNews.java +++ b/module-common/src/main/java/org/jeecg/modules/commonNews/entity/CommonNews.java @@ -20,7 +20,7 @@ import lombok.experimental.Accessors; /** * @Description: 新闻动态表 * @Author: jeecg-boot - * @Date: 2024-12-03 + * @Date: 2024-12-05 * @Version: V1.0 */ @Data @@ -80,4 +80,12 @@ public class CommonNews implements Serializable { @Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") @ApiModelProperty(value = "发布人") private java.lang.String userId; + /**说明*/ + @Excel(name = "说明", width = 15) + @ApiModelProperty(value = "说明") + private java.lang.String descValue; + /**图标*/ + @Excel(name = "图标", width = 15) + @ApiModelProperty(value = "图标") + private java.lang.String logoImage; } diff --git a/module-common/src/main/java/org/jeecg/modules/commonNews/mapper/CommonNewsMapper.java b/module-common/src/main/java/org/jeecg/modules/commonNews/mapper/CommonNewsMapper.java index f5ede1b..6e65696 100644 --- a/module-common/src/main/java/org/jeecg/modules/commonNews/mapper/CommonNewsMapper.java +++ b/module-common/src/main/java/org/jeecg/modules/commonNews/mapper/CommonNewsMapper.java @@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * @Description: 新闻动态表 * @Author: jeecg-boot - * @Date: 2024-12-03 + * @Date: 2024-12-05 * @Version: V1.0 */ public interface CommonNewsMapper extends BaseMapper { diff --git a/module-common/src/main/java/org/jeecg/modules/commonNews/service/ICommonNewsService.java b/module-common/src/main/java/org/jeecg/modules/commonNews/service/ICommonNewsService.java index 7388037..c8715f8 100644 --- a/module-common/src/main/java/org/jeecg/modules/commonNews/service/ICommonNewsService.java +++ b/module-common/src/main/java/org/jeecg/modules/commonNews/service/ICommonNewsService.java @@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService; /** * @Description: 新闻动态表 * @Author: jeecg-boot - * @Date: 2024-12-03 + * @Date: 2024-12-05 * @Version: V1.0 */ public interface ICommonNewsService extends IService { diff --git a/module-common/src/main/java/org/jeecg/modules/commonNews/service/impl/CommonNewsServiceImpl.java b/module-common/src/main/java/org/jeecg/modules/commonNews/service/impl/CommonNewsServiceImpl.java index e67926f..6eff956 100644 --- a/module-common/src/main/java/org/jeecg/modules/commonNews/service/impl/CommonNewsServiceImpl.java +++ b/module-common/src/main/java/org/jeecg/modules/commonNews/service/impl/CommonNewsServiceImpl.java @@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; /** * @Description: 新闻动态表 * @Author: jeecg-boot - * @Date: 2024-12-03 + * @Date: 2024-12-05 * @Version: V1.0 */ @Service diff --git a/module-common/src/main/java/org/jeecg/modules/commonNews/vue/CommonNewsList.vue b/module-common/src/main/java/org/jeecg/modules/commonNews/vue/CommonNewsList.vue index 664ab9a..49056e1 100644 --- a/module-common/src/main/java/org/jeecg/modules/commonNews/vue/CommonNewsList.vue +++ b/module-common/src/main/java/org/jeecg/modules/commonNews/vue/CommonNewsList.vue @@ -139,12 +139,6 @@ dataIndex: 'image', scopedSlots: {customRender: 'imgSlot'} }, - { - title:'星闻内容', - align:"center", - dataIndex: 'details', - scopedSlots: {customRender: 'htmlSlot'} - }, { title:'价格', align:"center", @@ -171,6 +165,17 @@ align:"center", dataIndex: 'userId_dictText' }, + { + title:'说明', + align:"center", + dataIndex: 'descValue' + }, + { + title:'图标', + align:"center", + dataIndex: 'logoImage', + scopedSlots: {customRender: 'imgSlot'} + }, { title: '操作', dataIndex: 'action', @@ -214,6 +219,8 @@ fieldList.push({type:'string',value:'titleSub',text:'说明',dictCode:''}) fieldList.push({type:'Text',value:'iconMp',text:'视频',dictCode:''}) fieldList.push({type:'sel_search',value:'userId',text:'发布人',dictTable:"han_hai_member", dictText:'nick_name', dictCode:'id'}) + fieldList.push({type:'string',value:'descValue',text:'说明',dictCode:''}) + fieldList.push({type:'Text',value:'logoImage',text:'图标',dictCode:''}) this.superFieldList = fieldList } } diff --git a/module-common/src/main/java/org/jeecg/modules/commonNews/vue/modules/CommonNewsForm.vue b/module-common/src/main/java/org/jeecg/modules/commonNews/vue/modules/CommonNewsForm.vue index 9343ca4..4a742e2 100644 --- a/module-common/src/main/java/org/jeecg/modules/commonNews/vue/modules/CommonNewsForm.vue +++ b/module-common/src/main/java/org/jeecg/modules/commonNews/vue/modules/CommonNewsForm.vue @@ -43,6 +43,16 @@ + + + + + + + + + + diff --git a/module-common/src/main/java/org/jeecg/modules/commonNews/vue3/CommonNews.data.ts b/module-common/src/main/java/org/jeecg/modules/commonNews/vue3/CommonNews.data.ts index 904abe1..a202ca7 100644 --- a/module-common/src/main/java/org/jeecg/modules/commonNews/vue3/CommonNews.data.ts +++ b/module-common/src/main/java/org/jeecg/modules/commonNews/vue3/CommonNews.data.ts @@ -21,12 +21,6 @@ export const columns: BasicColumn[] = [ dataIndex: 'image', customRender:render.renderAvatar, }, - { - title: '星闻内容', - align:"center", - dataIndex: 'details', - slots: { customRender: 'htmlSlot' }, - }, { title: '价格', align:"center", @@ -53,6 +47,17 @@ export const columns: BasicColumn[] = [ align:"center", dataIndex: 'userId_dictText' }, + { + title: '说明', + align:"center", + dataIndex: 'descValue' + }, + { + title: '图标', + align:"center", + dataIndex: 'logoImage', + customRender:render.renderAvatar, + }, ]; //查询数据 export const searchFormSchema: FormSchema[] = [ @@ -106,4 +111,16 @@ export const formSchema: FormSchema[] = [ dict:"han_hai_member,nick_name,id" }, }, + { + label: '说明', + field: 'descValue', + component: 'Input', + }, + { + label: '图标', + field: 'logoImage', + component: 'JImageUpload', + componentProps:{ + }, + }, ];