|
|
@@ -38,16 +38,13 @@ import com.zhongzheng.modules.goods.vo.GoodsUserVo;
|
|
|
import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
|
|
|
import com.zhongzheng.modules.grade.service.IClassGradeUserService;
|
|
|
import com.zhongzheng.modules.grade.vo.ClassGradeUserGoodsVo;
|
|
|
+import com.zhongzheng.modules.inform.domain.InformSysUser;
|
|
|
import com.zhongzheng.modules.order.domain.OrderBillGoods;
|
|
|
import com.zhongzheng.modules.user.bo.*;
|
|
|
-import com.zhongzheng.modules.user.domain.User;
|
|
|
-import com.zhongzheng.modules.user.domain.UserBankRecord;
|
|
|
-import com.zhongzheng.modules.user.domain.UserSchoolInfo;
|
|
|
+import com.zhongzheng.modules.user.domain.*;
|
|
|
import com.zhongzheng.modules.user.entity.ClientLoginUser;
|
|
|
import com.zhongzheng.modules.user.mapper.UserMapper;
|
|
|
-import com.zhongzheng.modules.user.service.IUserPlanService;
|
|
|
-import com.zhongzheng.modules.user.service.IUserService;
|
|
|
-import com.zhongzheng.modules.user.service.IUserUpdateService;
|
|
|
+import com.zhongzheng.modules.user.service.*;
|
|
|
import com.zhongzheng.modules.user.vo.*;
|
|
|
import io.swagger.models.auth.In;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -114,6 +111,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
@Autowired
|
|
|
private TokenService tokenService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IUserVisitLogService iUserVisitLogService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IUserStudyLogService iUserStudyLogService;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public UserVo queryById(Long userId) {
|
|
|
@@ -188,6 +191,94 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<UserStatstVo> statsList(UserQueryBo bo) {
|
|
|
+ List<UserStatstVo> list = new ArrayList<>();
|
|
|
+ if(Validator.isNotEmpty(bo.getStatsStartTime())&&Validator.isNotEmpty(bo.getStatsEndTime())){
|
|
|
+ Long time = bo.getStatsStartTime();
|
|
|
+ Long endTime = bo.getStatsEndTime()+24*3600;
|
|
|
+ Integer peopleNum = count(new LambdaQueryWrapper<User>()
|
|
|
+ .eq(User::getStatus,1));
|
|
|
+ while (time<endTime){
|
|
|
+ Long time1 = time;
|
|
|
+ Long time2 = time + 24*3600 -1;
|
|
|
+ UserStatstVo statstVo = new UserStatstVo();
|
|
|
+ statstVo.setDate(DateUtils.timestampToDate(time));
|
|
|
+ statstVo.setAllNum(peopleNum);
|
|
|
+ statstVo.setAddNum(count(new LambdaQueryWrapper<User>()
|
|
|
+ .eq(User::getStatus,1).between(User::getCreateTime,time1,time2)));
|
|
|
+ statstVo.setVisitAllNum(iUserVisitLogService.count(new LambdaQueryWrapper<UserVisitLog>().between(UserVisitLog::getCreateTime,time1,time2)));
|
|
|
+ statstVo.setVisitSmallNum(iUserVisitLogService.count(new LambdaQueryWrapper<UserVisitLog>()
|
|
|
+ .eq(UserVisitLog::getFromPlat,1).between(UserVisitLog::getCreateTime,time1,time2)));
|
|
|
+ statstVo.setVisitPcNum(iUserVisitLogService.count(new LambdaQueryWrapper<UserVisitLog>()
|
|
|
+ .eq(UserVisitLog::getFromPlat,2).between(UserVisitLog::getCreateTime,time1,time2)));
|
|
|
+ statstVo.setStudyAllNum(iUserStudyLogService.count(new LambdaQueryWrapper<UserStudyLog>().between(UserStudyLog::getCreateTime,time1,time2)));
|
|
|
+ statstVo.setStudySmallNum(iUserStudyLogService.count(new LambdaQueryWrapper<UserStudyLog>()
|
|
|
+ .eq(UserStudyLog::getFromPlat,1).between(UserStudyLog::getCreateTime,time1,time2)));
|
|
|
+ statstVo.setStudyPcNum(iUserStudyLogService.count(new LambdaQueryWrapper<UserStudyLog>()
|
|
|
+ .eq(UserStudyLog::getFromPlat,2).between(UserStudyLog::getCreateTime,time1,time2)));
|
|
|
+ list.add(statstVo);
|
|
|
+ time+=24*3600;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<UserExportVo> selectListExport(UserQueryBo bo) {
|
|
|
+ bo.setGetOrderNum(1L);
|
|
|
+ List<UserVo> list = entity2UserVo(userMapper.selectList(bo));
|
|
|
+ List<UserExportVo> listExport = new ArrayList<>();
|
|
|
+ for (UserVo userVo : list) {
|
|
|
+ userVo.setStudentCode(userVo.getUserAccount());
|
|
|
+ ClassGradeUserQueryBo classGradeUserQueryBo = new ClassGradeUserQueryBo();
|
|
|
+ classGradeUserQueryBo.setUserId(userVo.getUserId());
|
|
|
+ List<Integer> status = new ArrayList<>();
|
|
|
+ status.add(1);
|
|
|
+ classGradeUserQueryBo.setStatus(status);
|
|
|
+ List<ClassGradeUserGoodsVo> classGradeUserGoodsVos = iClassGradeUserService.listUser(classGradeUserQueryBo);
|
|
|
+ userVo.setClassGradeUserGoodsVoList(classGradeUserGoodsVos);
|
|
|
+ userVo.setOrderNum(userVo.getGoodsCourseNum());
|
|
|
+ UserExportVo add = BeanUtil.toBean(userVo, UserExportVo.class);
|
|
|
+ if(Validator.isNotEmpty(userVo.getStudyFromPlat())&&userVo.getStudyFromPlat()==1){
|
|
|
+ add.setStudyFromPlat("小程序");
|
|
|
+ }
|
|
|
+ if(Validator.isNotEmpty(userVo.getStudyFromPlat())&&userVo.getStudyFromPlat()==2){
|
|
|
+ add.setStudyFromPlat("PC");
|
|
|
+ }
|
|
|
+ if(Validator.isNotEmpty(userVo.getVisitFromPlat())&&userVo.getVisitFromPlat()==1){
|
|
|
+ add.setStudyFromPlat("小程序");
|
|
|
+ }
|
|
|
+ if(Validator.isNotEmpty(userVo.getVisitFromPlat())&&userVo.getVisitFromPlat()==2){
|
|
|
+ add.setStudyFromPlat("PC");
|
|
|
+ }
|
|
|
+ add.setLastStudyTime(DateUtils.timestampToDate(userVo.getLastStudyTime()));
|
|
|
+ add.setLastVisitTime(DateUtils.timestampToDate(userVo.getLastVisitTime()));
|
|
|
+ if(Validator.isNotEmpty(userVo.getSex())&&userVo.getSex()==1){
|
|
|
+ add.setSex("男");
|
|
|
+ }
|
|
|
+ if(Validator.isNotEmpty(userVo.getSex())&&userVo.getSex()==2){
|
|
|
+ add.setSex("女");
|
|
|
+ }
|
|
|
+ if(Validator.isNotEmpty(userVo.getUserBindWx())&&userVo.getUserBindWx()==0){
|
|
|
+ add.setUserBindWx("否");
|
|
|
+ }
|
|
|
+ if(Validator.isNotEmpty(userVo.getUserBindWx())&&userVo.getUserBindWx()==1){
|
|
|
+ add.setUserBindWx("是");
|
|
|
+ }
|
|
|
+ if(Validator.isNotEmpty(userVo.getUserFollowWx())&&userVo.getUserFollowWx()==0){
|
|
|
+ add.setUserFollowWx("否");
|
|
|
+ }
|
|
|
+ if(Validator.isNotEmpty(userVo.getUserFollowWx())&&userVo.getUserFollowWx()==1){
|
|
|
+ add.setUserFollowWx("是");
|
|
|
+ }
|
|
|
+ add.setGradeNum(classGradeUserGoodsVos.size());
|
|
|
+ listExport.add(add);
|
|
|
+ }
|
|
|
+ return listExport;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<UserStudyRecordVo> selectStudyRecordList(UserStudyRecordQueryBo bo) {
|
|
|
return userMapper.selectStudyRecordList(bo);
|