liu 2 vuotta sitten
vanhempi
commit
be89aa41a2

+ 3 - 16
mhotel/src/com/happy/dao/impl/HotelCouponImplDao.java

@@ -310,24 +310,11 @@ public class HotelCouponImplDao implements HotelCouponDao {
                 "\thc.deduction_price as deductionPrice,\n" +
                 "\thc.max_deduction as maxDeduction,\n" +
                 "\thc.meet_price as meetPrice,\n" +
-                "\thc.effective_end_date as effectiveEndDate ,hc.effective_start_date as effectiveStartDate, hc.effective_day as effectiveDay,hc.effective_lose_day as effectiveLoseDay , hc.effective_type as effectiveType, hcs.create_date as dateTime , \n" +
-                "\thcs2.count AS count\n" +
+                "\thc.effective_end_date as effectiveEndDate ,hc.effective_start_date as effectiveStartDate, hc.effective_day as effectiveDay,hc.effective_lose_day as effectiveLoseDay , hc.effective_type as effectiveType, hcs.create_date AS dateTime \n" +
                 "FROM\n" +
                 "\thotel_coupon_status hcs\n" +
-                "\tLEFT JOIN hotel_coupon hc ON hc.id = hcs.complaint_id  LEFT JOIN (\n" +
-                "SELECT\n" +
-                "\thc2.id AS id,\n" +
-                "\tcount( hcs.complaint_id ) AS count \n" +
-                "FROM\n" +
-                "\thotel_coupon_status hcs\n" +
-                "\tLEFT JOIN hotel_coupon hc2 ON hc2.id = hcs.complaint_id \n" +
-                "WHERE\n" +
-                "\tFIND_IN_SET( hc2.type, :status ) \n" +
-                "\tAND hcs.user_id = :userId \n" +
-                "\tAND hcs.`status` = 1 \n" +
-                "GROUP BY\n" +
-                "\thcs.complaint_id \n" +
-                "\t) hcs2 ON hcs2.id = hc.id  where FIND_IN_SET(hc.type,:status) and hcs.user_id=:userId and hcs.status=1  \n" +
+                "\tLEFT JOIN hotel_coupon hc ON hc.id = hcs.complaint_id  " +
+                "\t  where FIND_IN_SET(hc.type,:status) and hcs.user_id=:userId and hcs.status=1  \n" +
                 "\tORDER BY hc.effective_start_date DESC limit :start,:rows";
 
         MapSqlParameterSource sps = new MapSqlParameterSource();

+ 3 - 1
mhotel/src/com/happy/service/impl/HotelCoupomImplService.java

@@ -126,7 +126,9 @@ public class HotelCoupomImplService implements HotelCoupomService {
                     }
                     if (limitNumber > totalCount && remainderNumber > 0) {
                         couponCollectionVo.setClaimStatus(1);
-                    } else {
+                    } else if (remainderNumber==0){
+                        couponCollectionVo.setClaimStatus(3);
+                    }else {
                         couponCollectionVo.setClaimStatus(2);
                     }
                 }

+ 1 - 2
mhotel/src/com/happy/vo/CardCouponPageVo.java

@@ -22,8 +22,7 @@ public class CardCouponPageVo {
     private Double meetPrice; // 满减金额
 
     private String effectiveEndDate; //有效期结束时间
-//    领取张数
-    private Integer count;
+
 
     private String effectiveStartDate;//有效期开始时间
 

+ 1 - 1
mhotel/src/com/happy/vo/CouponCollectionVo.java

@@ -28,6 +28,6 @@ public class CouponCollectionVo {
     private Integer remainderNumber; //剩余数量
     private Integer reversedNumber; //已核销数量
     private Integer totalCount;//    领取数
-    private Integer claimStatus;//可领取1,不可领取2
+    private Integer claimStatus;//可领取1,不可领取2,已领完3
 
 }