lisy
2023-08-08 0133dbbfad0e7f5920ff4f158127e4863ee15310
字段变更
4个文件已修改
39 ■■■■■ 已修改文件
cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-account/src/main/java/com/dsh/account/model/vo/userBenefitDetail/GoodsExchangeVo.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-account/src/main/java/com/dsh/account/service/TAppUserService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java
@@ -367,7 +367,7 @@
            if(null == userIdFormRedis){
                return ResultUtil.tokenErr();
            }
            return tauService.productRedemptionOperation(userIdFormRedis,exchangeType.getGoodId(),exchangeType.getGoodsType(),exchangeType.getNums(),exchangeType.getExchangeType(),exchangeType.getPayType(),exchangeType.getStuIds());
            return tauService.productRedemptionOperation(userIdFormRedis,exchangeType);
        }catch (Exception e){
            return ResultUtil.runErr();
        }
cloud-server-account/src/main/java/com/dsh/account/model/vo/userBenefitDetail/GoodsExchangeVo.java
@@ -30,4 +30,7 @@
    @ApiModelProperty(value = "学员id列表",required = false)
    List<Integer> stuIds;
    @ApiModelProperty(value = "门店id列表",required = false)
    List<Integer> storeIds;
}
cloud-server-account/src/main/java/com/dsh/account/service/TAppUserService.java
@@ -128,7 +128,7 @@
    StuAndStoreResponse queryAppUserDefaultStuAndStore(Integer userIdFormRedis ,Integer pointsMerId, String lat, String lon,Integer isCourse);
    ResultUtil productRedemptionOperation(Integer userIdFormRedis, Integer goodId, Integer goodsType,Integer nums,Integer exchangeType,Integer payType,List<Integer> stuIds);
    ResultUtil productRedemptionOperation(Integer userIdFormRedis, GoodsExchangeVo exchangeVo);
    ResultUtil exchangeAddPaymentCallback(String code, String orderNumber,Integer payType);
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: