浏览代码

优惠券支付

zouxuan 3 年之前
父节点
当前提交
3006dc2894

+ 13 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRepair.java

@@ -1,11 +1,13 @@
 package com.ym.mec.biz.dal.entity;
 package com.ym.mec.biz.dal.entity;
 
 
 import com.ym.mec.biz.dal.dto.PayParamBasicDto;
 import com.ym.mec.biz.dal.dto.PayParamBasicDto;
+import com.ym.mec.biz.dal.dto.SysCouponCodeDto;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.util.Date;
 import java.util.Date;
+import java.util.List;
 
 
 public class StudentRepair extends PayParamBasicDto {
 public class StudentRepair extends PayParamBasicDto {
     private Integer id;
     private Integer id;
@@ -214,6 +216,17 @@ public class StudentRepair extends PayParamBasicDto {
     @ApiModelProperty(value = "辅件金额", required = false)
     @ApiModelProperty(value = "辅件金额", required = false)
     private BigDecimal repairGoodsAmount = BigDecimal.ZERO;
     private BigDecimal repairGoodsAmount = BigDecimal.ZERO;
 
 
+    @ApiModelProperty(value = "优惠券列表", required = false)
+    List<SysCouponCodeDto> couponCodeDtos;
+
+    public List<SysCouponCodeDto> getCouponCodeDtos() {
+        return couponCodeDtos;
+    }
+
+    public void setCouponCodeDtos(List<SysCouponCodeDto> couponCodeDtos) {
+        this.couponCodeDtos = couponCodeDtos;
+    }
+
     public String getCouponIds() {
     public String getCouponIds() {
         return couponIds;
         return couponIds;
     }
     }

+ 7 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java

@@ -598,7 +598,13 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
 
 
     @Override
     @Override
     public StudentRepair getRepairInfo(Integer id) {
     public StudentRepair getRepairInfo(Integer id) {
-        return studentRepairDao.getRepairInfo(id);
+        StudentRepair repairInfo = studentRepairDao.getRepairInfo(id);
+        String couponIds = repairInfo.getCouponIds();
+        if(StringUtils.isNotEmpty(couponIds)){
+            List<Integer> collect = Arrays.stream(couponIds.split(",")).map(e -> Integer.valueOf(e)).collect(Collectors.toList());
+            repairInfo.setCouponCodeDtos(sysCouponCodeService.findByIdList(collect));
+        }
+        return repairInfo;
     }
     }
 
 
     @Override
     @Override