xinquan-api/xinquan-api-system/src/main/java/com/xinquan/system/api/domain/MeditationReport.java
@@ -42,6 +42,9 @@ @ApiModelProperty(value = "uid") @TableField(exist = false) private String uid; @ApiModelProperty(value = "点赞数") @TableField(exist = false) private Integer likeCount; @ApiModelProperty(value = "用户名称") @TableField(exist = false) private String userName; xinquan-api/xinquan-api-system/src/main/java/com/xinquan/system/api/domain/PrizeRedemptionRecord.java
@@ -66,6 +66,9 @@ @ApiModelProperty(value = "兑换码") @TableField("code") private String code; @ApiModelProperty(value = "处理人") @TableField("handleName") private String handleName; @ApiModelProperty(value = "扣除能量值") @TableField("energy_value") private Integer energyValue; xinquan-auth/src/main/java/com/xinquan/auth/service/SysLoginService.java
@@ -114,6 +114,9 @@ LoginUser userInfo = userResult.getData(); SysUser user = userResult.getData().getSysUser(); if (user.getStatus().equals("1")){ throw new ServiceException("对不起,您的账号:" + username + " 已被冻结,请联系管理员"); } if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) { recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "对不起,您的账号已被删除"); xinquan-modules/xinquan-course/src/main/java/com/xinquan/course/controller/client/ClientCourseCategoryController.java
@@ -7,9 +7,11 @@ import com.xinquan.common.core.utils.page.CollUtils; import com.xinquan.common.core.utils.page.PageDTO; import com.xinquan.common.security.utils.SecurityUtils; import com.xinquan.course.api.domain.Course; import com.xinquan.course.api.domain.CourseCategory; import com.xinquan.course.service.CourseCategoryService; import com.xinquan.course.service.CourseCategoryService; import com.xinquan.course.service.CourseService; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; @@ -18,6 +20,7 @@ import java.time.LocalDateTime; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; /** @@ -33,6 +36,8 @@ public class ClientCourseCategoryController { @Autowired private CourseCategoryService courseCategoryService; @Autowired private CourseService courseService; @PostMapping("/courseCategoryManagementList") @ApiOperation(value = "分类列表-分页", tags = {"管理后台-分类管理"}) @ApiImplicitParams({ @@ -94,6 +99,15 @@ @PostMapping("/deleteCourseCategory") @ApiOperation(value = "批量删除", tags = "管理后台-分类管理") public R deleteCourseCategory(String ids) { // 全部修改为Long类型 List<Long> collect = Arrays.stream(ids.split(",")).map(Long::valueOf).collect(Collectors.toList()); for (Long l : collect) { List<Course> list = courseService.lambdaQuery().eq(Course::getCateId, l).list(); if (!list.isEmpty()){ CourseCategory byId = courseCategoryService.getById(l); return R.fail("分类名称:"+byId.getName()+"下存在关联课程,不可删除"); } } return R.ok(courseCategoryService.removeBatchByIds(Arrays.asList(ids.split(",")).stream().map(Long::valueOf).collect(Collectors.toList()))); } } xinquan-modules/xinquan-course/src/main/java/com/xinquan/course/controller/client/ClientCourseController.java
@@ -313,7 +313,7 @@ .eq(Objects.nonNull(courseDTO.getCourseType()), Course::getCourseType, courseDTO.getCourseType()) .eq(Objects.nonNull(courseDTO.getChargeType()), Course::getChargeType, courseDTO.getChargeType()) .eq(Objects.nonNull(courseDTO.getListingStatus()), Course::getListingStatus, courseDTO.getListingStatus()) .orderByDesc(Course::getSortNum); .orderByDesc(Course::getCreateTime); if (org.springframework.util.StringUtils.hasLength(courseDTO.getCourseTitle())){ List<Long> collect = courseService.lambdaQuery().like(Course::getCourseTitle, courseDTO.getCourseTitle()).list() .stream().map(Course::getId).collect(Collectors.toList()); xinquan-modules/xinquan-meditation/src/main/java/com/xinquan/meditation/controller/client/ClientMeditationReportController.java
@@ -89,6 +89,7 @@ record.setUid(record.getId()+""); MeditationQuestion byId1 = meditationQuestionService.getById(record.getQuestionId()); if (byId1!=null){ record.setLikeCount(byId1.getLikeCount()); record.setContent(byId1.getContent()); LocalDateTime replyTime = byId1.getCreateTime(); record.setContentTime(replyTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); xinquan-modules/xinquan-order/src/main/java/com/xinquan/order/controller/management/MgtOrderController.java
@@ -172,8 +172,8 @@ String endTime = null; if (org.springframework.util.StringUtils.hasLength(courseDTO.getTime())){ String[] split = courseDTO.getTime().split(" - "); startTime = split[0]+"00:00:00"; endTime = split[1]+"23:59:59"; startTime = split[0]+" 00:00:00"; endTime = split[1]+" 23:59:59"; } List<Integer> payType1 = new ArrayList<>(); payType1.add(1); @@ -185,10 +185,10 @@ payType3.add(3); payType3.add(7); List<Integer> payType4 = new ArrayList<>(); payType3.add(4); payType3.add(5); payType3.add(6); payType3.add(7); payType4.add(4); payType4.add(5); payType4.add(6); payType4.add(7); LambdaQueryWrapper<Order> courseLambdaQueryWrapper = new LambdaQueryWrapper<>(); if (StringUtils.hasLength(courseDTO.getIds())){ courseLambdaQueryWrapper.in(Order::getId, Arrays.asList(courseDTO.getIds().split(","))); @@ -215,7 +215,7 @@ courseLambdaQueryWrapper.eq(courseDTO.getUid()!=null&&(!courseDTO.getUid().isEmpty()),Order::getAppUserId, courseDTO.getUid()); if (org.springframework.util.StringUtils.hasLength(courseDTO.getBuyContent())){ // 查询购买内容 List<Long> collect1 = orderService.lambdaQuery().like(Order::getVipType, courseDTO.getBuyContent()).list().stream() List<Long> collect1 = orderService.lambdaQuery().like(Order::getBuyContent, courseDTO.getBuyContent()).list().stream() .map(Order::getId).collect(Collectors.toList()); List<Long> collect2 = orderService.lambdaQuery().like(Order::getBizOrderNo, courseDTO.getBuyContent()).list().stream() .map(Order::getId).collect(Collectors.toList()); @@ -313,7 +313,7 @@ } break; case 3: record.setBuyContent(record.getVipType()); record.setBuyContent(record.getBuyContent()); record.setGeneralPriceVip(record.getRealPayAmount()); break; case 4: @@ -418,7 +418,7 @@ } if (org.springframework.util.StringUtils.hasLength(courseDTO.getBuyContent())){ // 查询购买内容 List<Long> collect1 = orderService.lambdaQuery().like(Order::getVipType, courseDTO.getBuyContent()).list().stream() List<Long> collect1 = orderService.lambdaQuery().like(Order::getBuyContent, courseDTO.getBuyContent()).list().stream() .map(Order::getId).collect(Collectors.toList()); List<Long> collect2 = orderService.lambdaQuery().like(Order::getBizOrderNo, courseDTO.getBuyContent()).list().stream() .map(Order::getId).collect(Collectors.toList()); @@ -461,10 +461,7 @@ } List<Order> page = orderService.list(courseLambdaQueryWrapper); Page<Order> objectPage = new Page<>(); objectPage.setTotal(page.size()); objectPage.setCurrent(courseDTO.getPageCurr()); objectPage.setSize(courseDTO.getPageSize()); List<AppUserWithdraw> data2 = remoteAppUserService.getWithdraw(courseDTO).getData(); for (AppUserWithdraw appUserWithdraw : data2) { Order order = new Order(); @@ -483,6 +480,10 @@ order.setCreateTime(appUserWithdraw.getCreateTime()); page.add(order); } Page<Order> objectPage = new Page<>(); objectPage.setTotal(page.size()); objectPage.setCurrent(courseDTO.getPageCurr()); objectPage.setSize(courseDTO.getPageSize()); for (Order record : page) { record.setUid(record.getId().toString()); record.setPlatformMoney(record.getRealPayAmount()!=null?record.getRealPayAmount():record.getTotalAmount().subtract(record.getCommissionAmount()==null?BigDecimal.ZERO:record.getCommissionAmount())); @@ -519,8 +520,8 @@ } break; case 3: record.setBuyContent(record.getVipType()); record.setGeneralPriceVip(record.getRealPayAmount()); record.setBuyContent(record.getBuyContent()); record.setGeneralPriceVip(record.getTotalAmount()); break; case 4: record.setBuyContent("充值"); @@ -570,8 +571,8 @@ String endTime = null; if (org.springframework.util.StringUtils.hasLength(courseDTO.getTime())){ String[] split = courseDTO.getTime().split(" - "); startTime = split[0]+"00:00:00"; endTime = split[1]+"23:59:59"; startTime = split[0]+" 00:00:00"; endTime = split[1]+" 23:59:59"; } List<Integer> payType1 = new ArrayList<>(); payType1.add(1); @@ -583,12 +584,14 @@ payType3.add(3); payType3.add(7); List<Integer> payType4 = new ArrayList<>(); payType3.add(4); payType3.add(5); payType3.add(6); payType3.add(7); payType4.add(4); payType4.add(5); payType4.add(6); payType4.add(7); LambdaQueryWrapper<Order> courseLambdaQueryWrapper = new LambdaQueryWrapper<>(); courseLambdaQueryWrapper.between(Order::getCreateTime, startTime, endTime); if (startTime!=null){ courseLambdaQueryWrapper.between(Order::getCreateTime, startTime, endTime); } if (courseDTO.getPayType()!=null){ switch (courseDTO.getPayType()){ case 1: @@ -604,13 +607,16 @@ courseLambdaQueryWrapper.in(Order::getPayType,payType4); break; } } courseLambdaQueryWrapper.eq(courseDTO.getPaymentStatus()!=null,Order::getPaymentStatus, courseDTO.getPaymentStatus()); courseLambdaQueryWrapper.eq(courseDTO.getOrderFrom()!=null,Order::getOrderFrom, courseDTO.getOrderFrom()); if (courseDTO.getPaymentStatus()!=null){ courseLambdaQueryWrapper.eq(Order::getPaymentStatus, courseDTO.getPaymentStatus()); } if (courseDTO.getOrderFrom()!=null){ courseLambdaQueryWrapper.eq(Order::getOrderFrom, courseDTO.getOrderFrom()); } if (org.springframework.util.StringUtils.hasLength(courseDTO.getBuyContent())){ // 查询购买内容 List<Long> collect1 = orderService.lambdaQuery().like(Order::getVipType, courseDTO.getBuyContent()).list().stream() List<Long> collect1 = orderService.lambdaQuery().like(Order::getBuyContent, courseDTO.getBuyContent()).list().stream() .map(Order::getId).collect(Collectors.toList()); List<Long> collect2 = orderService.lambdaQuery().like(Order::getBizOrderNo, courseDTO.getBuyContent()).list().stream() .map(Order::getId).collect(Collectors.toList()); @@ -642,6 +648,7 @@ } courseLambdaQueryWrapper.in(Order::getId,collect); } courseLambdaQueryWrapper.orderByDesc(Order::getCreateTime); if (org.springframework.util.StringUtils.hasLength(courseDTO.getUserNameOrPhone())){ List<Long> collect = remoteAppUserService.getAppUserByNameOrPhone(courseDTO.getUserNameOrPhone()).getData(); @@ -650,6 +657,7 @@ } courseLambdaQueryWrapper.in(Order::getAppUserId, collect); } List<Order> page = orderService.list(courseLambdaQueryWrapper); List<AppUserWithdraw> data2 = remoteAppUserService.getWithdraw(courseDTO).getData(); for (AppUserWithdraw appUserWithdraw : data2) { @@ -707,8 +715,8 @@ String endTime = null; if (org.springframework.util.StringUtils.hasLength(courseDTO.getTime())){ String[] split = courseDTO.getTime().split(" - "); startTime = split[0]+"00:00:00"; endTime = split[1]+"23:59:59"; startTime = split[0]+" 00:00:00"; endTime = split[1]+" 23:59:59"; } List<Integer> payType1 = new ArrayList<>(); payType1.add(1); @@ -720,10 +728,10 @@ payType3.add(3); payType3.add(7); List<Integer> payType4 = new ArrayList<>(); payType3.add(4); payType3.add(5); payType3.add(6); payType3.add(7); payType4.add(4); payType4.add(5); payType4.add(6); payType4.add(7); LambdaQueryWrapper<Order> courseLambdaQueryWrapper = new LambdaQueryWrapper<>(); if (StringUtils.hasLength(courseDTO.getIds())){ courseLambdaQueryWrapper.in(Order::getId, Arrays.asList(courseDTO.getIds().split(","))); @@ -754,7 +762,7 @@ courseLambdaQueryWrapper.eq(courseDTO.getUid()!=null&&(!courseDTO.getUid().isEmpty()),Order::getAppUserId, courseDTO.getUid()); if (org.springframework.util.StringUtils.hasLength(courseDTO.getBuyContent())){ // 查询购买内容 List<Long> collect1 = orderService.lambdaQuery().like(Order::getVipType, courseDTO.getBuyContent()).list().stream() List<Long> collect1 = orderService.lambdaQuery().like(Order::getBuyContent, courseDTO.getBuyContent()).list().stream() .map(Order::getId).collect(Collectors.toList()); List<Long> collect2 = orderService.lambdaQuery().like(Order::getBizOrderNo, courseDTO.getBuyContent()).list().stream() .map(Order::getId).collect(Collectors.toList()); @@ -830,7 +838,7 @@ } break; case 3: record.setBuyContent(record.getVipType()); record.setBuyContent(record.getBuyContent()); record.setGeneralPriceVip(record.getRealPayAmount()); break; } xinquan-modules/xinquan-order/src/main/java/com/xinquan/order/service/impl/OrderServiceImpl.java
@@ -529,6 +529,7 @@ order.setBizOrderNo(orderNo); order.setAppUserId(userId); order.setTotalAmount(amount); order.setRealPayAmount(amount); String vipType1 =""; switch (vipType){ case 1: @@ -564,6 +565,8 @@ order.setBizOrderNo(orderNo); order.setAppUserId(userId); order.setTotalAmount(amount); order.setRealPayAmount(amount); order.setBuyContent("充值"); this.save(order); Long orderId = order.getId(); xinquan-modules/xinquan-system/src/main/java/com/xinquan/system/controller/CommonQuestionController.java
@@ -86,7 +86,7 @@ Page<CommonQuestion> page = commonQuestionService.lambdaQuery() .eq(CommonQuestion::getType,1) .orderByDesc(CommonQuestion::getSortNum) .orderByDesc(CommonQuestion::getCreateTime) .page(new Page<>(pageCurr, pageSize)); if (page.getRecords().isEmpty()){ return R.ok(PageDTO.empty(page)); @@ -109,7 +109,7 @@ Long userId = loginUser.getUserid(); Page<CommonQuestion> page = commonQuestionService.lambdaQuery() .eq(CommonQuestion::getType,1) .orderByDesc(CommonQuestion::getSortNum) .orderByDesc(CommonQuestion::getCreateTime) .page(new Page<>(pageCurr, pageSize)); if (page.getRecords().isEmpty()){ return R.ok(PageDTO.empty(page)); xinquan-modules/xinquan-system/src/main/java/com/xinquan/system/controller/ContentSettingController.java
@@ -10,10 +10,13 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.time.LocalDateTime; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * <p> @@ -40,10 +43,10 @@ public R<String> getCourseList(@RequestParam(value = "contentType", required = true) int contentType) { ContentSetting one = contentSettingService.lambdaQuery().eq(ContentSetting::getContentType, contentType).one(); if (one!=null){ return R.ok(one.getContent()); }else{ return R.ok(); } } @PostMapping("/saveOrupdateContent") @@ -67,5 +70,27 @@ return R.ok(); } public static void main(String[] args) { // 示例 HTML 字符串 String htmlString = "<img src=\"https://xqgwzh.obs.cn-south-1.myhuaweicloud.com/17313899095390cf6c36b6172b7143579920e0dfb816a_0fd6cbede59403085e39fa106a528eb8f0a734f32528a68832340f7d68939d33.png\"></img>"; // 定义正则表达式来提取 src 属性的值 String regex = "<img[^>]+src=\"([^\"]+)\""; // 编译正则表达式 Pattern pattern = Pattern.compile(regex); // 创建 Matcher 对象 Matcher matcher = pattern.matcher(htmlString); // 查找匹配项并输出 src 属性值 if (matcher.find()) { String imgSrc = matcher.group(1); // 获取 src 属性值 System.out.println("Extracted image source: " + imgSrc); } else { System.out.println("No image source found."); } } } xinquan-modules/xinquan-system/src/main/java/com/xinquan/system/controller/HomeController.java
@@ -117,6 +117,9 @@ if (!StringUtils.hasLength(homeDto.getTime())){ homeDto.setTime("1"); } if (homeDto.getTimeType()==null){ homeDto.setTimeType(5); } List<Order> data6 = remoteOrderService.getOrderList(homeDto.getStatus(), homeDto.getTimeType(), homeDto.getTime()).getData(); homeVO.setOrderCount(data6.size()+""); @@ -367,10 +370,6 @@ @ApiOperation(value = "首页统计-导出",tags = "管理后台-首页统计") public void homeStatisticsExport() { HomeVO homeVO = new HomeVO(); // homeVO.setOrderMoney(); // homeVO.setOrderCount(); // homeVO.setOrderList(); // homeVO.setOrderTimeList(); // 查询用户总数、非会员数、月卡会员数、季卡会员数、年卡会员数 String data = remoteAppUserService.getUserCount().getData(); if (data!=null){ @@ -412,6 +411,17 @@ HomeExport homeExport = new HomeExport(); BeanUtils.copyProperties(homeVO, homeExport); if (data1!=null){ String[] split = data1.split(","); homeVO.setCourseCount(split[0]); homeVO.setCourseFree(split[1]); homeVO.setCourseVip(split[2]); homeVO.setCoursePay(split[3]); homeVO.setCourseOffOnline(split[4]); Integer i = Integer.valueOf(homeExport.getCourseCount()); Integer i1 = Integer.valueOf(split[4]); homeExport.setCourseCount((i-i1)+""); } List<HomeExport> homeExports = new ArrayList<>(); homeExports.add(homeExport); Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), HomeExport.class, homeExports); xinquan-modules/xinquan-system/src/main/java/com/xinquan/system/domain/export/HomeExport.java
@@ -32,8 +32,7 @@ private String courseFree; @Excel(name = "会员课程数") private String courseVip; @Excel(name = "线下课程数") private String courseOffOnline; @Excel(name = "单独付费课程数") private String coursePay; @Excel(name = "疗愈音频总数") @@ -44,13 +43,5 @@ private String meditationVip; @Excel(name = "单独付费音频数") private String meditationPay; @Excel(name = "提问待回复") private String questionRecord; @Excel(name = "奖品兑换中") private String prizeRecord; @Excel(name = "订单总额") private String orderMoney; @Excel(name = "订单总数") private String orderCount; } xinquan-modules/xinquan-system/src/main/resources/mapper/system/SysDeptMapper.xml
@@ -62,6 +62,7 @@ <select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult"> <include refid="selectDeptVo"/> where dept_id = #{deptId} and del_flag = '0' </select> <select id="checkDeptExistUser" parameterType="Long" resultType="int"> xinquan-modules/xinquan-system/src/main/resources/mapper/system/SysOperLogMapper.xml
@@ -20,7 +20,6 @@ <result property="status" column="status" /> <result property="errorMsg" column="error_msg" /> <result property="operTime" column="oper_time" /> <result property="costTime" column="cost_time" /> </resultMap> <sql id="selectOperLogVo"> xinquan-modules/xinquan-system/src/main/resources/mapper/system/SysRoleMapper.xml
@@ -90,6 +90,7 @@ <select id="selectRoleById" parameterType="Long" resultMap="SysRoleResult"> <include refid="selectRoleVo"/> where r.role_id = #{roleId} and r.del_flag = '0' </select> <select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult"> xinquan-modules/xinquan-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -211,7 +211,7 @@ <if test="userType != null and userType != ''">user_type = #{userType},</if> <if test="reason != null and reason != ''">reason = #{reason},</if> <if test="handleName != null and handleName != ''">handleName = #{handleName},</if> <if test="disableTime != null and disableTime != ''">disable_time = #{disableTime},</if> <if test="disableTime != null">disable_time = #{disableTime},</if> update_time = sysdate() </set> xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/controller/client/ClientAppUserController.java
@@ -62,6 +62,7 @@ import java.time.temporal.TemporalAdjusters; import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; import io.swagger.models.auth.In; import lombok.RequiredArgsConstructor; @@ -429,7 +430,9 @@ byId.setFreezingTime(LocalDateTime.now()); byId.setFreezingReason(dto.getFreezingReason()); byId.setUserStatus(2); byId.setFreezingOperator(tokenService.getLoginUser().getUserid()+""); Long userid = tokenService.getLoginUser().getUserid(); SysUser data = remoteUserService.getSysUserById(userid + "").getData(); byId.setFreezingOperator(data.getNickName()+"("+data.getUserName()+")"); appUserService.updateById(byId); return R.ok(); } @@ -608,8 +611,8 @@ String endTime = null; if (org.springframework.util.StringUtils.hasLength(dto.getTime())){ String[] split = dto.getTime().split(" - "); startTime = split[0]+"00:00:00"; endTime = split[1]+"23:59:59"; startTime = split[0]+" 00:00:00"; endTime = split[1]+" 23:59:59"; } String userId = dto.getUid(); LambdaQueryWrapper<AppUser> appUserWalletRecordLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -675,15 +678,15 @@ String endTime = null; if (org.springframework.util.StringUtils.hasLength(courseDTO.getVipExpireTime())){ String[] split = courseDTO.getVipExpireTime().split(" - "); startTime = split[0]+"00:00:00"; endTime = split[1]+"23:59:59"; startTime = split[0]+" 00:00:00"; endTime = split[1]+" 23:59:59"; } String startTime1 = null; String endTime1 = null; if (org.springframework.util.StringUtils.hasLength(courseDTO.getRegisterTime())){ String[] split = courseDTO.getRegisterTime().split(" - "); startTime1 = split[0]+"00:00:00"; endTime1 = split[1]+"23:59:59"; startTime1 = split[0]+" 00:00:00"; endTime1 = split[1]+" 23:59:59"; } List<Long> longs = new ArrayList<>(); LambdaQueryWrapper<AppUser> courseLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -718,23 +721,11 @@ List<AppUser> list = appUserService.lambdaQuery().list(); List<AppUser> appUsers = new ArrayList<>(); for (AppUser appUser : list) { List<AppUserTree> list1 = appUserTreeService.lambdaQuery().eq(AppUserTree::getAppUserId, appUser.getId()) .list(); // 查询用户等级最高的那颗树苗 AppUserTree tree = list1.stream().max((o1, o2) -> { if (o1.getTreeLevelType() > o2.getTreeLevelType()) { return 1; } else if (o1.getTreeLevelType() < o2.getTreeLevelType()) { return -1; } else { return 0; } }).orElse(null); AppUserTree list1 = appUserTreeService.lambdaQuery().eq(AppUserTree::getAppUserId, appUser.getId()) .eq(AppUserTree::getSowAgain,2) .one(); // 查询疗愈等级 名称 图标 int level = 1; if (tree != null){ level = tree.getTreeLevelType(); } int level = list1.getTreeLevelType(); if (list2.contains(level+"")){ appUsers.add(appUser); } @@ -745,6 +736,7 @@ } courseLambdaQueryWrapper.in(AppUser::getId, collect); } courseLambdaQueryWrapper.isNotNull(AppUser::getCellPhone); List<AppUser> page = appUserService.list(courseLambdaQueryWrapper); List<UserExport> userExports = new ArrayList<>(); for (AppUser record : page) { @@ -757,23 +749,11 @@ }else{ record.setIsVip(1); } List<AppUserTree> list1 = appUserTreeService.lambdaQuery().eq(AppUserTree::getAppUserId, record.getId()) .list(); // 查询用户等级最高的那颗树苗 AppUserTree tree = list1.stream().max((o1, o2) -> { if (o1.getTreeLevelType() > o2.getTreeLevelType()) { return 1; } else if (o1.getTreeLevelType() < o2.getTreeLevelType()) { return -1; } else { return 0; } }).orElse(null); AppUserTree list1 = appUserTreeService.lambdaQuery().eq(AppUserTree::getAppUserId, record.getId()) .eq(AppUserTree::getSowAgain,2) .one(); // 查询疗愈等级 名称 图标 int level = 1; if (tree != null){ level = tree.getTreeLevelType(); } int level = list1.getTreeLevelType(); // 根据等级查询疗愈名称和图标 UserLevelSetting data = remoteBannerService.getIconNameByLevel(level).getData(); record.setLevel(level); @@ -813,6 +793,13 @@ userExport.setUserStatus(record.getUserStatus()+""); List<AppUserQuestion> list = appUserQuestionService.lambdaQuery() .eq(AppUserQuestion::getAppUserId, record.getId()).list(); userExport.setType1(""); userExport.setType2(""); userExport.setType3(""); userExport.setType4(""); userExport.setType5(""); userExport.setType6(""); userExport.setType6(""); for (AppUserQuestion appUserQuestion : list) { switch (appUserQuestion.getType()){ case 1: @@ -835,17 +822,15 @@ break; } } List<Integer> collect = appUserTagService.lambdaQuery() .eq(AppUserTag::getAppUserId, record.getId()).list().stream() .map(AppUserTag::getTagId) .collect(Collectors.toList()); if (collect.isEmpty()){ collect.add(-1); List<String> collect = new ArrayList<>(); if (org.springframework.util.StringUtils.hasLength(record.getTagId())) { collect = tagService.lambdaQuery() .in(Tag::getId, Arrays.stream(record.getTagId().split(",")).map(Long::parseLong).collect(Collectors.toList())).list().stream() .map(Tag::getTagName).collect(Collectors.toList()); } List<Tag> list2 = tagService.lambdaQuery().in(Tag::getId, collect).list(); StringBuilder stringBuilder = new StringBuilder(); for (Tag tag : list2) { stringBuilder.append(tag.getTagName()).append(";"); for (String tag : collect) { stringBuilder.append(tag).append(";"); } userExport.setType7(stringBuilder+""); userExport.setSanskritFlag(record.getSanskritFlag()+""); @@ -884,15 +869,15 @@ String endTime = null; if (org.springframework.util.StringUtils.hasLength(courseDTO.getVipExpireTime())){ String[] split = courseDTO.getVipExpireTime().split(" - "); startTime = split[0]+"00:00:00"; endTime = split[1]+"23:59:59"; startTime = split[0]+" 00:00:00"; endTime = split[1]+" 23:59:59"; } String startTime1 = null; String endTime1 = null; if (org.springframework.util.StringUtils.hasLength(courseDTO.getRegisterTime())){ String[] split = courseDTO.getRegisterTime().split(" - "); startTime1 = split[0]+"00:00:00"; endTime1 = split[1]+"23:59:59"; startTime1 = split[0]+" 00:00:00"; endTime1 = split[1]+" 23:59:59"; } List<Long> longs = new ArrayList<>(); LambdaQueryWrapper<AppUser> courseLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -1579,9 +1564,17 @@ @PostMapping("/getUserByPhone") @ApiOperation(value = "根据用户手机号查询用户信息") public R<AppUserDetailVO> getCurrentUser(String phone) { LoginUser loginUser = tokenService.getLoginUser(); if (loginUser==null){ return R.tokenError("登录失效"); } AppUser one = appUserService.lambdaQuery().eq(AppUser::getCellPhone, phone) .ne(AppUser::getUserStatus,3).one(); if (one!=null){ if (one.getId().equals(loginUser.getUserid())){ return R.fail("不可赠送给自己"); } AppUserDetailVO appUserDetailVO = new AppUserDetailVO(); appUserDetailVO.setId(one.getId()); appUserDetailVO.setCellPhone(one.getCellPhone()); xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/controller/client/ClientAppUserTreeController.java
@@ -151,7 +151,7 @@ } else { appUserTree.setIsSign(2); } if (temp >= 120) { if (temp >= 3600) { if (appUserTree.getTaskOne() == 2) { AppUserEnergyRecord appUserEnergyRecord = new AppUserEnergyRecord(); appUserEnergyRecord.setAppUserId(userId); @@ -173,7 +173,7 @@ } appUserTree.setTaskOne(1); appUserTree.setTaskTwo(1); } else if (temp >= 60) { } else if (temp >= 1800) { if (appUserTree.getTaskOne() == 2) { AppUserEnergyRecord appUserEnergyRecord = new AppUserEnergyRecord(); appUserEnergyRecord.setAppUserId(userId); @@ -195,7 +195,7 @@ appUserTree.setTotalEnergyValue(byId.getTotalEnergyValue()); return R.ok(appUserTree); } else { if (temp >= 120) { if (temp >= 3600) { if (one.getTaskOne() == 2) { AppUserEnergyRecord appUserEnergyRecord = new AppUserEnergyRecord(); appUserEnergyRecord.setAppUserId(userId); @@ -217,7 +217,7 @@ } one.setTaskOne(1); one.setTaskTwo(1); } else if (temp >= 60) { } else if (temp >= 1800) { if (one.getTaskOne() == 2) { AppUserEnergyRecord appUserEnergyRecord = new AppUserEnergyRecord(); appUserEnergyRecord.setAppUserId(userId); xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/controller/client/ClientAppUserWalletRecordController.java
@@ -91,8 +91,8 @@ String endTime = null; if (org.springframework.util.StringUtils.hasLength(dto.getTime())){ String[] split = dto.getTime().split(" - "); startTime = split[0]+"00:00:00"; endTime = split[1]+"23:59:59"; startTime = split[0]+" 00:00:00"; endTime = split[1]+" 23:59:59"; } String userId = dto.getUid(); LambdaQueryWrapper<AppUser> appUserWalletRecordLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -147,7 +147,7 @@ return R.ok(empty); } for (AppUserWalletRecord record : page.getRecords()) { record.setId(record.getOrderId()); record.setId(record.getId()); } return R.ok(PageDTO.of(page, OrderListVO.class)); } @@ -210,7 +210,7 @@ orderDetailVO.setPaymentTime(byId1.getUpdateTime()); }else if (byId.getReason().equals("充值")){ Order one = remoteOrderService.getOrderById(byId.getOrderId()).getData(); if (byId.getChildAppUserId() == null && one!=null){ if (one!=null){ orderDetailVO.setType("充值"); orderDetailVO.setPayType(one.getPayType()); orderDetailVO.setPayOrderNo(one.getPayOrderNo()); @@ -238,7 +238,7 @@ orderDetailVO.setUserName(appUserById.getNickname()); orderDetailVO.setAvatar(appUserById.getAvatar()); } return R.ok(new OrderDetailVO()); return R.ok(orderDetailVO); } }else if (byId.getReason().equals("提现回退")){ AppUserWithdraw byId1 = appUserWithdrawService.getById(byId.getOrderId()); @@ -248,7 +248,7 @@ orderDetailVO.setAmount(byId1.getAmount()); orderDetailVO.setChangeType(byId.getChangeType()); orderDetailVO.setPaymentTime(byId1.getUpdateTime()); return R.ok(new OrderDetailVO()); return R.ok(orderDetailVO); } } xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/controller/client/ClientAppUserWithdrawController.java
@@ -151,8 +151,8 @@ String startTime =null; String endTime =null; String[] split = courseDTO.getTime().split(" - "); startTime = split[0]+"00:00:00"; endTime = split[1]+"23:59:59"; startTime = split[0]+" 00:00:00"; endTime = split[1]+" 23:59:59"; wrapper.between(AppUserWithdraw::getWithdrawTime,startTime,endTime); } List<AppUserWithdraw> list = withdrawService.list(wrapper); @@ -241,8 +241,8 @@ String startTime =null; String endTime =null; String[] split = courseDTO.getTime().split(" - "); startTime = split[0]+"00:00:00"; endTime = split[1]+"23:59:59"; startTime = split[0]+" 00:00:00"; endTime = split[1]+" 23:59:59"; wrapper.between(AppUserWithdraw::getWithdrawTime,startTime,endTime); } List<AppUserWithdraw> list = withdrawService.list(wrapper); xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/controller/client/ClientPrizeController.java
@@ -7,6 +7,8 @@ import com.xinquan.common.core.utils.page.CollUtils; import com.xinquan.common.core.utils.page.PageDTO; import com.xinquan.common.security.utils.SecurityUtils; import com.xinquan.course.api.domain.Course; import com.xinquan.course.api.domain.CourseCategory; import com.xinquan.system.api.domain.Prize; import com.xinquan.system.api.domain.PrizeRedemptionRecord; import com.xinquan.user.service.PrizeRedemptionRecordService; @@ -18,7 +20,9 @@ import org.springframework.web.bind.annotation.*; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; /** @@ -94,6 +98,14 @@ @PostMapping("/deletePrize") @ApiOperation(value = "批量删除", tags = "管理后台-奖品管理") public R deletePrize(String ids) { List<Long> collect = Arrays.stream(ids.split(",")).map(Long::valueOf).collect(Collectors.toList()); for (Long l : collect) { List<PrizeRedemptionRecord> list = prizeRedemptionRecordService.lambdaQuery().eq(PrizeRedemptionRecord::getPrizeId, l).list(); if (!list.isEmpty()){ Prize byId = prizeService.getById(l); return R.fail("奖品名称:"+byId.getName()+"存在兑换记录,不可删除"); } } return R.ok(prizeService.removeBatchByIds(Arrays.asList(ids.split(",")).stream().map(Long::valueOf).collect(Collectors.toList()))); } } xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/controller/client/ClientPrizeRedemptionRecordController.java
@@ -75,8 +75,8 @@ String endTime = null; if (org.springframework.util.StringUtils.hasLength(courseDTO.getTime())){ String[] split = courseDTO.getTime().split(" - "); startTime = split[0]+"00:00:00"; endTime = split[1]+"23:59:59"; startTime = split[0]+" 00:00:00"; endTime = split[1]+" 23:59:59"; } List<Long> longs = new ArrayList<>(); LambdaQueryWrapper<PrizeRedemptionRecord> courseLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -174,8 +174,8 @@ String endTime = null; if (org.springframework.util.StringUtils.hasLength(courseDTO.getTime())){ String[] split = courseDTO.getTime().split(" - "); startTime = split[0]+"00:00:00"; endTime = split[1]+"23:59:59"; startTime = split[0]+" 00:00:00"; endTime = split[1]+" 23:59:59"; } List<Long> longs = new ArrayList<>(); LambdaQueryWrapper<PrizeRedemptionRecord> courseLambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -267,6 +267,7 @@ byId.setUpdateTime(LocalDateTime.now()); SysUser data = remoteUserService.getSysUserById(userId + "").getData(); byId.setUpdateBy(data.getUserName()+data.getNickName()+"("+data.getUserName()+")"); byId.setHandleName(data.getUserName()+data.getNickName()+"("+data.getUserName()+")"); prizeRedemptionRecordService.updateById(byId); } return R.ok(); xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/domain/export/PrizeExport.java
@@ -21,7 +21,7 @@ private String amount; @Excel(name = "消耗能量值",width = 30) private String energyValue; @Excel(name = "提现状态",width = 30,replace = {"待领取_1","已兑换_2"}) @Excel(name = "提现状态",width = 30,replace = {"兑换中_1","已兑换_2"}) private String status; xinquan-modules/xinquan-user/src/main/java/com/xinquan/user/domain/export/UserExport.java
@@ -17,7 +17,7 @@ private String realname; @Excel(name = "用户手机号",width = 30) private String cellphone; @Excel(name = "性别",width = 30,replace = {"男_1","女_2"}) @Excel(name = "性别",width = 30,replace = {"男_1","女_2","保密_3"}) private String gender; @Excel(name = "出生日期",width = 30 ) private String birthday; @@ -47,7 +47,7 @@ private String registerTime; @Excel(name = "用户状态",width = 30,replace = {"正常_1","冻结_2","注销_3"}) private String userStatus; @Excel(name = "您是否内心纠结敏感多以?",width = 60 ,replace = {"是_1","否_2","偶尔有_3"}) @Excel(name = "您是否内心纠结敏感多疑?",width = 60 ,replace = {"是_1","否_2","偶尔有_3"}) private String type1; @Excel(name = "您是否辗转反侧彻夜难眠?",width = 60,replace = {"是_1","否_2","偶尔有_3"}) private String type2;