@@ -83,7 +83,7 @@ public class IndexController { | |||
} | |||
/** | |||
* 获取在线人数 | |||
* 获取累计在线人次 | |||
* | |||
* @param | |||
* @return | |||
@@ -95,14 +95,14 @@ public class IndexController { | |||
/** | |||
* 编辑微信小程序用户 | |||
* 编辑微信小程序用户(由于产品V1.7.0去掉在线人数功能,暂时弃用此接口) | |||
* | |||
* @param westreamUser 实体对象 | |||
* @return | |||
*/ | |||
@PutMapping("/westreamUser/edit") | |||
public JsonResult edit(@RequestBody WestreamUser westreamUser) { | |||
return westreamSceneryService.editInfo(westreamUser); | |||
} | |||
// @PutMapping("/westreamUser/edit") | |||
// public JsonResult edit(@RequestBody WestreamUser westreamUser) { | |||
// return westreamSceneryService.editInfo(westreamUser); | |||
// } | |||
} |
@@ -1,6 +1,5 @@ | |||
package com.tuoheng.api.controller; | |||
import com.tuoheng.api.entity.request.FeedbackQuery; | |||
import com.tuoheng.api.entity.request.WestreamSceneryQuery; | |||
import com.tuoheng.api.service.IWestreamSceneryService; | |||
import com.tuoheng.common.utils.JsonResult; |
@@ -0,0 +1,50 @@ | |||
package com.tuoheng.api.entity.domain; | |||
import com.baomidou.mybatisplus.annotation.TableName; | |||
import com.tuoheng.common.common.BaseEntity; | |||
import lombok.Data; | |||
import lombok.EqualsAndHashCode; | |||
import lombok.experimental.Accessors; | |||
import java.io.Serializable; | |||
/** | |||
* 用户会员表 | |||
* | |||
* @author WangHaoran | |||
* @since 2023-04-12 | |||
*/ | |||
@Data | |||
@EqualsAndHashCode(callSuper = false) | |||
@Accessors(chain = true) | |||
@TableName("th_user_member") | |||
public class UserMember extends BaseEntity implements Serializable { | |||
private static final long serialVersionUID = 1L; | |||
/** | |||
* 租户ID | |||
*/ | |||
private Integer tenantId; | |||
/** | |||
* 用户openid | |||
*/ | |||
private String openid; | |||
/** | |||
* 会员ID(凡科商城用户ID) | |||
*/ | |||
private String memberId; | |||
/** | |||
* 身份ID | |||
*/ | |||
private Integer identityId; | |||
/** | |||
* 登录次数 | |||
*/ | |||
private Integer loginNum; | |||
} |
@@ -20,4 +20,9 @@ public class OnlineNumQuery { | |||
*/ | |||
private String districtCode; | |||
/** | |||
* 租户ID | |||
*/ | |||
private Integer tenantId; | |||
} |
@@ -47,4 +47,9 @@ public class StreamQuery extends BaseQuery { | |||
*/ | |||
private String villageCode; | |||
/** | |||
* 租户ID | |||
*/ | |||
private Integer tenantId; | |||
} |
@@ -26,4 +26,9 @@ public class WestreamActQuery extends BaseQuery { | |||
* 区县编码 | |||
*/ | |||
private String districtCode; | |||
/** | |||
* 租户ID | |||
*/ | |||
private Integer tenantId; | |||
} |
@@ -27,4 +27,9 @@ public class WestreamKnowQuery extends BaseQuery { | |||
*/ | |||
private String districtCode; | |||
/** | |||
* 租户ID | |||
*/ | |||
private Integer tenantId; | |||
} |
@@ -32,4 +32,9 @@ public class WestreamSceneryQuery extends BaseQuery { | |||
*/ | |||
private String openid; | |||
/** | |||
* 租户ID | |||
*/ | |||
private Integer tenantId; | |||
} |
@@ -0,0 +1,16 @@ | |||
package com.tuoheng.api.mapper; | |||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||
import com.tuoheng.api.entity.domain.UserMember; | |||
import com.tuoheng.api.entity.request.OnlineNumQuery; | |||
import org.apache.ibatis.annotations.Param; | |||
/** | |||
* 用户会员表 Mapper 接口 | |||
* | |||
* @author 拓恒 | |||
* @since 2023-04-12 | |||
*/ | |||
public interface UserMemberMapper extends BaseMapper<UserMember> { | |||
Integer selectOnlineNumSum(@Param("query") OnlineNumQuery query); | |||
} |
@@ -50,6 +50,7 @@ public class StreamServiceImpl extends BaseServiceImpl<StreamMapper, Stream> imp | |||
IPage<Stream> page = new Page<>(query.getPage(), query.getLimit()); | |||
IPage<Stream> pageData = streamMapper.selectPage(page, new LambdaQueryWrapper<Stream>() | |||
.eq(Stream::getMark, 1) | |||
.eq(Stream::getTenantId, query.getTenantId()) | |||
.like(StringUtils.isNotEmpty(query.getName()), Stream::getName, query.getName()) | |||
.eq(StringUtils.isNotEmpty(query.getProvinceCode()), Stream::getProvinceCode, query.getProvinceCode()) | |||
.eq(StringUtils.isNotEmpty(query.getCityCode()), Stream::getCityCode, query.getCityCode()) | |||
@@ -97,6 +98,7 @@ public class StreamServiceImpl extends BaseServiceImpl<StreamMapper, Stream> imp | |||
public JsonResult indexAll(StreamQuery query) { | |||
List<Stream> streamList = streamMapper.selectList(new LambdaQueryWrapper<Stream>() | |||
.eq(Stream::getMark, 1) | |||
.eq(Stream::getTenantId, query.getTenantId()) | |||
.eq(StringUtils.isNotEmpty(query.getProvinceCode()), Stream::getProvinceCode, query.getProvinceCode()) | |||
.eq(StringUtils.isNotEmpty(query.getCityCode()), Stream::getCityCode, query.getCityCode()) | |||
.eq(StringUtils.isNotEmpty(query.getDistrictCode()), Stream::getDistrictCode, query.getDistrictCode()) |
@@ -3,10 +3,8 @@ package com.tuoheng.api.service.impl; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.tuoheng.api.entity.domain.Stream; | |||
import com.tuoheng.api.entity.domain.WestreamAct; | |||
import com.tuoheng.api.entity.request.WestreamActQuery; | |||
import com.tuoheng.api.mapper.StreamMapper; | |||
import com.tuoheng.api.mapper.WestreamActMapper; | |||
import com.tuoheng.api.service.IWestreamActService; | |||
import com.tuoheng.common.common.BaseServiceImpl; | |||
@@ -40,6 +38,7 @@ public class WestreamActServiceImpl extends BaseServiceImpl<WestreamActMapper, W | |||
IPage<WestreamAct> page = new Page<>(query.getPage(), query.getLimit()); | |||
IPage<WestreamAct> pageData = westreamActMapper.selectPage(page, new LambdaQueryWrapper<WestreamAct>() | |||
.eq(WestreamAct::getMark, 1) | |||
.eq(WestreamAct::getTenantId, query.getTenantId()) | |||
.eq(StringUtils.isNotEmpty(query.getProvinceCode()), WestreamAct::getProvinceCode, query.getProvinceCode()) | |||
.eq(StringUtils.isNotEmpty(query.getCityCode()), WestreamAct::getCityCode, query.getCityCode()) | |||
.eq(StringUtils.isNotEmpty(query.getDistrictCode()), WestreamAct::getDistrictCode, query.getDistrictCode()) |
@@ -38,6 +38,7 @@ public class WestreamKnowServiceImpl extends BaseServiceImpl<WestreamKnowMapper, | |||
IPage<WestreamKnow> page = new Page<>(query.getPage(), query.getLimit()); | |||
IPage<WestreamKnow> pageData = westreamKnowMapper.selectPage(page, new LambdaQueryWrapper<WestreamKnow>() | |||
.eq(WestreamKnow::getMark, 1) | |||
.eq(WestreamKnow::getTenantId, query.getTenantId()) | |||
.eq(StringUtils.isNotEmpty(query.getProvinceCode()), WestreamKnow::getProvinceCode, query.getProvinceCode()) | |||
.eq(StringUtils.isNotEmpty(query.getCityCode()), WestreamKnow::getCityCode, query.getCityCode()) | |||
.eq(StringUtils.isNotEmpty(query.getDistrictCode()), WestreamKnow::getDistrictCode, query.getDistrictCode()) |
@@ -49,6 +49,7 @@ public class WestreamSceneryServiceImpl extends BaseServiceImpl<WestreamSceneryM | |||
IPage<WestreamScenery> pageData = westreamSceneryMapper.selectPage(page, new LambdaQueryWrapper<WestreamScenery>() | |||
.eq(WestreamScenery::getMark, 1) | |||
.eq(WestreamScenery::getStatus,2) | |||
.eq(WestreamScenery::getTenantId, query.getTenantId()) | |||
.eq(StringUtils.isNotEmpty(query.getProvinceCode()), WestreamScenery::getProvinceCode, query.getProvinceCode()) | |||
.eq(StringUtils.isNotEmpty(query.getCityCode()), WestreamScenery::getCityCode, query.getCityCode()) | |||
.eq(StringUtils.isNotEmpty(query.getDistrictCode()), WestreamScenery::getDistrictCode, query.getDistrictCode()) |
@@ -1,17 +1,16 @@ | |||
package com.tuoheng.api.service.impl; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.tuoheng.api.entity.domain.WestreamScenery; | |||
import com.tuoheng.api.entity.domain.WestreamUser; | |||
import com.tuoheng.api.entity.request.OnlineNumQuery; | |||
import com.tuoheng.api.mapper.UserMemberMapper; | |||
import com.tuoheng.api.mapper.WestreamUserMapper; | |||
import com.tuoheng.api.service.IWestreamUserService; | |||
import com.tuoheng.common.common.BaseServiceImpl; | |||
import com.tuoheng.common.utils.JsonResult; | |||
import com.tuoheng.common.utils.StringUtils; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
/** | |||
* 全民护河用户表 服务实现类 | |||
* | |||
@@ -23,14 +22,21 @@ public class WestreamUserServiceImpl extends BaseServiceImpl<WestreamUserMapper, | |||
@Autowired | |||
private WestreamUserMapper westreamUserMapper; | |||
@Autowired | |||
private UserMemberMapper userMemberMapper; | |||
@Override | |||
public JsonResult onlineNum(OnlineNumQuery query) { | |||
Integer count = westreamUserMapper.selectCount(new LambdaQueryWrapper<WestreamUser>() | |||
.eq(StringUtils.isNotEmpty(query.getProvinceCode()), WestreamUser::getProvinceCode, query.getProvinceCode()) | |||
.eq(StringUtils.isNotEmpty(query.getCityCode()), WestreamUser::getCityCode, query.getCityCode()) | |||
.eq(StringUtils.isNotEmpty(query.getDistrictCode()), WestreamUser::getDistrictCode, query.getDistrictCode()) | |||
.eq(WestreamUser::getMark, 1) | |||
.eq(WestreamUser::getStatus, 1)); | |||
//查询某个租户下用户登录总次数 | |||
Integer count = userMemberMapper.selectOnlineNumSum(query); | |||
// Integer count = westreamUserMapper.selectCount(new LambdaQueryWrapper<WestreamUser>() | |||
// .eq(StringUtils.isNotEmpty(query.getProvinceCode()), WestreamUser::getProvinceCode, query.getProvinceCode()) | |||
// .eq(StringUtils.isNotEmpty(query.getCityCode()), WestreamUser::getCityCode, query.getCityCode()) | |||
// .eq(StringUtils.isNotEmpty(query.getDistrictCode()), WestreamUser::getDistrictCode, query.getDistrictCode()) | |||
// .eq(WestreamUser::getMark, 1) | |||
// .eq(WestreamUser::getStatus, 1)); | |||
return JsonResult.success(count); | |||
} | |||
} |
@@ -0,0 +1,13 @@ | |||
<?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="com.tuoheng.api.mapper.UserMemberMapper"> | |||
<select id="selectOnlineNumSum" resultType="java.lang.Integer"> | |||
SELECT SUM(login_num) | |||
FROM th_user_member | |||
WHERE tenant_id = #{query.tenantId} | |||
AND mark = 1 | |||
</select> | |||
</mapper> |