linhw 2024-05-30 17:24:18 +08:00
parent b44ace0a92
commit 8db1aa1b64
6 changed files with 62 additions and 0 deletions

View File

@ -62,6 +62,12 @@ public class AppUserController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
@GetMapping("/statistics")
@ApiOperation(value = "统计", notes = "统计", httpMethod = "GET")
public AjaxResult statistics() {
return appUserService.statistics();
}
// /** // /**
// * 导出app用户列表 // * 导出app用户列表
// */ // */

View File

@ -0,0 +1,23 @@
package com.ruoyi.app.domain;
import lombok.Data;
/**
* app app_user
* jobEndTime jobName jobType jobContent hobby city other
* @author wyh
* @date 2024-04-23
*/
@Data
public class StatisticsVo {
private Integer countDy;
private Integer countUser;
private Integer countDayUser;
private Integer countPrice;
private Integer countDayPrice;
}

View File

@ -5,6 +5,7 @@ import com.ruoyi.app.domain.AppUser;
import com.ruoyi.app.domain.vo.AppUserInfoVo; import com.ruoyi.app.domain.vo.AppUserInfoVo;
import com.ruoyi.app.domain.vo.AppUserNetVo; import com.ruoyi.app.domain.vo.AppUserNetVo;
import com.ruoyi.app.domain.vo.AppUserVo; import com.ruoyi.app.domain.vo.AppUserVo;
import com.ruoyi.common.core.web.domain.AjaxResult;
/** /**
* appService * appService
@ -22,6 +23,8 @@ public interface IAppUserService
*/ */
public AppUserVo selectAppUserById(Long id); public AppUserVo selectAppUserById(Long id);
AjaxResult statistics();
/** /**
* app * app
* *

View File

@ -14,6 +14,8 @@ import com.ruoyi.app.service.IAppProvinceService;
import com.ruoyi.app.service.IAppTownService; import com.ruoyi.app.service.IAppTownService;
import com.ruoyi.common.core.utils.DateUtils; import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.bean.BeanUtils; import com.ruoyi.common.core.utils.bean.BeanUtils;
import com.ruoyi.common.core.web.domain.AjaxResult;
import io.micrometer.core.instrument.Statistic;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -56,6 +58,32 @@ public class AppUserServiceImpl implements IAppUserService {
@Autowired @Autowired
private AppTownMapper appTownMapper; private AppTownMapper appTownMapper;
@Autowired
private AppUserDynamicMapper appUserDynamicMapper;
@Autowired
private AppOrderMapper appOrderMapper;
@Override
public AjaxResult statistics() {
StatisticsVo statisticsVo = new StatisticsVo();
List<AppUserDynamic> list = appUserDynamicMapper.selectAppUserDynamicList(new AppUserDynamic());
statisticsVo.setCountDy(list == null ? 0 : list.size());
List<AppUser> appUsers = appUserMapper.selectAppUserList(new AppUser());
statisticsVo.setCountUser(appUsers == null ? 0 : appUsers.size());
AppUser appUser = new AppUser();
appUser.setCreateTime(DateUtils.getNowDate());
appUsers = appUserMapper.selectAppUserList(appUser);
statisticsVo.setCountDayUser(appUsers == null ? 0 : appUsers.size());
AppOrder appOrder = new AppOrder();
appOrder.setPayStatus(2);
List<AppOrder> appOrders = appOrderMapper.selectAppOrderList(appOrder);
statisticsVo.setCountPrice(appOrders == null ? 0 : appOrders.size());
appOrder.setPayTime(DateUtils.getNowDate());
appOrders = appOrderMapper.selectAppOrderList(appOrder);
statisticsVo.setCountDayPrice(appOrders == null ? 0 : appOrders.size());
return AjaxResult.success(statisticsVo);
}
/** /**
* app * app

View File

@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="price != null "> and price = #{price}</if> <if test="price != null "> and price = #{price}</if>
<if test="mchId != null and mchId != ''"> and mch_id = #{mchId}</if> <if test="mchId != null and mchId != ''"> and mch_id = #{mchId}</if>
<if test="payTime != null "> and pay_time like concat (#{payTimeStr} , '%')</if> <if test="payTime != null "> and pay_time like concat (#{payTimeStr} , '%')</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
</where> </where>
order by create_time desc order by create_time desc
</select> </select>

View File

@ -131,6 +131,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="orderEndTime != null "> and order_end_time = #{orderEndTime}</if> <if test="orderEndTime != null "> and order_end_time = #{orderEndTime}</if>
<if test="check != null "> and `check` = #{check}</if> <if test="check != null "> and `check` = #{check}</if>
<if test="backGroundImg != null "> and back_ground_img = #{backGroundImg}</if> <if test="backGroundImg != null "> and back_ground_img = #{backGroundImg}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
</where> </where>
</select> </select>