江南行增加经理分享计数

This commit is contained in:
34701892@qq.com 2026-02-10 16:38:42 +08:00
parent 513fbcb71e
commit 3d4066ec86
5 changed files with 152 additions and 9 deletions

View File

@ -14,6 +14,15 @@ public class H5UserVO {
private Date createTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
private Date updateTime;
private Long shareCount;
public Long getShareCount() {
return shareCount;
}
public void setShareCount(Long shareCount) {
this.shareCount = shareCount;
}
public Long getId() {
return id;

View File

@ -7,6 +7,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.jinrui.reference.admin.mapper.ShareUserMapper;
import com.jinrui.reference.admin.model.entity.ShareUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
@ -35,13 +37,15 @@ public class H5UserService {
private final JedisPool jedisPool;
private final H5UserMapper h5UserMapper;
private final ShareUserMapper shareUserMapper;
private final ObjectMapper objectMapper;
public H5UserService(JedisPool jedisPool,
H5UserMapper h5UserMapper,
ObjectMapper objectMapper) {
H5UserMapper h5UserMapper, ShareUserMapper shareUserMapper,
ObjectMapper objectMapper) {
this.jedisPool = jedisPool;
this.h5UserMapper = h5UserMapper;
this.shareUserMapper = shareUserMapper;
this.objectMapper = objectMapper;
}
@ -84,6 +88,12 @@ public class H5UserService {
pageObject.setData(Collections.emptyList());
return pageObject;
}
for(H5UserVO h5UserVO : h5UserList) {
Long shareCount = shareUserMapper.getShareUserByPhone(h5UserVO.getMobile());
h5UserVO.setShareCount(shareCount);
}
pageObject.setData(h5UserList);
return pageObject;
}

View File

@ -1,3 +1,6 @@
logging:
level:
root: DEBUG
server:
port: 13579
compression:
@ -22,21 +25,21 @@ spring:
# url: jdbc:mysql://192.168.0.142:3306/reference?autoReconnect=true&useUnicode=true&useSSL=false&allowMultiQueries=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
# username: financial_prod
# password: mmTFncqmDal5HLRGY0BV
url: jdbc:mysql://10.127.2.207:3306/reference?autoReconnect=true&useUnicode=true&useSSL=false&allowMultiQueries=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
username: financial_prod
password: mmTFncqmDal5HLRGY0BV
url: jdbc:mysql://121.37.185.246:3306/reference?autoReconnect=true&useUnicode=true&useSSL=false&allowMultiQueries=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
username: root
password: Xgf_8000
redis:
# host: 192.168.0.172
# port: 6379
# password: Xgf_redis
host: 10.127.2.209
host: 123.60.153.169
port: 6379
password: dMrt4kmwiW6LDJXy
password: Xgf_redis
elasticsearch:
scheme: http
# 111.13.176.3 部署地址
# 10.127.2.194 本地测试地址
host: 10.127.2.194
host: 111.13.176.3
port: 9200
enable: true
username: elastic

View File

@ -0,0 +1,31 @@
package com.jinrui.reference.admin.mapper;
import com.jinrui.reference.admin.model.entity.ShareUser;
import com.jinrui.reference.core.model.entity.NewsTags;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;
import java.util.Date;
import java.util.List;
public interface ShareUserMapper {
@Results({
@Result(column = "id", property = "id", id = true),
@Result(column = "share_user_id", property = "shareUserId"),
@Result(column = "news_id", property = "newsId"),
@Result(column = "create_time", property = "createTime", javaType = Date.class, jdbcType = JdbcType.TIMESTAMP),
@Result(column = "update_time", property = "updateTime", javaType = Date.class, jdbcType = JdbcType.TIMESTAMP),
@Result(column = "share_user_phone", property = "shareUserPhone")
})
@Select("select * from share_user where id = #{id}")
ShareUser getShareUserById(@Param("id") Long id);
@Select("select count(1) from share_user where share_user_phone = #{phone}")
Long getShareUserByPhone(@Param("phone") String phone);
}

View File

@ -0,0 +1,90 @@
package com.jinrui.reference.admin.model.entity;
import java.util.Date;
/**
* 分享明细-目前只有江南行用到
*/
@SuppressWarnings("unused")
public class ShareUser {
/**
* 主键ID
*/
private Long id;
/**
* 分享人id
*/
private Long shareUserId;
/**
* 文章id
*/
private Long newsId;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改时间
*/
private Date updateTime;
/**
* 分享人手机号
*/
private String shareUserPhone;
public ShareUser() {}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getShareUserId() {
return shareUserId;
}
public void setShareUserId(Long shareUserId) {
this.shareUserId = shareUserId;
}
public Long getNewsId() {
return newsId;
}
public void setNewsId(Long newsId) {
this.newsId = newsId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getShareUserPhone() {
return shareUserPhone;
}
public void setShareUserPhone(String shareUserPhone) {
this.shareUserPhone = shareUserPhone;
}
}