| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alipay.api.AlipayApiException; |
| | | import com.alipay.api.AlipayClient; |
| | | import com.alipay.api.DefaultAlipayClient; |
| | | import com.alipay.api.domain.Person; |
| | | import com.alipay.api.request.AlipayTradeOrderSettleRequest; |
| | | import com.alipay.api.response.AlipayTradeOrderSettleResponse; |
| | | import com.alipay.api.response.AlipayTradeQueryResponse; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import com.dsh.course.entity.*; |
| | | import com.dsh.course.entity.TAppUser; |
| | | import com.dsh.course.entity.dto.StudentQeryDto; |
| | | import com.dsh.course.feignclient.account.AppUserClient; |
| | | import com.dsh.course.feignclient.account.CoachClient; |
| | | import com.dsh.course.feignclient.account.StudentClient; |
| | | import com.dsh.course.feignclient.account.UserIntegralChangesClient; |
| | | import com.dsh.course.feignclient.account.*; |
| | | import com.dsh.course.feignclient.account.model.*; |
| | | import com.dsh.course.feignclient.activity.BenefitVideoClient; |
| | | import com.dsh.course.feignclient.activity.CouponClient; |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.persistence.criteria.CriteriaBuilder; |
| | | import java.math.BigDecimal; |
| | | import java.math.BigInteger; |
| | | import java.math.MathContext; |
| | | import java.math.RoundingMode; |
| | | import java.text.ParseException; |
| | |
| | | @Resource |
| | | private UserIntegralChangesClient userIntegralChangesClient; |
| | | |
| | | @Resource |
| | | private StudentHonorClient studentHonorClient; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<CoursePackagePaymentVO> listAll(CoursePackagePaymentQuery query) { |
| | |
| | | if(null != appUserIds){ |
| | | status.in("appUserId", appUserIds); |
| | | } |
| | | List<Map<String, Object>> maps = this.baseMapper.getStudentTotal(appUserIds, studentQeryDto.getStart(), studentQeryDto.getEnd()); |
| | | List<Map<String, Object>> maps = this.baseMapper.getStudentTotal(appUserIds, studentQeryDto.getStart(), studentQeryDto.getEnd(),studentQeryDto.getCoursePackageIds()); |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | for (Map<String, Object> objectMap : maps) { |
| | | if(null == objectMap.get("studentId")){ |
| | |
| | | .eq("coursePackageId", detailsRequest.getCoursePackageId()) |
| | | .eq("courseId", detailsRequest.getVideoId()) |
| | | ); |
| | | //完成学习 |
| | | if (null != userVideoDetails && userVideoDetails.getState() == 1 && detailsRequest.getIsOver() == 1) { |
| | | userVideoDetails.setState(2); |
| | | userVideoDetails.setUpdateTime(new Date()); |
| | |
| | | AppUser appUser = appuClient.queryAppUser(coursePackageScheduling.getAppUserId()); |
| | | appUser.setIntegral((null == appUser.getIntegral() ? 0 : appUser.getIntegral()) + (null == coursePackageScheduling.getIntegral() ? 0 : coursePackageScheduling.getIntegral())); |
| | | appuClient.updateAppUser(appUser); |
| | | //保存用户积分变动记录 |
| | | SaveUserIntegralChangesVo vo = new SaveUserIntegralChangesVo(); |
| | | vo.setAppUserId(coursePackageScheduling.getAppUserId()); |
| | | vo.setIntegral(coursePackageScheduling.getIntegral()); |
| | | vo.setType(4); |
| | | userIntegralChangesClient.saveUserIntegralChanges(vo); |
| | | //添加勋章数据 |
| | | Integer number = uvdmapper.selectCount(new QueryWrapper<UserVideoDetails>().eq("appUserId", appUserId).eq("state", 2)); |
| | | StudentHonor studentHonor = new StudentHonor(); |
| | | studentHonor.setAppUserId(appUserId); |
| | | studentHonor.setHonorType(4); |
| | | studentHonor.setNumber(number); |
| | | studentHonorClient.saveStudentHonor(studentHonor); |
| | | return "SUCCESS"; |
| | | } |
| | | return "ERROR"; |
| | |
| | | newPayment.setPayType(request.getPayType()); |
| | | newPayment.setState(1); |
| | | newPayment.setInsertTime(new Date()); |
| | | newPayment.setOrderType(1); |
| | | coursePackageOrderService.save(newPayment); |
| | | code = newPayment.getCode(); |
| | | } |
| | |
| | | Map<String, String> data1 = resultUtil.getData(); |
| | | String s = data1.get("trade_state"); |
| | | String transaction_id = data1.get("transaction_id"); |
| | | if ("REFUND".equals(s) || "NOTPAY".equals(s) || "CLOSED".equals(s) || "REVOKED".equals(s) || "PAYERROR".equals(s) || num == 10) { |
| | | if ("REFUND".equals(s) || "CLOSED".equals(s) || "REVOKED".equals(s) || "PAYERROR".equals(s) || num == 10) { |
| | | //有待支付的订单,这里不处理 |
| | | // coursePackageOrder1.setState(3); |
| | | // coursePackageOrderService.updateById(coursePackageOrder1); |
| | |
| | | coursePackageService.addCoursePackageOrderStudent(coursePackageOrder1.getId(), coursePackagePaymentConfig); |
| | | break; |
| | | } |
| | | if ("USERPAYING".equals(s)) { |
| | | if ("USERPAYING".equals(s) || "NOTPAY".equals(s)) { |
| | | num++; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | public List<Integer> getIds(Integer siteId) { |
| | | HttpRequest httpRequest = HttpRequest.get("https://try.daowepark.com/v7/user_api/general/get_space_area?space_id=" + siteId); |
| | | HttpRequest httpRequest = HttpRequest.get("https://port.daowepark.com/v7/user_api/general/get_space_area?space_id=" + siteId); |
| | | HttpResponse execute = httpRequest.execute(); |
| | | String body = execute.body(); |
| | | JSONObject jsonObject = JSONObject.parseObject(body); |
| | |
| | | coursePackageOrderService.updateById(coursePackageOrder1); |
| | | |
| | | CoursePackagePaymentConfig coursePackagePaymentConfig = coursePackagePaymentConfigService.getOne(new QueryWrapper<CoursePackagePaymentConfig>() |
| | | .eq("coursePackageId", coursePackageOrder1.getId()) |
| | | .eq("coursePackageId", coursePackageOrder1.getCoursePackageId()) |
| | | .eq("classHours", coursePackageOrder1.getClassHours()) |
| | | ); |
| | | coursePackageService.addCoursePackageOrderStudent(coursePackageOrder1.getId(), coursePackagePaymentConfig); |