From 0133dbbfad0e7f5920ff4f158127e4863ee15310 Mon Sep 17 00:00:00 2001 From: lisy <linlangsur163@163.com> Date: 星期二, 08 八月 2023 17:21:41 +0800 Subject: [PATCH] 字段变更 --- cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java | 32 +++++++++++++++++--------------- 1 files changed, 17 insertions(+), 15 deletions(-) diff --git a/cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java b/cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java index 7406b63..e87e6fd 100644 --- a/cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java +++ b/cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java @@ -854,13 +854,15 @@ } @Override - public ResultUtil productRedemptionOperation(Integer userIdFormRedis, Integer goodId, Integer goodsType,Integer nums,Integer exchangeType,Integer payType,List<Integer> stuIds) { - PointsMerchandise merchandise = mcClient.selectPointsMerchandiseById(goodId); + public ResultUtil productRedemptionOperation(Integer userIdFormRedis, GoodsExchangeVo exchangeType) { + System.out.println("exchangeType:--->"); + System.out.println(exchangeType); + PointsMerchandise merchandise = mcClient.selectPointsMerchandiseById(exchangeType.getGoodId()); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); String code = sdf.format(new Date()) + UUIDUtil.getNumberRandom(5); - for (int i = 0; i < nums; i++) { + for (int i = 0; i < exchangeType.getNums(); i++) { UserPointsMerchandise pointsMerchandise = new UserPointsMerchandise(); - pointsMerchandise.setPointsMerchandiseId(goodId); + pointsMerchandise.setPointsMerchandiseId(exchangeType.getGoodId()); pointsMerchandise.setUserId(userIdFormRedis); pointsMerchandise.setCode(code); mcClient.saveDetailsUserPointMercase(pointsMerchandise); @@ -882,15 +884,15 @@ this.baseMapper.updateById(tAppUser); // 现金支付 - if (exchangeType == 2 || exchangeType == 3) { - switch (goodsType) { + if (exchangeType.getExchangeType() == 2 || exchangeType.getExchangeType() == 3) { + switch (exchangeType.getGoodsType()) { case 2: - for (int i = 0; i < stuIds.size(); i++) { + for (int i = 0; i < exchangeType.getStuIds().size(); i++) { List<CoursePackagePaymentConfig> courseConfigList = cpconClient.getCourseConfigList(merchandise.getCoursePackageId()); TCoursePackagePayment packagePayment = new TCoursePackagePayment(); packagePayment.setAppUserId(userIdFormRedis); - packagePayment.setStudentId(stuIds.get(i)); + packagePayment.setStudentId(exchangeType.getStuIds().get(i)); packagePayment.setCoursePackageId(merchandise.getCoursePackageId()); for (CoursePackagePaymentConfig coursePackagePaymentConfig : courseConfigList) { if (Objects.equals(coursePackagePaymentConfig.getId(),merchandise.getCoursePackageConfigId())){ @@ -914,9 +916,9 @@ } break; case 4: - for (int i = 0; i < nums; i++) { + for (int i = 0; i < exchangeType.getNums(); i++) { UserCoupon coupon = new UserCoupon(); - coupon.setCouponId(goodId); + coupon.setCouponId(exchangeType.getGoodId()); coupon.setUserId(userIdFormRedis); coupon.setStatus(1); coupon.setInsertTime(new Date()); @@ -927,22 +929,22 @@ break; } - switch (payType){ + switch (exchangeType.getPayType()){ case 1: try { if (merchandise.getType() == 2){ - return WechatPayment(merchandise.getCash().multiply(new BigDecimal(stuIds.size())),code); + return WechatPayment(merchandise.getCash().multiply(new BigDecimal(exchangeType.getStuIds().size())),code); }else { - return WechatPayment(merchandise.getCash().multiply(new BigDecimal(nums)),code); + return WechatPayment(merchandise.getCash().multiply(new BigDecimal(exchangeType.getNums())),code); } }catch (Exception e){ return ResultUtil.runErr(); } case 2: if (merchandise.getType() == 2){ - AlipayPayment(merchandise.getCash().multiply(new BigDecimal(stuIds.size())),code); + AlipayPayment(merchandise.getCash().multiply(new BigDecimal(exchangeType.getStuIds().size())),code); }else { - AlipayPayment(merchandise.getCash().multiply(new BigDecimal(nums)),code); + AlipayPayment(merchandise.getCash().multiply(new BigDecimal(exchangeType.getNums())),code); } break; default: -- Gitblit v1.7.1