puzhibing
2023-12-08 32106f511657695e79d53e98a350ce70a36f6da1
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,6 +146,7 @@
//                jsonObject = JSONObject.fromObject(tCoursePackageDiscount.getContent());
//            }
//            // 获取所选课时的课包价格配置
        if (tCoursePackagePayment.getCoursePackageConfigId()!=null) {
            List<CoursePackagePaymentConfig> coursePackagePaymentConfigs =
                    coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList1
                            (tCoursePackagePayment.getCoursePackageConfigId());
@@ -152,6 +154,12 @@
                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);
    }