Merge remote-tracking branch 'origin/huacheng_test' into huacheng_test
| | |
| | | wxUtil.sendGuideRepairOrderComplete(submitUser.getOpenid(),accessToken,guideRepairOrderCompleteTemplateId,order); |
| | | } |
| | | else if (order.getSubmitType().equals(2)){ |
| | | smsUtil.sendSmsComplete(order.getSubmitUserPhone(),order.getMatterName()); |
| | | smsUtil.sendSmsComplete(order.getConsultUserPhone(),order.getMatterName()); |
| | | } |
| | | //待评价 |
| | | order.setState("4"); |
| | |
| | | ResultData delete( @RequestParam(value = "id") Integer id){ |
| | | return iAutomessageCommonProblemService.delete(id); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取常见问题列表(分页) |
| | | * @param title |
| | | * @param content |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取常见问题列表(分页)(不加token)",response = AutomessageCommonProblem.class) |
| | | @GetMapping("/selectConfigListNoToken") |
| | | public TableDataInfo selectConfigListNoToken(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "title",required = false) String title, |
| | | @RequestParam(value = "content",required = false) String content){ |
| | | Page<AutomessageCommonProblem> pageParam = new Page<>(pageNum,pageSize); |
| | | List<AutomessageCommonProblem> list = iAutomessageCommonProblemService.selectConfigList(pageParam,pageSize,title,content); |
| | | int num=iAutomessageCommonProblemService.countAutomessageCommonProblem(title,content); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | | } |
| | |
| | | wxUtil.sendGuideRepairOrderComplete(submitUser.getOpenid(),accessToken,guideRepairOrderCompleteTemplateId,order); |
| | | } |
| | | else if (order.getSubmitType().equals(2)){ |
| | | smsUtil.sendSmsComplete(order.getSubmitUserPhone(),order.getMatterName()); |
| | | smsUtil.sendSmsComplete(order.getConsultUserPhone(),order.getMatterName()); |
| | | } |
| | | order.setState("4"); |
| | | entity.setState("9"); |
| | |
| | | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.*; |
| | | import com.dg.core.db.manual.pojo.AppletUserCount; |
| | | import com.dg.core.service.*; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | |
| | | @Autowired |
| | | IAreaCodeService iAreaCodeService; |
| | | |
| | | @Autowired |
| | | private ISysUserRecordService iSysUserRecordService; |
| | | |
| | | |
| | | @ApiOperation("首页统计不同状态工单数") |
| | | @GetMapping("/getWorkOrder") |
| | | public ResultData getWorkOrder() |
| | | public ResultData<WorkOrder> getWorkOrder() |
| | | { |
| | | WorkOrder workOrder=new WorkOrder(); |
| | | //状态(1待分配 2 待办结 3 已办结 4 待评价 5 已取消 6未解决 7已解决) |
| | |
| | | |
| | | @ApiOperation("首页统计不同时间段的工单数量") |
| | | @GetMapping("/getTimeWorkOrder") |
| | | public ResultData getTimeWorkOrder() |
| | | public ResultData<TimeWorkOrder> getTimeWorkOrder() |
| | | { |
| | | //1 今天 2昨天 3本月 4本年度 |
| | | //累计全部 本年 本月 今日 昨日 |
| | |
| | | |
| | | @ApiOperation("根据选择的时间段 筛选导办工单数 timeType:1 本年度 15 近15天的 30 近30天的") |
| | | @GetMapping("/getSelectionTimeOrder") |
| | | public ResultData getSelectionTimeOrder(@RequestParam("timeType") Integer timeType) |
| | | public ResultData<CountList> getSelectionTimeOrder(@RequestParam("timeType") Integer timeType) |
| | | { |
| | | if(timeType<1) |
| | | { |
| | |
| | | |
| | | @ApiOperation("获取效率比值") |
| | | @GetMapping("/getEfficiency") |
| | | public ResultData getEfficiency() |
| | | public ResultData<EfficiencyEntity> getEfficiency() |
| | | { |
| | | EfficiencyEntity entity=new EfficiencyEntity(); |
| | | //总工单数 |
| | |
| | | |
| | | @ApiOperation("工单 办事指南饼状图数据") |
| | | @GetMapping("/getPieChart") |
| | | public ResultData getPieChart() |
| | | public ResultData<PieChartAll> getPieChart() |
| | | { |
| | | PieChartAll pieChartAll=new PieChartAll(); |
| | | pieChartAll.setWorkOrderNum(iGuideRepairOrderService.countStatisticsNum("",null,null,null,null,null)+""); |
| | |
| | | |
| | | @ApiOperation("组织排行榜 type 1 安评价 2 按办结量") |
| | | @GetMapping("/getOrganization") |
| | | public TableDataInfo getOrganization(@RequestParam("type") String type) |
| | | public TableDataInfo<OrganizationEntity> getOrganization(@RequestParam("type") String type) |
| | | { |
| | | List<OrganizationEntity> guidePlates=homeStatisticsService.getDepartment(); |
| | | |
| | |
| | | |
| | | @ApiOperation("导办人员排行榜 type 1 安评价 2 按办结量 3 按超时") |
| | | @GetMapping("/getGuidePlate") |
| | | public TableDataInfo getGuidePlate(@RequestParam("type") String type) |
| | | public TableDataInfo<GuidePlate> getGuidePlate(@RequestParam("type") String type) |
| | | { |
| | | int allNum=homeStatisticsService.staffNum(); |
| | | |
| | |
| | | |
| | | @ApiOperation("办事指南排行榜 type 1 按浏览量 2 按办结量") |
| | | @GetMapping("/getGuidance") |
| | | public TableDataInfo getGuidance(@RequestParam("type") String type) |
| | | public TableDataInfo<Guidance> getGuidance(@RequestParam("type") String type) |
| | | { |
| | | int allNum=homeStatisticsService.countWork(); |
| | | if(StringUtils.equals("1",type)) |
| | |
| | | |
| | | @ApiOperation("导办工单按区域统计") |
| | | @GetMapping("/getRangeStatistics") |
| | | public TableDataInfo getRangeStatistics() |
| | | public TableDataInfo<RangeStatistics> getRangeStatistics() |
| | | { |
| | | List<AreaCode2022> code2022s=iAreaCodeService.getListByPCode("510400000000"); |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 小程序用户访问量统计1.累计访问量2.本年访问量 3.本月访问量 4.今日访问量 5.昨日访问 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "小程序用户访问量统计1.累计访问量2.本年访问量 3.本月访问量 4.今日访问量 5.昨日访问",response = AppletUserCount.class) |
| | | @GetMapping("/selectUserRecordCount") |
| | | public ResultData selectUserRecordCount(){ |
| | | return iSysUserRecordService.selectUserRecordCount(); |
| | | } |
| | | |
| | | /** |
| | | * 小程序用户访问量统计1.近15天 2.近30天 3.近一年 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "小程序用户访问量统计1.近15天 2.近30天 3.近一年",response = AppletUserCount.class) |
| | | @GetMapping("/selectByDateType") |
| | | public ResultData selectByDateType(@RequestParam("dateType") Integer dateType){ |
| | | return iSysUserRecordService.selectByDateType(dateType); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | /** |
| | | * 导办工单统计类 |
| | | */ |
| | | |
| | | @ApiModel("不同时间段的工单数量") |
| | | @Data |
| | | public class TimeWorkOrder implements Serializable |
| | |
| | | |
| | | import com.dg.core.db.gen.entity.AutomessageSysUserRecord; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dg.core.db.manual.pojo.AppletUserCount; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface AutomessageSysUserRecordMapper extends BaseMapper<AutomessageSysUserRecord> { |
| | | |
| | | /** |
| | | * 小程序用户访问量统计1.累计访问量2.本年访问量 3.本月访问量 4.今日访问量 5.昨日访问 |
| | | * @return |
| | | */ |
| | | List<AppletUserCount> selectUserRecordCount(); |
| | | |
| | | /** |
| | | * 小程序用户访问量统计近15天 |
| | | * @return |
| | | */ |
| | | List<AppletUserCount> selectByDay(); |
| | | |
| | | /** |
| | | * 小程序用户访问量统计近30天 |
| | | * @return |
| | | */ |
| | | List<AppletUserCount> selectByMonth(); |
| | | |
| | | /** |
| | | * 小程序用户访问量统计近一年 |
| | | * @return |
| | | */ |
| | | List<AppletUserCount> selectByYear(); |
| | | |
| | | } |
New file |
| | |
| | | package com.dg.core.db.manual.pojo; |
| | | |
| | | import com.dg.core.annotation.Authorization; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @ApiModel("小程序用户统计结果") |
| | | @Data |
| | | public class AppletUserCount { |
| | | |
| | | @ApiModelProperty("日期,可以是月也可以是日") |
| | | private String date; |
| | | |
| | | @ApiModelProperty("访问量") |
| | | private Long visits; |
| | | |
| | | @ApiModelProperty("类型1.累计访问量2.本年访问量 3.本月访问量 4.今日访问量 5.昨日访问量") |
| | | private Integer type; |
| | | } |
| | |
| | | if(huaChengSysUser!=null && huaChengSysUser.getUserId()!=0 ) |
| | | { |
| | | SysUser sysUser = IUserService.selectData(null,huaChengSysUser.getPhone()); |
| | | if(sysUser==null && sysUser.getUserId()<0) |
| | | if(sysUser==null) |
| | | { |
| | | //本地没有此用户 新用户 |
| | | SysUser newSysUser=new SysUser(); |
| | |
| | | |
| | | import com.dg.core.Constant; |
| | | import com.dg.core.annotation.CurrentUser; |
| | | import com.dg.core.db.gen.entity.HuaChengSysUser; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.IHuaChengSysUserService; |
| | | import com.dg.core.service.ISysUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.core.MethodParameter; |
| | |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | /** |
| | | * 花城e+用户接口 |
| | | */ |
| | | @Autowired |
| | | IHuaChengSysUserService iHuaChengSysUserService; |
| | | |
| | | @Override |
| | | public boolean supportsParameter(MethodParameter parameter) { |
| | | //如果参数类型是User并且有CurrentUser注解则支持 |
| | |
| | | Long currentUserId = (Long) webRequest.getAttribute(Constant.CURRENT_USER_ID, RequestAttributes.SCOPE_REQUEST); |
| | | if (currentUserId != null) { |
| | | //从数据库中查询并返回 |
| | | return userService.selectData(currentUserId+"",null); |
| | | SysUser sysUser=userService.selectData(currentUserId+"",null); |
| | | if(sysUser!=null) |
| | | { |
| | | return sysUser; |
| | | } |
| | | |
| | | HuaChengSysUser huaChengSysUser=iHuaChengSysUserService.selectData(currentUserId+"","",""); |
| | | if(huaChengSysUser!=null) |
| | | { |
| | | sysUser=userService.selectData(null,huaChengSysUser.getPhone()); |
| | | if(sysUser!=null) |
| | | { |
| | | return sysUser; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | // throw new MissingServletRequestPartException(Constant.CURRENT_USER_ID); |
| | |
| | | */ |
| | | int countStatisticsNum(String state,List<String> ids,String time,String isTimeout,String evaluateState,List<String> classifyIds); |
| | | |
| | | |
| | | /** |
| | | * 统计数据 |
| | | * @param state |
| | | * @param ids |
| | | * @param time |
| | | * @return |
| | | */ |
| | | List<CountListNum> countListNum(String state, |
| | | List<String> ids, |
| | | Integer time); |
| | |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | |
| | | |
| | | public interface ISysUserRecordService { |
| | | |
| | | /** |
| | |
| | | * @return 参数配置信息 |
| | | */ |
| | | ResultData add(SysUser sysUser); |
| | | |
| | | |
| | | /** |
| | | * 小程序用户访问量统计1.累计访问量2.本年访问量 3.本月访问量 4.今日访问量 5.昨日访问 |
| | | * @return |
| | | */ |
| | | ResultData selectUserRecordCount(); |
| | | |
| | | /** |
| | | * 小程序用户访问量统计1.近15天 2.近30天 3.近一年 |
| | | * @return |
| | | */ |
| | | ResultData selectByDateType(Integer dateType); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.db.gen.entity.AutomessageSysUserRecord; |
| | | import com.dg.core.db.gen.entity.AutomessageTransactionEventInterview; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.db.gen.mapper.AutomessageSysUserRecordMapper; |
| | | import com.dg.core.db.gen.mapper.SysUserMapper; |
| | |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public ResultData selectUserRecordCount() { |
| | | return ResultData.success(baseMapper.selectUserRecordCount()); |
| | | } |
| | | |
| | | @Override |
| | | public ResultData selectByDateType(Integer dateType) { |
| | | if (dateType.equals(1)) |
| | | return ResultData.success(baseMapper.selectByDay()); |
| | | if (dateType.equals(2)) |
| | | return ResultData.success(baseMapper.selectByMonth()); |
| | | if (dateType.equals(3)) |
| | | return ResultData.success(baseMapper.selectByYear()); |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dg.core.util; |
| | | |
| | | import com.dg.core.ResultData; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class TableDataInfo implements Serializable |
| | | public class TableDataInfo<T> implements Serializable |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | private long total; |
| | | |
| | | /** 列表数据 */ |
| | | private List<?> rows; |
| | | private List<T> rows; |
| | | |
| | | /** 消息状态码 */ |
| | | private int result; |
| | |
| | | * @param list 列表数据 |
| | | * @param total 总记录数 |
| | | */ |
| | | public TableDataInfo(List<?> list, long total) |
| | | public TableDataInfo(List<T> list, long total) |
| | | { |
| | | this.rows = list; |
| | | this.total = total; |
| | |
| | | this.total = total; |
| | | } |
| | | |
| | | public List<?> getRows() |
| | | public List<T> getRows() |
| | | { |
| | | return rows; |
| | | } |
| | | |
| | | public void setRows(List<?> rows) |
| | | public void setRows(List<T> rows) |
| | | { |
| | | this.rows = rows; |
| | | } |
| | |
| | | <?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.dg.core.db.gen.mapper.AutomessageSysUserRecordMapper"> |
| | | <resultMap type="com.dg.core.db.gen.entity.AutomessageSysUserRecord" id="AutomessageSysUserRecordResult"> |
| | | <id property="id" column="id" /> |
| | | <id property="userId" column="user_id" /> |
| | | <id property="createTime" column="create_time" /> |
| | | <id property="joinType" column="join_type" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectAgreement"> |
| | | select id,user_id, |
| | | (select user_name from automessage_sys_user where user_id=a.user_id)userName, |
| | | create_time,join_type FROM automessage_sys_user_record a |
| | | </sql> |
| | | <!-- 小程序用户访问量统计1.累计访问量2.本年访问量 3.本月访问量 4.今日访问量 5.昨日访问--> |
| | | <select id="selectUserRecordCount" resultType="com.dg.core.db.manual.pojo.AppletUserCount"> |
| | | select count(*)visits,1 type from automessage_sys_user_record UNION |
| | | select count(*)visits,2 type from automessage_sys_user_record where year(create_time)=year(SYSDATE()) UNION |
| | | select count(*)visits,3 type from automessage_sys_user_record where DATE_FORMAT(create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) ,'%Y%m' ) UNION |
| | | select count(*)visits,4 type from automessage_sys_user_record where to_days(create_time) = to_days(now()) UNION |
| | | select count(*)visits,5 type from automessage_sys_user_record where TO_DAYS( SYSDATE() ) - TO_DAYS(create_time) = 1 |
| | | </select> |
| | | |
| | | <select id="selectByDay" resultType="com.dg.core.db.manual.pojo.AppletUserCount"> |
| | | select d.date, IFNULL(T.score,0) visits from |
| | | ( |
| | | SELECT CURDATE() AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 1 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 2 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 3 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 4 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 5 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 6 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 7 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 8 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 9 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 10 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 11 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 12 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 13 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 14 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 15 DAY) AS date |
| | | ) d |
| | | left join( |
| | | select DATE_FORMAT(create_time,'%Y-%m-%d')create_time, COUNT(*) as score |
| | | from automessage_sys_user_record |
| | | group by DATE_FORMAT(create_time,'%Y-%m-%d') |
| | | ) T on T.create_time = d.date |
| | | GROUP BY d.date |
| | | </select> |
| | | |
| | | <select id="selectByMonth" resultType="com.dg.core.db.manual.pojo.AppletUserCount"> |
| | | select d.date, IFNULL(T.score,0) visits from |
| | | ( |
| | | SELECT CURDATE() AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 1 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 2 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 3 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 4 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 5 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 6 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 7 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 8 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 9 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 10 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 11 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 12 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 13 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 14 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 15 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 16 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 17 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 18 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 19 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 20 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 21 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 22 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 23 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 24 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 25 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 26 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 27 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 28 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 29 DAY) AS date |
| | | UNION ALL |
| | | SELECT DATE_SUB(CURDATE(), INTERVAL 30 DAY) AS date |
| | | ) d |
| | | left join( |
| | | select DATE_FORMAT(create_time,'%Y-%m-%d')create_time, COUNT(*) as score |
| | | from automessage_sys_user_record |
| | | group by DATE_FORMAT(create_time,'%Y-%m-%d') |
| | | ) T on T.create_time = d.date |
| | | GROUP BY d.date |
| | | </select> |
| | | |
| | | <select id="selectByYear" resultType="com.dg.core.db.manual.pojo.AppletUserCount"> |
| | | select d.date, IFNULL(T.score,0) visits from |
| | | ( |
| | | SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 11 month),"%Y-%m") date UNION |
| | | SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 10 month),"%Y-%m") date UNION |
| | | SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 9 month),"%Y-%m") date UNION |
| | | SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 8 month),"%Y-%m") date UNION |
| | | SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 7 month),"%Y-%m") date UNION |
| | | SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 6 month),"%Y-%m") date UNION |
| | | SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 5 month),"%Y-%m") date UNION |
| | | SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 4 month),"%Y-%m") date UNION |
| | | SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 3 month),"%Y-%m") date UNION |
| | | SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 2 month),"%Y-%m") date UNION |
| | | SELECT DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 month),"%Y-%m") date UNION |
| | | select DATE_FORMAT(NOW(),"%Y-%m") FROM DUAL |
| | | ) d |
| | | left join( |
| | | select DATE_FORMAT(create_time,'%Y-%m')create_time, COUNT(*) as score |
| | | from automessage_sys_user_record |
| | | group by DATE_FORMAT(create_time,'%Y-%m') |
| | | ) T on T.create_time = d.date |
| | | GROUP BY d.date |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | |
| | | <insert id="insertConfig" parameterType="com.dg.core.db.gen.entity.SysUser"> |
| | | insert into automessage_sys_user ( |
| | | insert ignore into automessage_sys_user ( |
| | | create_time |
| | | <if test="userId != null and userId != '' ">,user_id</if> |
| | | <if test="loginName != null and loginName != '' ">,login_name</if> |
| | |
| | | import com.panzhihua.common.model.vos.user.*; |
| | | import com.panzhihua.service_user.model.dos.SysUserDO; |
| | | import com.panzhihua.service_user.model.dtos.DataKanbanDTO; |
| | | import com.panzhihua.service_user.model.dtos.UsersStatisticsDTO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | |
| | | * */ |
| | | Map<String,Long> getDailyAddAndActive(@Param("date") Date date, @Param("id") Long streetId, @Param("areaCode") Long areaCode, @Param("appId") String appId); |
| | | |
| | | Map<String, Long> getDailyAdd(@Param("createAt") String createAt, @Param("id") Long streetId, @Param("areaCode") Long areaCode, @Param("appId") String appId); |
| | | List<UsersStatisticsDTO> getDailyAdd(@Param("createAt") String createAt, @Param("id") Long streetId, @Param("areaCode") Long areaCode, @Param("appId") String appId); |
| | | |
| | | Map<String, Long> getActive(@Param("lastLoginTime") String lastLoginTime, @Param("id") Long streetId, @Param("areaCode") Long areaCode, @Param("appId") String appId); |
| | | List<UsersStatisticsDTO> getActive(@Param("lastLoginTime") String lastLoginTime, @Param("id") Long streetId, @Param("areaCode") Long areaCode, @Param("appId") String appId); |
| | | |
| | | |
| | | List<StreetVOS> selectStreetByAreaCode(Integer code); |
New file |
| | |
| | | package com.panzhihua.service_user.model.dtos; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @ClassName: UsersStatisticsDTO |
| | | * @Author: yh |
| | | * @Date: 2022/10/17 10:26 |
| | | * @Description: 对登录人数和新增人数进行统计 |
| | | * com.panzhihua.service_user.model.dtos.UsersStatisticsDTO |
| | | */ |
| | | @Data |
| | | public class UsersStatisticsDTO { |
| | | |
| | | |
| | | /** |
| | | * 年月日 |
| | | */ |
| | | private String specificDate; |
| | | |
| | | /** |
| | | * 总数 |
| | | */ |
| | | private String total; |
| | | } |
| | |
| | | import com.panzhihua.service_user.model.dos.SysUserNoticeDO; |
| | | import com.panzhihua.service_user.model.dos.SysUserRoleDO; |
| | | import com.panzhihua.service_user.model.dtos.DataKanbanDTO; |
| | | import com.panzhihua.service_user.model.dtos.UsersStatisticsDTO; |
| | | import com.panzhihua.service_user.service.EventGridMemberBuildingRelationService; |
| | | import com.panzhihua.service_user.service.UserService; |
| | | |
| | |
| | | LambdaQueryWrapper<SysUserDO> queryWrapper = new LambdaQueryWrapper<>(); |
| | | List<ActivityManagerVO> activityManagerVOS = new ArrayList<>(); |
| | | queryWrapper = new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getCommunityId, communityId) |
| | | .eq(SysUserDO::getStatus, 1).eq(SysUserDO::getType, 3); |
| | | .eq(SysUserDO::getStatus, 1).eq(SysUserDO::getType, 3); |
| | | if (!ObjectUtils.isEmpty(param)) { |
| | | queryWrapper = queryWrapper.eq(SysUserDO::getName, param); |
| | | } |
| | |
| | | activeDate = getMonthTwentyDays(); |
| | | } |
| | | } |
| | | |
| | | //获取最近活跃人数 |
| | | Map<String, Long> active = userDao.getActive(activeX, streetId, areaCode, appId); |
| | | List<UsersStatisticsDTO> actives = userDao.getActive(activeX, streetId, areaCode, appId); |
| | | //获取最近注册人数 |
| | | Map<String, Long> dailyAdd = userDao.getDailyAdd(activeX, streetId, areaCode, appId); |
| | | List<UsersStatisticsDTO> dailyAdds = userDao.getDailyAdd(activeX, streetId, areaCode, appId); |
| | | Map<String, String> activeMap = actives.stream().collect(Collectors.toMap(UsersStatisticsDTO::getSpecificDate, UsersStatisticsDTO::getTotal)); |
| | | Map<String, String> dailyAddMap = dailyAdds.stream().collect(Collectors.toMap(UsersStatisticsDTO::getSpecificDate, UsersStatisticsDTO::getTotal)); |
| | | |
| | | |
| | | for (Date date : activeDate) { |
| | | String dateStr = DateUtil.format(date, "yyyy-MM-dd"); |
| | | activeY.add(active.containsKey(dateStr) ? active.get("activeUser").toString() : "0"); |
| | | adY.add(dailyAdd.containsKey(dateStr) ? dailyAdd.get("addUser").toString() : "0"); |
| | | activeY.add(activeMap.containsKey(dateStr) ? activeMap.get(dateStr) : "0"); |
| | | adY.add(dailyAddMap.containsKey(dateStr) ? dailyAddMap.get(dateStr) : "0"); |
| | | |
| | | } |
| | | vo.setUserX(getMAndD(activeDate)); |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getDailyAdd" resultType="java.util.Map"> |
| | | SELECT DATE_FORMAT( su.create_at, '%Y-%m-%d' ) as createAt ,count(su.user_id) as addUser FROM |
| | | <select id="getDailyAdd" resultType="com.panzhihua.service_user.model.dtos.UsersStatisticsDTO"> |
| | | SELECT DATE_FORMAT( su.create_at, '%Y-%m-%d' ) as specificDate ,count(su.user_id) as total FROM |
| | | sys_user AS su |
| | | LEFT JOIN com_act AS ac ON su.community_id = ac.community_id |
| | | LEFT JOIN com_street AS cs ON ac.street_id = cs.street_id |
| | |
| | | <if test="areaCode != null"> |
| | | and cs.area_code=#{areaCode} |
| | | </if> |
| | | AND su.create_at > #{createAt} GROUP BY createAt |
| | | AND su.create_at > #{createAt} GROUP BY specificDate |
| | | </select> |
| | | <select id="getActive" resultType="java.util.Map"> |
| | | SELECT DATE_FORMAT( su.last_login_time, '%Y-%m-%d' ) as createAt ,count(su.user_id) as activeUser FROM |
| | | <select id="getActive" resultType="com.panzhihua.service_user.model.dtos.UsersStatisticsDTO"> |
| | | SELECT DATE_FORMAT( su.last_login_time, '%Y-%m-%d' ) as specificDate ,count(su.user_id) as total FROM |
| | | sys_user AS su |
| | | LEFT JOIN com_act AS ac ON su.community_id = ac.community_id |
| | | LEFT JOIN com_street AS cs ON ac.street_id = cs.street_id |
| | |
| | | <if test="areaCode != null"> |
| | | and cs.area_code=#{areaCode} |
| | | </if> |
| | | AND su.last_login_time > #{lastLoginTime} GROUP BY createAt |
| | | AND su.last_login_time > #{lastLoginTime} GROUP BY specificDate |
| | | </select> |
| | | |
| | | <select id="selectStreetByAreaCode" resultType="com.panzhihua.common.model.vos.user.StreetVOS"> |