Selaa lähdekoodia

部分接口改造-SaaS化改造;在线人数改为历史在线人次

tags/V1.7.0
wanghaoran 1 vuosi sitten
vanhempi
commit
d79a119e6b
15 muutettua tiedostoa jossa 130 lisäystä ja 18 poistoa
  1. +6
    -6
      tuoheng-api/src/main/java/com/tuoheng/api/controller/IndexController.java
  2. +0
    -1
      tuoheng-api/src/main/java/com/tuoheng/api/controller/WestreamSceneryController.java
  3. +50
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/entity/domain/UserMember.java
  4. +5
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/entity/request/OnlineNumQuery.java
  5. +5
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/entity/request/StreamQuery.java
  6. +5
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/entity/request/WestreamActQuery.java
  7. +5
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/entity/request/WestreamKnowQuery.java
  8. +5
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/entity/request/WestreamSceneryQuery.java
  9. +16
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/mapper/UserMemberMapper.java
  10. +2
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/StreamServiceImpl.java
  11. +1
    -2
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/WestreamActServiceImpl.java
  12. +1
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/WestreamKnowServiceImpl.java
  13. +1
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/WestreamSceneryServiceImpl.java
  14. +15
    -9
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/WestreamUserServiceImpl.java
  15. +13
    -0
      tuoheng-api/src/main/resources/mapper/UserMemberMapper.xml

+ 6
- 6
tuoheng-api/src/main/java/com/tuoheng/api/controller/IndexController.java Näytä tiedosto

@@ -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);
// }

}

+ 0
- 1
tuoheng-api/src/main/java/com/tuoheng/api/controller/WestreamSceneryController.java Näytä tiedosto

@@ -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;

+ 50
- 0
tuoheng-api/src/main/java/com/tuoheng/api/entity/domain/UserMember.java Näytä tiedosto

@@ -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;

}

+ 5
- 0
tuoheng-api/src/main/java/com/tuoheng/api/entity/request/OnlineNumQuery.java Näytä tiedosto

@@ -20,4 +20,9 @@ public class OnlineNumQuery {
*/
private String districtCode;

/**
* 租户ID
*/
private Integer tenantId;

}

+ 5
- 0
tuoheng-api/src/main/java/com/tuoheng/api/entity/request/StreamQuery.java Näytä tiedosto

@@ -47,4 +47,9 @@ public class StreamQuery extends BaseQuery {
*/
private String villageCode;

/**
* 租户ID
*/
private Integer tenantId;

}

+ 5
- 0
tuoheng-api/src/main/java/com/tuoheng/api/entity/request/WestreamActQuery.java Näytä tiedosto

@@ -26,4 +26,9 @@ public class WestreamActQuery extends BaseQuery {
* 区县编码
*/
private String districtCode;

/**
* 租户ID
*/
private Integer tenantId;
}

+ 5
- 0
tuoheng-api/src/main/java/com/tuoheng/api/entity/request/WestreamKnowQuery.java Näytä tiedosto

@@ -27,4 +27,9 @@ public class WestreamKnowQuery extends BaseQuery {
*/
private String districtCode;

/**
* 租户ID
*/
private Integer tenantId;

}

+ 5
- 0
tuoheng-api/src/main/java/com/tuoheng/api/entity/request/WestreamSceneryQuery.java Näytä tiedosto

@@ -32,4 +32,9 @@ public class WestreamSceneryQuery extends BaseQuery {
*/
private String openid;

/**
* 租户ID
*/
private Integer tenantId;

}

+ 16
- 0
tuoheng-api/src/main/java/com/tuoheng/api/mapper/UserMemberMapper.java Näytä tiedosto

@@ -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);
}

+ 2
- 0
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/StreamServiceImpl.java Näytä tiedosto

@@ -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())

+ 1
- 2
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/WestreamActServiceImpl.java Näytä tiedosto

@@ -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())

+ 1
- 0
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/WestreamKnowServiceImpl.java Näytä tiedosto

@@ -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())

+ 1
- 0
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/WestreamSceneryServiceImpl.java Näytä tiedosto

@@ -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())

+ 15
- 9
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/WestreamUserServiceImpl.java Näytä tiedosto

@@ -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);
}
}

+ 13
- 0
tuoheng-api/src/main/resources/mapper/UserMemberMapper.xml Näytä tiedosto

@@ -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>

Loading…
Peruuta
Tallenna