| | |
| | | coupon.setIllustrate(dataVo.getIllustrate()); |
| | | coupon.setDistributionMethod(dataVo.getDistributionMethod()); |
| | | coupon.setRedemptionMethod(dataVo.getExchangeMethod()); |
| | | switch (dataVo.getExchangeMethod()){ |
| | | case 1: |
| | | coupon.setIntegral(BigDecimal.valueOf(dataVo.getRequiredPoints())); |
| | | break; |
| | | case 2: |
| | | coupon.setCash(dataVo.getRequiredCash()); |
| | | coupon.setIntegral(BigDecimal.valueOf(dataVo.getRequiredPoints())); |
| | | break; |
| | | case 3: |
| | | coupon.setCash(dataVo.getRequiredCash()); |
| | | break; |
| | | default: |
| | | break; |
| | | if (dataVo.getExchangeMethod()!=null){ |
| | | switch (dataVo.getExchangeMethod()){ |
| | | case 1: |
| | | coupon.setIntegral(BigDecimal.valueOf(dataVo.getRequiredPoints())); |
| | | break; |
| | | case 2: |
| | | coupon.setCash(dataVo.getRequiredCash()); |
| | | coupon.setIntegral(BigDecimal.valueOf(dataVo.getRequiredPoints())); |
| | | break; |
| | | case 3: |
| | | coupon.setCash(dataVo.getRequiredCash()); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | coupon.setQuantityIssued(dataVo.getQuantityIssued()); |
| | | coupon.setPickUpQuantity(dataVo.getPickUpQuantity()); |
| | | coupon.setUseScope(dataVo.getCompany()); |
| | |
| | | } |
| | | |
| | | boolean save = couponService.save(coupon); |
| | | // 自动发券 |
| | | if (dataVo.getDistributionMethod() == 3){ |
| | | // 判断用户人群 再判断限领数量 |
| | | switch (dataVo.getUserGroup()){ |
| | | case 1: |
| | | |
| | | break; |
| | | case 2: |
| | | |
| | | break; |
| | | case 3: |
| | | |
| | | break; |
| | | } |
| | | } |
| | | if (save){ |
| | | if (dataVo.getCompany() == 3){ |
| | | String[] split = dataVo.getStoreIds().split(","); |