Browse Source

1、活动/商品补充是否被收藏、是否已报名

2、补充社区模块
3、补充分类接口
master
Aug 3 months ago
parent
commit
bf41ab45d1
47 changed files with 992 additions and 144 deletions
  1. +11
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityActivity/entity/CommunityActivity.java
  2. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityActivityApply/controller/CommunityActivityApplyController.java
  3. +6
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityActivityApply/entity/CommunityActivityApply.java
  4. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityActivityApply/mapper/CommunityActivityApplyMapper.java
  5. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityActivityApply/service/ICommunityActivityApplyService.java
  6. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityActivityApply/service/impl/CommunityActivityApplyServiceImpl.java
  7. +6
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityActivityApply/vue/CommunityActivityApplyList.vue
  8. +5
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityActivityApply/vue/modules/CommunityActivityApplyForm.vue
  9. +13
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityActivityApply/vue3/CommunityActivityApply.data.ts
  10. +7
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityGoods/entity/CommunityGoods.java
  11. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityOrder/controller/CommunityOrderController.java
  12. +5
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityOrder/entity/CommunityOrder.java
  13. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityOrder/mapper/CommunityOrderMapper.java
  14. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityOrder/service/ICommunityOrderService.java
  15. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityOrder/service/impl/CommunityOrderServiceImpl.java
  16. +6
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityOrder/vue/CommunityOrderList.vue
  17. +5
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityOrder/vue/modules/CommunityOrderForm.vue
  18. +10
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityOrder/vue3/CommunityOrder.data.ts
  19. +119
    -29
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/controller/CommunityPostController.java
  20. +55
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/entity/CommunityComment.java
  21. +12
    -9
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/entity/CommunityPost.java
  22. +19
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/mapper/CommunityCommentMapper.java
  23. +1
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/mapper/CommunityPostMapper.java
  24. +16
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/mapper/xml/CommunityCommentMapper.xml
  25. +16
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/service/ICommunityCommentService.java
  26. +27
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/service/ICommunityPostService.java
  27. +27
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/service/impl/CommunityCommentServiceImpl.java
  28. +60
    -2
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/service/impl/CommunityPostServiceImpl.java
  29. +65
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vo/CommunityPostPage.java
  30. +14
    -15
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue/CommunityPostList.vue
  31. +113
    -52
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue/modules/CommunityPostForm.vue
  32. +12
    -8
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue/modules/CommunityPostModal.vue
  33. +2
    -2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/communityController/ActivityController.java
  34. +42
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/communityController/CommunityController.java
  35. +14
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/communityController/ConfigController.java
  36. +2
    -2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/communityController/GoodsController.java
  37. +8
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/communityController/LoginApiController.java
  38. +1
    -1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/ActivityService.java
  39. +19
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/CommunityService.java
  40. +4
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/ConfigService.java
  41. +1
    -1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/GoodsService.java
  42. +28
    -1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/ActivityServiceImpl.java
  43. +125
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/CommunityServiceImpl.java
  44. +81
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/ConfigServiceImpl.java
  45. +21
    -4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/GoodsServiceImpl.java
  46. +5
    -5
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/IndexServiceImpl.java
  47. +1
    -1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/OrderServiceImpl.java

+ 11
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityActivity/entity/CommunityActivity.java View File

@ -5,10 +5,12 @@ import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
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.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.modules.communityGoods.entity.CommunityGoods;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
@ -114,4 +116,13 @@ public class CommunityActivity implements Serializable {
@Dict(dicCode = "community_is_hot")
@ApiModelProperty(value = "是否推荐活动")
private java.lang.String isHot;
//是否被收藏
@TableField(exist = false)
int isCollection;
//是否已报名
@TableField(exist = false)
int isApply;
}

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

@ -39,7 +39,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 活动报名表
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Date: 2025-07-28
* @Version: V1.0
*/
@Api(tags="活动报名表")


+ 6
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityActivityApply/entity/CommunityActivityApply.java View File

