From 4ebae3295b2c085d5b29870cd4b358a3ad63213a Mon Sep 17 00:00:00 2001 From: nickchange <126672920+nickchange@users.noreply.github.com> Date: 星期五, 08 十二月 2023 19:59:04 +0800 Subject: [PATCH] 后台添加无法支付bug --- cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/CoursePackagePaymentController.java | 30 +++++++++++++++++++++--------- 1 files changed, 21 insertions(+), 9 deletions(-) diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/CoursePackagePaymentController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/CoursePackagePaymentController.java index fdbf0f9..fa2b4aa 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/CoursePackagePaymentController.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/CoursePackagePaymentController.java @@ -13,6 +13,7 @@ import com.dsh.course.feignClient.other.SiteClient; import com.dsh.course.feignClient.other.StoreClient; import com.dsh.course.feignClient.other.model.Banner; +import com.dsh.course.util.UUIDUtil; import com.dsh.guns.config.UserExt; import com.dsh.guns.core.base.controller.BaseController; import com.dsh.guns.modular.system.model.*; @@ -106,8 +107,8 @@ * 添加购课记录 */ @ResponseBody - @PostMapping(value = "/addCoursePackagePayment/{id}") - public Object addCoach(@RequestBody TCoursePackagePayment tCoursePackagePayment, @PathVariable("id")Integer id) { + @PostMapping(value = "/addCoursePackagePayment") + public Object addCoach(@RequestBody TCoursePackagePayment tCoursePackagePayment) { Integer objectId = UserExt.getUser().getObjectId(); Integer objectType = UserExt.getUser().getObjectType(); String name = UserExt.getUser().getName(); @@ -145,14 +146,21 @@ // jsonObject = JSONObject.fromObject(tCoursePackageDiscount.getContent()); // } // // 获取所选课时的课包价格配置 -// List<CoursePackagePaymentConfig> coursePackagePaymentConfigs = -// coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList1 -// (tCoursePackagePayment.getCoursePackageConfigId()); -// if (coursePackagePaymentConfigs.size()!=0){ -// CoursePackagePaymentConfig coursePackagePaymentConfig = coursePackagePaymentConfigs.get(0); -// tCoursePackagePayment.setOriginalPrice(coursePackagePaymentConfig.getCashPayment()); + if (tCoursePackagePayment.getCoursePackageConfigId()!=null) { + List<CoursePackagePaymentConfig> coursePackagePaymentConfigs = + coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList1 + (tCoursePackagePayment.getCoursePackageConfigId()); + if (coursePackagePaymentConfigs.size() != 0) { + CoursePackagePaymentConfig coursePackagePaymentConfig = coursePackagePaymentConfigs.get(0); + tCoursePackagePayment.setOriginalPrice(coursePackagePaymentConfig.getCashPayment()); // tCoursePackagePayment.setPlayPaiCoin(coursePackagePaymentConfig.getPlayPaiCoin()); -// } + } + }else { + List<CoursePackagePaymentConfig> coursePackagePaymentConfigs = coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList(coursePackageId); + CoursePackagePaymentConfig coursePackagePaymentConfig = coursePackagePaymentConfigs.get(0); + tCoursePackagePayment.setOriginalPrice(coursePackagePaymentConfig.getCashPayment()); + + } // // 原价 // Double originalPrice = tCoursePackagePayment.getOriginalPrice(); // @@ -288,7 +296,11 @@ // BigDecimal bigDecimal = new BigDecimal(minValue); // tCoursePackagePayment.setCashPayment(bigDecimal); // } + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); + String code = sdf.format(new Date()) + UUIDUtil.getNumberRandom(5); + + tCoursePackagePayment.setCode(code); return coursePackagePaymentClient.addCoursePackagePayment(tCoursePackagePayment); } -- Gitblit v1.7.1