Browse Source

Changes

master
主管理员 1 week ago
parent
commit
cb4f217e9f
11 changed files with 203 additions and 30 deletions
  1. +5
    -1
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/cityComment/entity/CityComment.java
  2. +4
    -0
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/entity/HomeGroup.java
  3. +82
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/Final/CommitTypeFinal.java
  4. +0
    -2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/CashoutService.java
  5. +1
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/YaoDuGroupService.java
  6. +42
    -1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/YaoDuApiServiceImpl.java
  7. +55
    -19
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/YaoDuGroupServiceImpl.java
  8. +5
    -3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/utils/CommentNotificationUtil.java
  9. +3
    -2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/utils/WxTemplateUtil.java
  10. +0
    -2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/yaoduapi/CashoutController.java
  11. +6
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/yaoduapi/YaoDuGroupController.java

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

@ -76,13 +76,17 @@ public class CityComment implements Serializable {
private java.lang.String orderId;
/**评论类型*/
@Excel(name = "评论类型", width = 15)
@ApiModelProperty(value = "评论类型")
@ApiModelProperty(value = "评论类型 type-0帖子-1租房-2工作-3景点-4美食-5活动-6人找车-7车找人-8文章")
private java.lang.String type;
/**用户标识*/
@Excel(name = "用户标识", width = 15)
@ApiModelProperty(value = "用户标识")
private java.lang.String userId;
private String replyToId;//回复给用户
private String replyToName;//回复给用户昵称
// private String replyToAvatar;//回复给用户头像
/**父级*/
private java.lang.String pid;


+ 4
- 0
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/homeGroup/entity/HomeGroup.java View File

@ -83,6 +83,10 @@ public class HomeGroup implements Serializable {
@ApiModelProperty(value = "二维码")
private java.lang.String qrCode;
private String shareMsg;//分享信息
private String memberId;//成员 id
@TableField(exist = false)
private List<HomeGroupUser> userList;


+ 82
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/Final/CommitTypeFinal.java View File

@ -0,0 +1,82 @@
package org.jeecg.modules.api.Final;
import org.jeecg.modules.cityComment.entity.CityComment;
public class CommitTypeFinal {
//0帖子-1租房-2工作-3景点-4美食-5活动-6人找车-7车找人-8文章
public static final String POST = "0";//帖子
public static final String RENT = "1";//租房
public static final String WORK = "2";// 工作
public static final String SIGHT = "3";//景点
public static final String FOOD = "4";//美食
public static final String ACTIVITY = "5";// 活动
public static final String FIND_CAR = "6";//人找车
public static final String CAR_FIND = "7";//车找人
public static final String ARTICLE = "8";//文章
//根据类型获取页面路径
public static String getPagePath(String type){
switch (type) {
case POST:
return "/pages_order/post/postDetail";
case RENT:
return "/pages_order/renting/rentingDetail";
case WORK:
return "/pages_order/work/workDetail";
case SIGHT:
return "/pages_order/scenicSpot/scenicSpotDetail";
case FOOD:
return "/pages_order/gourmet/gourmetDetail";
case ACTIVITY:
return "/pages_order/activity/activityDetail";
case FIND_CAR:
return "/pages_order/car/carListDetail";
case CAR_FIND:
return "/pages_order/car/carListDetail";
case ARTICLE:
return "/pages_order/article/index";
}
return "/pages/index/index";
}
/**
* 根据CityComment对象构建页面参数
* @param cityComment 城市评论对象
* @return 页面参数字符串
*/
public static String getPageParams(CityComment cityComment) {
if (cityComment == null) {
return "";
}
StringBuilder params = new StringBuilder();
// 所有详情页面都需要id参数使用orderId作为id
if (cityComment.getOrderId() != null) {
params.append("id=").append(cityComment.getOrderId());
}
// 如果有其他需要传递的参数可以在这里添加
// 例如评论ID用户ID等根据具体业务需求
if (cityComment.getId() != null && params.length() > 0) {
params.append("&commentId=").append(cityComment.getId());
} else if (cityComment.getId() != null) {
params.append("commentId=").append(cityComment.getId());
}
if (cityComment.getUserId() != null) {
if (params.length() > 0) {
params.append("&userId=").append(cityComment.getUserId());
} else {
params.append("userId=").append(cityComment.getUserId());
}
}
return params.toString();
}
}

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

@ -8,11 +8,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
public interface CashoutService {
//会员中心-开通会员
public Result<?> cashout();
//开通会员支付回调
//支付回调
public Object cashoutNotify(@RequestBody String requestBody);


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

@ -18,4 +18,5 @@ public interface YaoDuGroupService {
Page<HomeGroup> getMyPublishedList(String token, YaoDuOrderBean bean);
String join(String token, String id);
}

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

@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.lang.StringUtils;
@ -24,6 +25,7 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.RedisUtil;
import org.jeecg.config.shiro.ShiroRealm;
import org.jeecg.modules.api.Final.CommitTypeFinal;
import org.jeecg.modules.api.bean.HttpClientUtil;
import org.jeecg.modules.api.bean.PageBean;
import org.jeecg.modules.api.bean.WxQrCodeVo;
@ -31,6 +33,7 @@ import org.jeecg.modules.api.service.YaoDuApiService;
import org.jeecg.modules.api.utils.WxTemplateUtil;
import org.jeecg.modules.appletBrowseRecord.entity.AppletBrowseRecord;
import org.jeecg.modules.appletBrowseRecord.service.IAppletBrowseRecordService;
import org.jeecg.modules.homeGroup.service.IHomeGroupService;
import org.jeecg.modules.message.handle.impl.EmailSendMsgHandle;
import org.jeecg.modules.api.utils.CommentNotificationUtil;
import org.jeecg.modules.citiyClass.entity.CitiyClass;
@ -113,6 +116,7 @@ import java.time.LocalTime;
import java.time.ZoneId;
import java.util.*;
@Log4j2
@Service
public class YaoDuApiServiceImpl implements YaoDuApiService {
@ -143,6 +147,9 @@ public class YaoDuApiServiceImpl implements YaoDuApiService {
//获取兼职信息列表
@Resource
private ICityJobService cityJobService;
//获取兼职信息列表
@Resource
private IHomeGroupService homeGroupService;
//获取门店信息列表
@Resource
private ICityShopService cityShopService;
@ -1171,7 +1178,14 @@ public class YaoDuApiServiceImpl implements YaoDuApiService {
}
// 使用评论通知工具类发送通知
commentNotificationUtil.sendCommentNotification(member, hanHaiMember, content, "");
commentNotificationUtil.sendCommentNotification(member, hanHaiMember, content, CommitTypeFinal.getPageParams(cityComment), cityComment.getType());
//发布评论给作者
try {
commentNotificationUtil.sendCommentNotification(getUserByCommit(cityComment), hanHaiMember, content, CommitTypeFinal.getPageParams(cityComment), cityComment.getType());
}catch (Exception e){
log.error("发布评论给作者失败 {}", e);
}
}
}
@ -1202,6 +1216,31 @@ public class YaoDuApiServiceImpl implements YaoDuApiService {
return Result.OK("评论成功");
}
public HanHaiMember getUserByCommit(CityComment comment){
String userId = null;
//type-0帖子-1租房-2工作-3景点-4美食-5活动-6人找车-7车找人-8文章
if ("0".equals(comment.getType())){
userId = cityTrendsService.getById(comment.getOrderId()).getUserId();
}else if ("1".equals(comment.getType())){
userId = cityHomeService.getById(comment.getOrderId()).getUserId();
}else if ("2".equals(comment.getType())){
userId = cityJobService.getById(comment.getOrderId()).getUserId();
}else if ("3".equals(comment.getType())){
return null;
}else if ("4".equals(comment.getType())){
return null;
}else if ("5".equals(comment.getType())){
return null;
} else if ("6".equals(comment.getType())) {
return null;
} else if ("7".equals(comment.getType())) {
return null;
} else if ("8".equals(comment.getType())) {
userId = homeGroupService.getById(comment.getOrderId()).getUserId();
}
return hanHaiMemberService.getById(userId);
}
//删除评论
public Result<?> deleteComment(String token,String id) {
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
@ -1682,6 +1721,8 @@ public class YaoDuApiServiceImpl implements YaoDuApiService {
.lambdaQuery()
.eq(CityConf::getKeyIcon, "withdraw_money")
.one();
//得到提现手续费
BigDecimal money = cityConf.getKeyMoney();
money = money.multiply(bean.getPrice());


+ 55
- 19
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/YaoDuGroupServiceImpl.java View File

@ -58,35 +58,50 @@ public class YaoDuGroupServiceImpl implements YaoDuGroupService {
public HomeGroup queryById(String id){
HomeGroup byId = homeGroupService.getById(id);
// 随机从用户列表中获取3个用户
List<HanHaiMember> allUsers = hanHaiMemberService
.lambdaQuery()
// .ne(HanHaiMember::getHeadImage, "")
// .isNotNull(HanHaiMember::getHeadImage)
.select(HanHaiMember::getNickName, HanHaiMember::getHeadImage)
.list();
if (allUsers != null && !allUsers.isEmpty()) {
// 随机打乱用户列表
Collections.shuffle(allUsers);
// 取前3个用户如果用户总数少于3个则取全部
int userCount = Math.min(Math.min(byId.getNum(), 3), allUsers.size());
List<HanHaiMember> randomUsers = allUsers.subList(0, userCount);
if (StringUtil.isNotEmpty(byId.getMemberId())){
List<HanHaiMember> list = hanHaiMemberService.lambdaQuery()
.eq(HanHaiMember::getId, byId.getMemberId())
.list();
// 创建HomeGroupUser列表
List<HomeGroup.HomeGroupUser> userList = new ArrayList<>();
for (HanHaiMember member : randomUsers) {
for (HanHaiMember member : list) {
HomeGroup.HomeGroupUser groupUser = byId.new HomeGroupUser();
groupUser.setUserName(member.getNickName());
groupUser.setImage(member.getHeadImage());
userList.add(groupUser);
}
// 设置到HomeGroup对象中
byId.setUserList(userList);
}
// 随机从用户列表中获取3个用户
// List<HanHaiMember> allUsers = hanHaiMemberService
// .lambdaQuery()
//// .ne(HanHaiMember::getHeadImage, "")
//// .isNotNull(HanHaiMember::getHeadImage)
// .select(HanHaiMember::getNickName, HanHaiMember::getHeadImage)
// .list();
//
// if (allUsers != null && !allUsers.isEmpty()) {
// // 随机打乱用户列表
// Collections.shuffle(allUsers);
//
// // 取前3个用户如果用户总数少于3个则取全部
// int userCount = Math.min(Math.min(byId.getNum(), 3), allUsers.size());
// List<HanHaiMember> randomUsers = allUsers.subList(0, userCount);
//
// // 创建HomeGroupUser列表
// List<HomeGroup.HomeGroupUser> userList = new ArrayList<>();
// for (HanHaiMember member : randomUsers) {
// HomeGroup.HomeGroupUser groupUser = byId.new HomeGroupUser();
// groupUser.setUserName(member.getNickName());
// groupUser.setImage(member.getHeadImage());
// userList.add(groupUser);
// }
//
// // 设置到HomeGroup对象中
// byId.setUserList(userList);
// }
return byId;
}
@ -102,4 +117,25 @@ public class YaoDuGroupServiceImpl implements YaoDuGroupService {
return page1;
}
@Override
public String join(String token, String id) {
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
HomeGroup byId = homeGroupService.getById(id);
if (byId == null){
return "群不存在";
}
if (StringUtil.isNotEmpty(byId.getMemberId())){
byId.setMemberId(byId.getMemberId() + "," + hanHaiMember.getId());
}else {
byId.setMemberId(hanHaiMember.getId());
}
homeGroupService.updateById(byId);
return "";
}
}

+ 5
- 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/utils/CommentNotificationUtil.java View File

@ -26,7 +26,7 @@ public class CommentNotificationUtil {
* @param content 评论内容
* @param params 额外参数
*/
public void sendCommentNotification(HanHaiMember receiver, HanHaiMember commenter, String content, String params) {
public void sendCommentNotification(HanHaiMember receiver, HanHaiMember commenter, String content, String params, String type) {
if (receiver == null || commenter == null) {
return;
}
@ -38,7 +38,8 @@ public class CommentNotificationUtil {
receiver.getAppletOpenid(),
commenter.getNickName(),
content,
params != null ? params : ""
params != null ? params : "",
type
);
}
} catch (Exception e) {
@ -98,7 +99,8 @@ public class CommentNotificationUtil {
receiverOpenid,
commenterNickName,
content,
params != null ? params : ""
params != null ? params : "",
""
);
}
} catch (Exception e) {


+ 3
- 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/utils/WxTemplateUtil.java View File

@ -10,6 +10,7 @@ import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.jeecg.modules.api.Final.CommitTypeFinal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@ -37,7 +38,7 @@ public class WxTemplateUtil {
* @param content 评论内容
* @param params 页面参数
*/
public void sendCommentMessage(String toUser, String discussant, String content, String params){
public void sendCommentMessage(String toUser, String discussant, String content, String params, String type){
Map<String, Object> data = new HashMap<>();
data.put("thing1", new HashMap<String, String>() {{
put("value", "评论通知");
@ -56,7 +57,7 @@ public class WxTemplateUtil {
put("color", "#173177");
}});
String url = "/pages/index/index";
String url = CommitTypeFinal.getPagePath(type);
if (StringUtils.isNotBlank(params)){
url += "?" + params;


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

@ -15,11 +15,9 @@ import javax.annotation.Resource;
@Slf4j
public class CashoutController {
/******************************************************************************************************************/
//会员信息
@Resource
private CashoutService cashoutService;
/******************************************************************************************************************/
// //会员中心-开通会员
// @ApiOperation(value="测试提现-提现", notes="测试提现-提现")
// @RequestMapping(value = "/cashout", method = {RequestMethod.POST})
// public Result<?> cashout(){


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

@ -25,6 +25,12 @@ public class YaoDuGroupController {
return Result.OK(yaoDuGroupService.list(classId, title, bean));
}
@ApiOperation(value="加入同城群")
@GetMapping(value = "/join")
public Result<?> join(@RequestHeader("X-Access-Token") String token, String id) {
return Result.OK(yaoDuGroupService.join(token, id));
}
@ApiOperation(value="编辑同城群")
@PostMapping(value = "/saveOrUpdate")
public Result<HomeGroup> saveOrUpdate(@RequestHeader("X-Access-Token") String token, HomeGroup group) {


Loading…
Cancel
Save