@ -22,7 +22,7 @@ import lombok.experimental.Accessors;
/**
* @Description: 活动报名表
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Date: 2025-07-28
* @Version: V1.0
*/
@Data
@ -53,6 +53,11 @@ public class CommunityActivityApply implements Serializable {
@Excel(name = "姓名", width = 15)
@ApiModelProperty(value = "姓名")
private java.lang.String name;
/**性别*/
@Excel(name = "性别", width = 15, dicCode = "community_sex")
@Dict(dicCode = "community_sex")
@ApiModelProperty(value = "性别")
private java.lang.String sex;
/**手机号*/
@Excel(name = "手机号", width = 15)
@ApiModelProperty(value = "手机号")


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

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 活动报名表
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Date: 2025-07-28
* @Version: V1.0
*/
public interface CommunityActivityApplyMapper extends BaseMapper<CommunityActivityApply> {


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

@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 活动报名表
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Date: 2025-07-28
* @Version: V1.0
*/
public interface ICommunityActivityApplyService extends IService<CommunityActivityApply> {


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

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 活动报名表
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Date: 2025-07-28
* @Version: V1.0
*/
@Service


+ 6
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityActivityApply/vue/CommunityActivityApplyList.vue View File

@ -127,6 +127,11 @@
align:"center",
dataIndex: 'name'
},
{
title:'性别',
align:"center",
dataIndex: 'sex_dictText'
},
{
title:'手机号',
align:"center",
@ -192,6 +197,7 @@
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'name',text:'姓名',dictCode:''})
fieldList.push({type:'string',value:'sex',text:'性别',dictCode:'community_sex'})
fieldList.push({type:'string',value:'phone',text:'手机号',dictCode:''})
fieldList.push({type:'Text',value:'area',text:'所在地区',dictCode:''})
fieldList.push({type:'Text',value:'address',text:'详细地址',dictCode:''})


+ 5
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityActivityApply/vue/modules/CommunityActivityApplyForm.vue View File

@ -8,6 +8,11 @@
<a-input v-model="model.name" placeholder="请输入姓名" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="性别" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sex">
<j-dict-select-tag type="list" v-model="model.sex" dictCode="community_sex" placeholder="请选择性别" />
</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>


+ 13
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityActivityApply/vue3/CommunityActivityApply.data.ts View File

@ -9,6 +9,11 @@ export const columns: BasicColumn[] = [
align:"center",
dataIndex: 'name'
},
{
title: '性别',
align:"center",
dataIndex: 'sex_dictText'
},
{
title: '手机号',
align:"center",
@ -50,6 +55,14 @@ export const formSchema: FormSchema[] = [
field: 'name',
component: 'Input',
},
{
label: '性别',
field: 'sex',
component: 'JDictSelectTag',
componentProps:{
dictCode:"community_sex"
},
},
{
label: '手机号',
field: 'phone',


+ 7
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityGoods/entity/CommunityGoods.java View File

@ -4,7 +4,10 @@ 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.Data;
@ -81,4 +84,8 @@ public class CommunityGoods implements Serializable {
@Dict(dicCode = "community_is_del")
@ApiModelProperty(value = "是否下架")
private java.lang.String isDel;
//是否被收藏
@TableField(exist = false)
int isCollection;
}

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

@ -39,7 +39,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 商品订单表
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Date: 2025-07-28
* @Version: V1.0
*/
@Api(tags="商品订单表")


+ 5
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityOrder/entity/CommunityOrder.java View File

@ -20,7 +20,7 @@ import lombok.experimental.Accessors;
/**
* @Description: 商品订单表
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Date: 2025-07-28
* @Version: V1.0
*/
@Data
@ -64,6 +64,10 @@ public class CommunityOrder implements Serializable {
@Dict(dicCode = "community_status_order")
@ApiModelProperty(value = "订单状态")
private java.lang.String status;
/**订单详情*/
@Excel(name = "订单详情", width = 15)
@ApiModelProperty(value = "订单详情")
private java.lang.String details;
/**关联商品*/
@Excel(name = "关联商品", width = 15, dictTable = "community_goods", dicText = "title", dicCode = "id")
@Dict(dictTable = "community_goods", dicText = "title", dicCode = "id")


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

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 商品订单表
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Date: 2025-07-28
* @Version: V1.0
*/
public interface CommunityOrderMapper extends BaseMapper<CommunityOrder> {


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

@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 商品订单表
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Date: 2025-07-28
* @Version: V1.0
*/
public interface ICommunityOrderService extends IService<CommunityOrder> {


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

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 商品订单表
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Date: 2025-07-28
* @Version: V1.0
*/
@Service


+ 6
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityOrder/vue/CommunityOrderList.vue View File

@ -143,6 +143,11 @@
align:"center",
dataIndex: 'status_dictText'
},
{
title:'订单详情',
align:"center",
dataIndex: 'details'
},
{
title:'关联商品',
align:"center",
@ -191,6 +196,7 @@
fieldList.push({type:'Text',value:'image',text:'订单图片',dictCode:''})
fieldList.push({type:'int',value:'price',text:'订单价格',dictCode:''})
fieldList.push({type:'string',value:'status',text:'订单状态',dictCode:'community_status_order'})
fieldList.push({type:'Text',value:'details',text:'订单详情',dictCode:''})
fieldList.push({type:'string',value:'goodsId',text:'关联商品',dictCode:"community_goods,title,id"})
fieldList.push({type:'string',value:'userId',text:'关联用户',dictCode:"han_hai_member,nick_name,id"})
this.superFieldList = fieldList


+ 5
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityOrder/vue/modules/CommunityOrderForm.vue View File

@ -23,6 +23,11 @@
<j-dict-select-tag type="list" v-model="model.status" dictCode="community_status_order" placeholder="请选择订单状态" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="订单详情" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="details">
<a-input v-model="model.details" placeholder="请输入订单详情" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="关联商品" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goodsId">
<j-dict-select-tag type="list" v-model="model.goodsId" dictCode="community_goods,title,id" placeholder="请选择关联商品" />


+ 10
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityOrder/vue3/CommunityOrder.data.ts View File

@ -25,6 +25,11 @@ export const columns: BasicColumn[] = [
align:"center",
dataIndex: 'status_dictText'
},
{
title: '订单详情',
align:"center",
dataIndex: 'details'
},
{
title: '关联商品',
align:"center",
@ -66,6 +71,11 @@ export const formSchema: FormSchema[] = [
dictCode:"community_status_order"
},
},
{
label: '订单详情',
field: 'details',
component: 'Input',
},
{
label: '关联商品',
field: 'goodsId',


+ 119
- 29
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/controller/CommunityPostController.java View File

@ -1,36 +1,42 @@
package org.jeecg.modules.communityPost.controller;
import java.io.UnsupportedEncodingException;
import java.io.IOException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.communityPost.entity.CommunityPost;
import org.jeecg.modules.communityPost.service.ICommunityPostService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.vo.LoginUser;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.communityPost.entity.CommunityComment;
import org.jeecg.modules.communityPost.entity.CommunityPost;
import org.jeecg.modules.communityPost.vo.CommunityPostPage;
import org.jeecg.modules.communityPost.service.ICommunityPostService;
import org.jeecg.modules.communityPost.service.ICommunityCommentService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -39,16 +45,18 @@ import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 帖子动态信息表
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Date: 2025-07-28
* @Version: V1.0
*/
@Api(tags="帖子动态信息表")
@RestController
@RequestMapping("/communityPost/communityPost")
@Slf4j
public class CommunityPostController extends JeecgController<CommunityPost, ICommunityPostService> {
public class CommunityPostController {
@Autowired
private ICommunityPostService communityPostService;
@Autowired
private ICommunityCommentService communityCommentService;
/**
* 分页列表查询
@ -75,28 +83,36 @@ public class CommunityPostController extends JeecgController<CommunityPost, ICom
/**
* 添加
*
* @param communityPost
* @param communityPostPage
* @return
*/
@AutoLog(value = "帖子动态信息表-添加")
@ApiOperation(value="帖子动态信息表-添加", notes="帖子动态信息表-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody CommunityPost communityPost) {
communityPostService.save(communityPost);
public Result<String> add(@RequestBody CommunityPostPage communityPostPage) {
CommunityPost communityPost = new CommunityPost();
BeanUtils.copyProperties(communityPostPage, communityPost);
communityPostService.saveMain(communityPost, communityPostPage.getCommunityCommentList());
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param communityPost
* @param communityPostPage
* @return
*/
@AutoLog(value = "帖子动态信息表-编辑")
@ApiOperation(value="帖子动态信息表-编辑", notes="帖子动态信息表-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody CommunityPost communityPost) {
communityPostService.updateById(communityPost);
public Result<String> edit(@RequestBody CommunityPostPage communityPostPage) {
CommunityPost communityPost = new CommunityPost();
BeanUtils.copyProperties(communityPostPage, communityPost);
CommunityPost communityPostEntity = communityPostService.getById(communityPost.getId());
if(communityPostEntity==null) {
return Result.error("未找到对应数据");
}
communityPostService.updateMain(communityPost, communityPostPage.getCommunityCommentList());
return Result.OK("编辑成功!");
}
@ -110,7 +126,7 @@ public class CommunityPostController extends JeecgController<CommunityPost, ICom
@ApiOperation(value="帖子动态信息表-通过id删除", notes="帖子动态信息表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
communityPostService.removeById(id);
communityPostService.delMain(id);
return Result.OK("删除成功!");
}
@ -124,8 +140,8 @@ public class CommunityPostController extends JeecgController<CommunityPost, ICom
@ApiOperation(value="帖子动态信息表-批量删除", notes="帖子动态信息表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.communityPostService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
this.communityPostService.delBatchMain(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功");
}
/**
@ -143,6 +159,21 @@ public class CommunityPostController extends JeecgController<CommunityPost, ICom
return Result.error("未找到对应数据");
}
return Result.OK(communityPost);
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "帖子评论表通过主表ID查询")
@ApiOperation(value="帖子评论表主表ID查询", notes="帖子评论表-通主表ID查询")
@GetMapping(value = "/queryCommunityCommentByMainId")
public Result<List<CommunityComment>> queryCommunityCommentListByMainId(@RequestParam(name="id",required=true) String id) {
List<CommunityComment> communityCommentList = communityCommentService.selectByMainId(id);
return Result.OK(communityCommentList);
}
/**
@ -153,11 +184,43 @@ public class CommunityPostController extends JeecgController<CommunityPost, ICom
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, CommunityPost communityPost) {
return super.exportXls(request, communityPost, CommunityPost.class, "帖子动态信息表");
// Step.1 组装查询条件查询数据
QueryWrapper<CommunityPost> queryWrapper = QueryGenerator.initQueryWrapper(communityPost, request.getParameterMap());
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//Step.2 获取导出数据
List<CommunityPost> queryList = communityPostService.list(queryWrapper);
// 过滤选中数据
String selections = request.getParameter("selections");
List<CommunityPost> communityPostList = new ArrayList<CommunityPost>();
if(oConvertUtils.isEmpty(selections)) {
communityPostList = queryList;
}else {
List<String> selectionList = Arrays.asList(selections.split(","));
communityPostList = queryList.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList());
}
// Step.3 组装pageList
List<CommunityPostPage> pageList = new ArrayList<CommunityPostPage>();
for (CommunityPost main : communityPostList) {
CommunityPostPage vo = new CommunityPostPage();
BeanUtils.copyProperties(main, vo);
List<CommunityComment> communityCommentList = communityCommentService.selectByMainId(main.getId());
vo.setCommunityCommentList(communityCommentList);
pageList.add(vo);
}
// Step.4 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
mv.addObject(NormalExcelConstants.FILE_NAME, "帖子动态信息表列表");
mv.addObject(NormalExcelConstants.CLASS, CommunityPostPage.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("帖子动态信息表数据", "导出人:"+sysUser.getRealname(), "帖子动态信息表"));
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
/**
* 通过excel导入数据
* 通过excel导入数据
*
* @param request
* @param response
@ -165,7 +228,34 @@ public class CommunityPostController extends JeecgController<CommunityPost, ICom
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, CommunityPost.class);
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<CommunityPostPage> list = ExcelImportUtil.importExcel(file.getInputStream(), CommunityPostPage.class, params);
for (CommunityPostPage page : list) {
CommunityPost po = new CommunityPost();
BeanUtils.copyProperties(page, po);
communityPostService.saveMain(po, page.getCommunityCommentList());
}
return Result.OK("文件导入成功!数据行数:" + list.size());
} catch (Exception e) {
log.error(e.getMessage(),e);
return Result.error("文件导入失败:"+e.getMessage());
} finally {
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return Result.OK("文件导入失败!");
}
}

+ 55
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/entity/CommunityComment.java View File

@ -0,0 +1,55 @@
package org.jeecg.modules.communityPost.entity;
import java.io.Serializable;
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 java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.UnsupportedEncodingException;
/**
* @Description: 帖子评论表
* @Author: jeecg-boot
* @Date: 2025-07-28
* @Version: V1.0
*/
@ApiModel(value="community_comment对象", description="帖子评论表")
@Data
@TableName("community_comment")
public class CommunityComment 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 content;
/**图片*/
@Excel(name = "图片", width = 15)
@ApiModelProperty(value = "图片")
private java.lang.String image;
/**关联帖子*/
@ApiModelProperty(value = "关联帖子")
private java.lang.String postId;
}

+ 12
- 9
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/entity/CommunityPost.java View File

@ -3,8 +3,10 @@ package org.jeecg.modules.communityPost.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.Data;
@ -14,20 +16,16 @@ import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 帖子动态信息表
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Date: 2025-07-28
* @Version: V1.0
*/
@ApiModel(value="community_post对象", description="帖子动态信息表")
@Data
@TableName("community_post")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="community_post对象", description="帖子动态信息表")
public class CommunityPost implements Serializable {
private static final long serialVersionUID = 1L;
@ -57,12 +55,17 @@ public class CommunityPost implements Serializable {
private java.lang.String image;
/**动态类型*/
@Excel(name = "动态类型", width = 15, dicCode = "communit_typey_post")
@Dict(dicCode = "communit_typey_post")
@Dict(dicCode = "communit_typey_post")
@ApiModelProperty(value = "动态类型")
private java.lang.String type;
/**关联用户*/
@Excel(name = "关联用户", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id")
@Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id")
@Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id")
@ApiModelProperty(value = "关联用户")
private java.lang.String userId;
//评论列表
@TableField(exist = false)
List<CommunityComment> communityCommentList;
}

+ 19
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/mapper/CommunityCommentMapper.java View File

@ -0,0 +1,19 @@
package org.jeecg.modules.communityPost.mapper;
import java.util.List;
import org.jeecg.modules.communityPost.entity.CommunityComment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
/**
* @Description: 帖子评论表
* @Author: jeecg-boot
* @Date: 2025-07-28
* @Version: V1.0
*/
public interface CommunityCommentMapper extends BaseMapper<CommunityComment> {
public boolean deleteByMainId(@Param("mainId") String mainId);
public List<CommunityComment> selectByMainId(@Param("mainId") String mainId);
}

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

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 帖子动态信息表
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Date: 2025-07-28
* @Version: V1.0
*/
public interface CommunityPostMapper extends BaseMapper<CommunityPost> {


+ 16
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/mapper/xml/CommunityCommentMapper.xml View File

@ -0,0 +1,16 @@
<?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.communityPost.mapper.CommunityCommentMapper">
<delete id="deleteByMainId" parameterType="java.lang.String">
DELETE
FROM community_comment
WHERE
post_id = #{mainId} </delete>
<select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.communityPost.entity.CommunityComment">
SELECT *
FROM community_comment
WHERE
post_id = #{mainId} </select>
</mapper>

+ 16
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/service/ICommunityCommentService.java View File

@ -0,0 +1,16 @@
package org.jeecg.modules.communityPost.service;
import org.jeecg.modules.communityPost.entity.CommunityComment;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @Description: 帖子评论表
* @Author: jeecg-boot
* @Date: 2025-07-28
* @Version: V1.0
*/
public interface ICommunityCommentService extends IService<CommunityComment> {
public List<CommunityComment> selectByMainId(String mainId);
}

+ 27
- 1
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/service/ICommunityPostService.java View File

@ -1,14 +1,40 @@
package org.jeecg.modules.communityPost.service;
import org.jeecg.modules.communityPost.entity.CommunityComment;
import org.jeecg.modules.communityPost.entity.CommunityPost;
import com.baomidou.mybatisplus.extension.service.IService;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
/**
* @Description: 帖子动态信息表
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Date: 2025-07-28
* @Version: V1.0
*/
public interface ICommunityPostService extends IService<CommunityPost> {
/**
* 添加一对多
*
*/
public void saveMain(CommunityPost communityPost,List<CommunityComment> communityCommentList) ;
/**
* 修改一对多
*
*/
public void updateMain(CommunityPost communityPost,List<CommunityComment> communityCommentList);
/**
* 删除一对多
*/
public void delMain (String id);
/**
* 批量删除一对多
*/
public void delBatchMain (Collection<? extends Serializable> idList);
}

+ 27
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/service/impl/CommunityCommentServiceImpl.java View File

@ -0,0 +1,27 @@
package org.jeecg.modules.communityPost.service.impl;
import org.jeecg.modules.communityPost.entity.CommunityComment;
import org.jeecg.modules.communityPost.mapper.CommunityCommentMapper;
import org.jeecg.modules.communityPost.service.ICommunityCommentService;
import org.springframework.stereotype.Service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @Description: 帖子评论表
* @Author: jeecg-boot
* @Date: 2025-07-28
* @Version: V1.0
*/
@Service
public class CommunityCommentServiceImpl extends ServiceImpl<CommunityCommentMapper, CommunityComment> implements ICommunityCommentService {
@Autowired
private CommunityCommentMapper communityCommentMapper;
@Override
public List<CommunityComment> selectByMainId(String mainId) {
return communityCommentMapper.selectByMainId(mainId);
}
}

+ 60
- 2
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/service/impl/CommunityPostServiceImpl.java View File

@ -1,19 +1,77 @@
package org.jeecg.modules.communityPost.service.impl;
import org.jeecg.modules.communityPost.entity.CommunityPost;
import org.jeecg.modules.communityPost.entity.CommunityComment;
import org.jeecg.modules.communityPost.mapper.CommunityCommentMapper;
import org.jeecg.modules.communityPost.mapper.CommunityPostMapper;
import org.jeecg.modules.communityPost.service.ICommunityPostService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.List;
import java.util.Collection;
/**
* @Description: 帖子动态信息表
* @Author: jeecg-boot
* @Date: 2025-07-22
* @Date: 2025-07-28
* @Version: V1.0
*/
@Service
public class CommunityPostServiceImpl extends ServiceImpl<CommunityPostMapper, CommunityPost> implements ICommunityPostService {
@Autowired
private CommunityPostMapper communityPostMapper;
@Autowired
private CommunityCommentMapper communityCommentMapper;
@Override
@Transactional(rollbackFor = Exception.class)
public void saveMain(CommunityPost communityPost, List<CommunityComment> communityCommentList) {
communityPostMapper.insert(communityPost);
if(communityCommentList!=null && communityCommentList.size()>0) {
for(CommunityComment entity:communityCommentList) {
//外键设置
entity.setPostId(communityPost.getId());
communityCommentMapper.insert(entity);
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateMain(CommunityPost communityPost,List<CommunityComment> communityCommentList) {
communityPostMapper.updateById(communityPost);
//1.先删除子表数据
communityCommentMapper.deleteByMainId(communityPost.getId());
//2.子表数据重新插入
if(communityCommentList!=null && communityCommentList.size()>0) {
for(CommunityComment entity:communityCommentList) {
//外键设置
entity.setPostId(communityPost.getId());
communityCommentMapper.insert(entity);
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delMain(String id) {
communityCommentMapper.deleteByMainId(id);
communityPostMapper.deleteById(id);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delBatchMain(Collection<? extends Serializable> idList) {
for(Serializable id:idList) {
communityCommentMapper.deleteByMainId(id.toString());
communityPostMapper.deleteById(id);
}
}
}

+ 65
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vo/CommunityPostPage.java View File

@ -0,0 +1,65 @@
package org.jeecg.modules.communityPost.vo;
import java.util.List;
import org.jeecg.modules.communityPost.entity.CommunityPost;
import org.jeecg.modules.communityPost.entity.CommunityComment;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelEntity;
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @Description: 帖子动态信息表
* @Author: jeecg-boot
* @Date: 2025-07-28
* @Version: V1.0
*/
@Data
@ApiModel(value="community_postPage对象", description="帖子动态信息表")
public class CommunityPostPage {
/**主键*/
@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 content;
/**动态图片*/
@Excel(name = "动态图片", width = 15)
@ApiModelProperty(value = "动态图片")
private java.lang.String image;
/**动态类型*/
@Excel(name = "动态类型", width = 15, dicCode = "communit_typey_post")
@Dict(dicCode = "communit_typey_post")
@ApiModelProperty(value = "动态类型")
private java.lang.String type;
/**关联用户*/
@Excel(name = "关联用户", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id")
@Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id")
@ApiModelProperty(value = "关联用户")
private java.lang.String userId;
@ExcelCollection(name="帖子评论表")
@ApiModelProperty(value = "帖子评论表")
private List<CommunityComment> communityCommentList;
}

+ 14
- 15
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue/CommunityPostList.vue View File

@ -8,7 +8,7 @@
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
@ -36,15 +36,15 @@
<a-table
ref="table"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
class="j-table-force-nowrap"
:scroll="{x:true}"
: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">
@ -89,21 +89,20 @@
</a-table>
</div>
<community-post-modal ref="modalForm" @ok="modalFormOk"></community-post-modal>
<community-post-modal ref="modalForm" @ok="modalFormOk"/>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import CommunityPostModal from './modules/CommunityPostModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
import '@/assets/less/TableExpand.less'
export default {
name: 'CommunityPostList',
mixins:[JeecgListMixin, mixinDevice],
name: "CommunityPostList",
mixins:[JeecgListMixin],
components: {
CommunityPostModal
},
@ -149,7 +148,7 @@
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
scopedSlots: { customRender: 'action' },
}
],
url: {
@ -165,22 +164,22 @@
}
},
created() {
this.getSuperFieldList();
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
}
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'content',text:'动态文本',dictCode:''})
fieldList.push({type:'Text',value:'image',text:'动态图片',dictCode:''})
fieldList.push({type:'string',value:'type',text:'动态类型',dictCode:'communit_typey_post'})
fieldList.push({type:'string',value:'userId',text:'关联用户',dictCode:"han_hai_member,nick_name,id"})
fieldList.push({type:'string',value:'content',text:'动态文本',dictCode:''})
fieldList.push({type:'Text',value:'image',text:'动态图片',dictCode:''})
fieldList.push({type:'string',value:'type',text:'动态类型',dictCode:'communit_typey_post'})
fieldList.push({type:'string',value:'userId',text:'关联用户',dictCode:"han_hai_member,nick_name,id"})
this.superFieldList = fieldList
}
}


+ 113
- 52
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue/modules/CommunityPostForm.vue View File

@ -1,24 +1,25 @@
<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-col :span="24" >
<a-form-model-item label="动态文本" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="content">
<a-textarea v-model="model.content" rows="4" placeholder="请输入动态文本" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-col :span="24" >
<a-form-model-item label="动态图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="image">
<j-image-upload isMultiple v-model="model.image" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-col :span="24" >
<a-form-model-item label="动态类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type">
<j-dict-select-tag type="list" v-model="model.type" dictCode="communit_typey_post" placeholder="请选择动态类型" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-col :span="24" >
<a-form-model-item label="关联用户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userId">
<j-dict-select-tag type="list" v-model="model.userId" dictCode="han_hai_member,nick_name,id" placeholder="请选择关联用户" />
</a-form-model-item>
@ -26,30 +27,38 @@
</a-row>
</a-form-model>
</j-form-container>
<!-- 子表单区域 -->
<a-tabs v-model="activeKey" @change="handleChangeTabs">
<a-tab-pane tab="帖子评论表" :key="refKeys[0]" :forceRender="true">
<j-editable-table
:ref="refKeys[0]"
:loading="communityCommentTable.loading"
:columns="communityCommentTable.columns"
:dataSource="communityCommentTable.dataSource"
:maxHeight="300"
:disabled="formDisabled"
:rowNumber="true"
:rowSelection="true"
:actionButton="true"/>
</a-tab-pane>
</a-tabs>
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { getAction } from '@/api/manage'
import { FormTypes,getRefPromise,VALIDATE_NO_PASSED } from '@/utils/JEditableTableUtil'
import { JEditableTableModelMixin } from '@/mixins/JEditableTableModelMixin'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'CommunityPostForm',
mixins: [JEditableTableModelMixin],
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
data() {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
@ -58,62 +67,114 @@
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
model:{
},
//
addDefaultRowNum: 1,
validatorRules: {
},
refKeys: ['communityComment', ],
tableKeys:['communityComment', ],
activeKey: 'communityComment',
//
communityCommentTable: {
loading: false,
dataSource: [],
columns: [
{
title: '文字描述',
key: 'content',
type: FormTypes.input,
width:"200px",
placeholder: '请输入${title}',
defaultValue:'',
},
{
title: '图片',
key: 'image',
type: FormTypes.image,
token:true,
responseName:"message",
width:"200px",
placeholder: '请输入${title}',
defaultValue:'',
},
]
},
url: {
add: "/communityPost/communityPost/add",
edit: "/communityPost/communityPost/edit",
queryById: "/communityPost/communityPost/queryById"
queryById: "/communityPost/communityPost/queryById",
communityComment: {
list: '/communityPost/communityPost/queryCommunityCommentByMainId'
},
}
}
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
addBefore(){
this.communityCommentTable.dataSource=[]
},
getAllTable() {
let values = this.tableKeys.map(key => getRefPromise(this, key))
return Promise.all(values)
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
/** 调用完edit()方法之后会自动调用此方法 */
editAfter() {
this.$nextTick(() => {
})
//
if (this.model.id) {
let params = { id: this.model.id }
this.requestSubTableData(this.url.communityComment.list, params, this.communityCommentTable)
}
},
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);
//
validateSubForm(allValues){
return new Promise((resolve,reject)=>{
Promise.all([
]).then(() => {
resolve(allValues)
}).catch(e => {
if (e.error === VALIDATE_NO_PASSED) {
// tab
this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index]
} else {
console.error(e)
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
})
},
/** 整理成formData */
classifyIntoFormData(allValues) {
let main = Object.assign(this.model, allValues.formValue)
return {
...main, //
communityCommentList: allValues.tablesValue[0].values,
}
},
validateError(msg){
this.$message.error(msg)
},
}
}
</script>
</script>
<style scoped>
</style>

+ 12
- 8
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityPost/vue/modules/CommunityPostModal.vue View File

@ -1,26 +1,27 @@
<template>
<j-modal
:title="title"
:width="width"
:width="1200"
:visible="visible"
:maskClosable="false"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<community-post-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></community-post-form>
@cancel="handleCancel">
<community-post-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"/>
</j-modal>
</template>
<script>
import CommunityPostForm from './CommunityPostForm'
export default {
name: 'CommunityPostModal',
components: {
CommunityPostForm
},
data () {
data() {
return {
title:'',
width:800,
@ -28,7 +29,7 @@
disableSubmit: false
}
},
methods: {
methods:{
add () {
this.visible=true
this.$nextTick(()=>{
@ -46,7 +47,7 @@
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
this.$refs.realForm.handleOk();
},
submitCallback(){
this.$emit('ok');
@ -57,4 +58,7 @@
}
}
}
</script>
</script>
<style scoped>
</style>

+ 2
- 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/communityController/ActivityController.java View File

@ -41,8 +41,8 @@ public class ActivityController {
//获取活动详情
@ApiOperation(value="活动-获取活动详情", notes="活动-获取活动详情")
@RequestMapping(value = "/queryActivityById", method = {RequestMethod.GET})
public Result<?> queryActivityById(String activityId){
return activityService.queryActivityById(activityId);
public Result<?> queryActivityById(String token, String activityId){
return activityService.queryActivityById(token, activityId);
}
//收藏活动


+ 42
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/communityController/CommunityController.java View File

@ -0,0 +1,42 @@
package org.jeecg.modules.api.communityController;
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.PageBean;
import org.jeecg.modules.api.service.CommunityService;
import org.jeecg.modules.communityPost.entity.CommunityPost;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@Api(tags="社区-相关接口")
@RestController
@RequestMapping("/community/comment")
@Slf4j
public class CommunityController {
/******************************************************************************************************************/
@Resource
private CommunityService communityService;
/******************************************************************************************************************/
//获取banner图列表
@ApiOperation(value="社区-获取帖子列表", notes="type:0-木邻说 1-木邻见")
@RequestMapping(value = "/queryPostList", method = {RequestMethod.GET})
public Result<?> queryPostList(CommunityPost communityPost, PageBean pageBean){
return communityService.queryPostList(communityPost, pageBean);
}
//上传帖子
@ApiOperation(value="社区-上传帖子", notes="type:0-木邻说 1-木邻见")
@RequestMapping(value = "/addPost", method = {RequestMethod.POST})
public Result<?> addPost(@RequestHeader("X-Access-Token") String token, CommunityPost communityPost){
return communityService.addPost(token, communityPost);
}
}

+ 14
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/communityController/ConfigController.java View File

@ -50,4 +50,18 @@ public class ConfigController {
return configService.queryQualificationList(pageBean);
}
//查询学历信息列表
@ApiOperation(value="系统配置-查询活动分类列表", notes="系统配置-查询活动分类列表")
@RequestMapping(value = "/queryCategoryActivityList", method = {RequestMethod.GET})
public Result<?> queryCategoryActivityList(PageBean pageBean){
return configService.queryCategoryActivityList(pageBean);
}
//查询商品分类列表
@ApiOperation(value="系统配置-查询商品分类列表", notes="系统配置-查询商品分类列表")
@RequestMapping(value = "/queryCategoryGoodsList", method = {RequestMethod.GET})
public Result<?> queryCategoryGoodsList(PageBean pageBean){
return configService.queryCategoryGoodsList(pageBean);
}
}

+ 2
- 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/communityController/GoodsController.java View File

@ -38,8 +38,8 @@ public class GoodsController {
//获取商品详情
@ApiOperation(value="首页-获取商品详情", notes="首页-获取商品详情")
@RequestMapping(value = "/queryGoodsById", method = {RequestMethod.GET})
public Result<?> queryGoodsById(String goodsId){
return goodsService.queryGoodsById(goodsId);
public Result<?> queryGoodsById(String token, String goodsId){
return goodsService.queryGoodsById(token, goodsId);
}
//商品收藏-获取我收藏的商品列表


+ 8
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/communityController/LoginApiController.java View File

@ -1,13 +1,21 @@
package org.jeecg.modules.api.communityController;
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.service.LoginApiService;
import org.jeecg.modules.bean.LoginReq;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@Api(tags="登录-相关接口")
@RestController
@RequestMapping("/community/login")
@Slf4j
public class LoginApiController {
/******************************************************************************************************************/
//工作信息


+ 1
- 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/ActivityService.java View File

@ -16,7 +16,7 @@ public interface ActivityService {
public Result<?> queryActivityList(CommunityActivity communityActivity, PageBean pageBean);
//获取活动详情
public Result<?> queryActivityById(String activityId);
public Result<?> queryActivityById(String token, String activityId);
//获取我收藏的活动列表
public Result<?> queryActivityCollectionList(String token, PageBean pageBean);


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

@ -0,0 +1,19 @@
package org.jeecg.modules.api.service;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.api.bean.PageBean;
import org.jeecg.modules.communityPost.entity.CommunityPost;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
public interface CommunityService {
//获取帖子列表
public Result<?> queryPostList(CommunityPost communityPost, PageBean pageBean);
//上传帖子
public Result<?> addPost(String token, CommunityPost communityPost);
}

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

@ -16,5 +16,9 @@ public interface ConfigService {
public Result<?> queryCareerList(PageBean pageBean);
//查询学历信息列表
public Result<?> queryQualificationList(PageBean pageBean);
//查询活动分类列表
public Result<?> queryCategoryActivityList(PageBean pageBean);
//查询商品分类列表
public Result<?> queryCategoryGoodsList(PageBean pageBean);
}

+ 1
- 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/GoodsService.java View File

@ -16,7 +16,7 @@ public interface GoodsService {
public Result<?> queryGoodsList(CommunityGoods communityGoods, PageBean pageBean);
//获取商品详情
public Result<?> queryGoodsById(String goodsId);
public Result<?> queryGoodsById(String token, String goodsId);
//商品收藏-获取我收藏的商品列表/详情
public Result<?> queryGoodsCollectionList(String token, PageBean pageBean);


+ 28
- 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/ActivityServiceImpl.java View File

@ -106,7 +106,7 @@ public class ActivityServiceImpl implements ActivityService {
//获取活动信息详情
@Override
public Result<?> queryActivityById(String activityId) {
public Result<?> queryActivityById(String token, String activityId) {
log.info("开始查询活动信息详情");
//返回信息
String massege = "";
@ -121,6 +121,33 @@ public class ActivityServiceImpl implements ActivityService {
return Result.OK("活动信息不存在,请检查活动id:"+activityId, one);
}
//判断活动是否被收藏/已报名
one.setIsCollection(0);
one.setIsApply(0);
if(StringUtils.isNotEmpty(token)){
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
//1判断活动是否被收藏
CommunityActivityCollection collection = communityActivityCollectionService
.lambdaQuery()
.eq(CommunityActivityCollection::getUserId, hanHaiMember.getId())
.eq(CommunityActivityCollection::getActivityId, one.getId())
.one();
if(null != collection){
one.setIsCollection(1);
}
//1判断活动是否已报名
CommunityActivityApply apply = communityActivityApplyService
.lambdaQuery()
.eq(CommunityActivityApply::getUserId, hanHaiMember.getId())
.eq(CommunityActivityApply::getActivityId, one.getId())
.one();
if(null != apply){
one.setIsApply(1);
}
}
log.info("活动信息详情查询结束");
return Result.OK("活动信息详情", one);
}catch (Exception e){


+ 125
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/CommunityServiceImpl.java View File

@ -0,0 +1,125 @@
package org.jeecg.modules.api.service.impl;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.config.shiro.ShiroRealm;
import org.jeecg.modules.api.bean.PageBean;
import org.jeecg.modules.api.service.CommunityService;
import org.jeecg.modules.communityActivity.entity.CommunityActivity;
import org.jeecg.modules.communityActivityApply.entity.CommunityActivityApply;
import org.jeecg.modules.communityBanner.entity.CommunityBanner;
import org.jeecg.modules.communityBanner.service.ICommunityBannerService;
import org.jeecg.modules.communityPost.entity.CommunityComment;
import org.jeecg.modules.communityPost.entity.CommunityPost;
import org.jeecg.modules.communityPost.service.ICommunityCommentService;
import org.jeecg.modules.communityPost.service.ICommunityPostService;
import org.jeecg.modules.hanHaiMember.entity.HanHaiMember;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Service
@Slf4j
public class CommunityServiceImpl implements CommunityService {
/******************************************************************************************************************/
//权限验证
@Resource
private ShiroRealm shiroRealm;
//帖子信息
@Resource
private ICommunityPostService communityPostService;
//评论信息
@Resource
private ICommunityCommentService communityCommentService;
/******************************************************************************************************************/
//获取帖子列表
@Override
public Result<?> queryPostList(CommunityPost communityPost, PageBean pageBean) {
log.info("开始查询帖子列表");
//返回信息
String massege = "";
//分页信息
Page<CommunityPost> page = null;
//查询信息
LambdaQueryChainWrapper<CommunityPost> query = null;
//返回信息
Page<CommunityPost> pageList = null;
try{
//分页
page = new Page<CommunityPost>(pageBean.getPageNo(), pageBean.getPageSize());
query = communityPostService
.lambdaQuery();
//组装查询条件
if(StringUtils.isNotBlank(communityPost.getType())){
//分类
query.eq(CommunityPost::getType, communityPost.getType());
}
//按照创建时间降序排列
query.orderByDesc(CommunityPost::getCreateTime);
//获取帖子列表
pageList = query.page(page);
List<CommunityComment> communityCommentList = communityCommentService.list();
for (CommunityPost record : pageList.getRecords()) {
List<CommunityComment> commentList = new ArrayList<>();
for (CommunityComment communityComment : communityCommentList) {
if(record.getId().equals(communityComment.getPostId())){
commentList.add(communityComment);
}
}
record.setCommunityCommentList(commentList);
}
log.info("帖子列表查询结束");
return Result.OK("帖子图列表", pageList);
}catch (Exception e){
log.info("帖子列表查询失败");
e.printStackTrace();
return Result.error("帖子列表查询失败");
}
}
//上传帖子
@Override
public Result<?> addPost(String token, CommunityPost communityPost) {
log.info("上传帖子开始");
//权限验证
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
//HanHaiMember hanHaiMember = hanHaiMemberService.getById(token);
//返回信息
String massege = "";
try{
//1上传帖子
log.info("执行上传帖子");
communityPost.setUserId(hanHaiMember.getId());
boolean result = communityPostService.save(communityPost);
//判断是否新增成功
if(result){
log.info("上传帖子成功");
return Result.OK("上传帖子成功");
}else {
log.info("上传帖子失败");
return Result.error("上传帖子失败");
}
}catch (Exception e){
log.error("上传帖子失败");
e.printStackTrace();
return Result.error("上传帖子失败");
}
}
}

+ 81
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/ConfigServiceImpl.java View File

@ -8,6 +8,10 @@ import org.jeecg.modules.api.bean.PageBean;
import org.jeecg.modules.api.service.ConfigService;
import org.jeecg.modules.communityCareer.entity.CommunityCareer;
import org.jeecg.modules.communityCareer.service.ICommunityCareerService;
import org.jeecg.modules.communityCategoryActivity.entity.CommunityCategoryActivity;
import org.jeecg.modules.communityCategoryActivity.service.ICommunityCategoryActivityService;
import org.jeecg.modules.communityCategoryGoods.entity.CommunityCategoryGoods;
import org.jeecg.modules.communityCategoryGoods.service.ICommunityCategoryGoodsService;
import org.jeecg.modules.communityConfig.entity.CommunityConfig;
import org.jeecg.modules.communityConfig.service.ICommunityConfigService;
import org.jeecg.modules.communityQualifications.entity.CommunityQualifications;
@ -30,6 +34,12 @@ public class ConfigServiceImpl implements ConfigService {
//学历信息
@Resource
private ICommunityQualificationsService communityQualificationsService;
//活动分类
@Resource
private ICommunityCategoryActivityService communityCategoryActivityService;
//商品分类
@Resource
private ICommunityCategoryGoodsService communityCategoryGoodsService;
/******************************************************************************************************************/
//查询系统配置列表
@Override
@ -157,4 +167,75 @@ public class ConfigServiceImpl implements ConfigService {
return Result.error("学历信息列表查询失败");
}
}
//查询活动分类列表
@Override
public Result<?> queryCategoryActivityList(PageBean pageBean) {
log.info("开始查询活动分类列表");
//返回信息
String massege = "";
//分页信息
Page<CommunityCategoryActivity> page = null;
//查询信息
LambdaQueryChainWrapper<CommunityCategoryActivity> query = null;
//返回信息
Page<CommunityCategoryActivity> pageList = null;
try{
//分页
page = new Page<CommunityCategoryActivity>(pageBean.getPageNo(), pageBean.getPageSize());
query = communityCategoryActivityService
.lambdaQuery();
//组装查询条件
//按照创建时间降序排列
query.orderByDesc(CommunityCategoryActivity::getCreateTime);
//获取活动分类列表信息
pageList = query.page(page);
log.info("活动分类查询结束");
return Result.OK("活动分类列表", pageList);
}catch (Exception e){
log.error("活动分类查询失败");
e.printStackTrace();
return Result.error("活动分类列表查询失败");
}
}
//查询商品分类列表
@Override
public Result<?> queryCategoryGoodsList(PageBean pageBean) {
log.info("开始查询商品分类列表");
//返回信息
String massege = "";
//分页信息
Page<CommunityCategoryGoods> page = null;
//查询信息
LambdaQueryChainWrapper<CommunityCategoryGoods> query = null;
//返回信息
Page<CommunityCategoryGoods> pageList = null;
try{
//分页
page = new Page<CommunityCategoryGoods>(pageBean.getPageNo(), pageBean.getPageSize());
query = communityCategoryGoodsService
.lambdaQuery();
//组装查询条件
//按照创建时间降序排列
query.orderByDesc(CommunityCategoryGoods::getCreateTime);
//获取商品分类列表信息
pageList = query.page(page);
log.info("商品分类查询结束");
return Result.OK("商品分类列表", pageList);
}catch (Exception e){
log.error("商品分类查询失败");
e.printStackTrace();
return Result.error("商品分类列表查询失败");
}
}
}

+ 21
- 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/GoodsServiceImpl.java View File

@ -120,14 +120,15 @@ public class GoodsServiceImpl implements GoodsService {
}
}
//获取商品列表
//获取商品详情
@Override
public Result<?> queryGoodsById(String goodsId) {
public Result<?> queryGoodsById(String token, String goodsId) {
log.info("开始查询商品信息详情");
//返回信息
String massege = "";
try{
//1查询商品
CommunityGoods one = communityGoodsService
.lambdaQuery()
.eq(CommunityGoods::getId, goodsId)
@ -137,6 +138,21 @@ public class GoodsServiceImpl implements GoodsService {
return Result.OK("商品信息不存在,请检查商品id:"+goodsId, one);
}
//2判断商品是否被收藏
one.setIsCollection(0);
if(StringUtils.isNotEmpty(token)){
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
CommunityGoodsCollection collection = communityGoodsCollectionService
.lambdaQuery()
.eq(CommunityGoodsCollection::getUserId, hanHaiMember.getId())
.eq(CommunityGoodsCollection::getGoodsId, one.getId())
.one();
if(null != collection){
one.setIsCollection(1);
}
}
log.info("商品信息详情查询结束");
return Result.OK("商品信息详情", one);
}catch (Exception e){
@ -151,8 +167,8 @@ public class GoodsServiceImpl implements GoodsService {
public Result<?> queryGoodsCollectionList(String token, PageBean pageBean) {
log.info("开始查询商品信息");
//权限验证
//HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
HanHaiMember hanHaiMember = hanHaiMemberService.getById(token);
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
//HanHaiMember hanHaiMember = hanHaiMemberService.getById(token);
//返回信息
String massege = "";
//分页信息
@ -232,6 +248,7 @@ public class GoodsServiceImpl implements GoodsService {
communityOrder.setTitle(goods.getTitle()+"兑换");
communityOrder.setImage(goods.getImage());
communityOrder.setPrice(goods.getPrice());
communityOrder.setDetails(goods.getDetails());
boolean result1 = communityOrderService.save(communityOrder);
//4商品库存减少


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

@ -29,7 +29,7 @@ public class IndexServiceImpl implements IndexService {
//权限验证
@Resource
private ShiroRealm shiroRealm;
//轮播图信息
//帖子列表
@Resource
private ICommunityBannerService communityBannerService;
//公告信息
@ -46,7 +46,7 @@ public class IndexServiceImpl implements IndexService {
//获取banner图列表
@Override
public Result<?> queryBannerList(CommunityBanner communityBanner, PageBean pageBean) {
log.info("开始查询轮播图信息");
log.info("开始查询帖子列表");
//返回信息
String massege = "";
//分页信息
@ -75,13 +75,13 @@ public class IndexServiceImpl implements IndexService {
//按照排序编号升序排列
query.orderByAsc(CommunityBanner::getOrderNo);
//获取轮播图信息
//获取帖子列表
pageList = query.page(page);
log.info("轮播图信息查询结束");
log.info("帖子列表查询结束");
return Result.OK("轮播图列表", pageList);
}catch (Exception e){
log.info("轮播图信息查询失败");
log.info("帖子列表查询失败");
e.printStackTrace();
return Result.error("轮播图列表查询失败");
}


+ 1
- 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/OrderServiceImpl.java View File

@ -98,7 +98,7 @@ public class OrderServiceImpl implements OrderService {
.eq(CommunityOrder::getId, orderId)
.eq(CommunityOrder::getUserId, hanHaiMember.getId())
.one();
if(null != order){
if(null == order){
log.info("订单不存在,请检查订单编号:{}", orderId);
return Result.OK("订单不存在,请检查订单编号:{}", orderId);
}


Loading…
Cancel
Save