|
@@ -29,6 +29,15 @@ public class CouponService {
|
|
|
@Autowired
|
|
|
private CouponLogService couponLogService;
|
|
|
|
|
|
+ String couponNewUserCoupon = "PVP2018051297451";
|
|
|
+ String couponConsultTaskCoupon = "PVP2018051273883";
|
|
|
+ String couponDetectionTaskCoupon = "PVP2018051211608";
|
|
|
+ String couponRechargeTaskCoupon = "PVP2018051263016";
|
|
|
+
|
|
|
+// String couponNewUserCoupon = "PVP2018051717019";
|
|
|
+// String couponConsultTaskCoupon = "PVP2018051739929";
|
|
|
+// String couponDetectionTaskCoupon = "PVP2018051713733";
|
|
|
+// String couponRechargeTaskCoupon = "PVP2018051714111";
|
|
|
//分页
|
|
|
public Map<String, Object> getCoupons(int page, int limit) {
|
|
|
PageHelper.startPage(page, limit);
|
|
@@ -96,17 +105,17 @@ public class CouponService {
|
|
|
}
|
|
|
CustomerCoupon checkCustomer = new CustomerCoupon();
|
|
|
checkCustomer.setCm_phone(phone);
|
|
|
- checkCustomer.setCb_code("PVP2018051717019");
|
|
|
+ checkCustomer.setCb_code(couponNewUserCoupon);
|
|
|
if (customerCouponService.checkCustomerCoupon(checkCustomer) > 0) {
|
|
|
return 62;
|
|
|
}
|
|
|
- String cp_code = couponDao.getCoupon("PVP2018051717019");
|
|
|
+ String cp_code = couponDao.getCoupon(couponNewUserCoupon);
|
|
|
if (cp_code.equals(null)) {
|
|
|
return 98;
|
|
|
}
|
|
|
CustomerCoupon customerCoupon = new CustomerCoupon();
|
|
|
customerCoupon.setCm_phone(phone);
|
|
|
- customerCoupon.setCb_code("PVP2018051717019");
|
|
|
+ customerCoupon.setCb_code(couponNewUserCoupon);
|
|
|
customerCoupon.setCc_code(cp_code);
|
|
|
customerCoupon.setCp_status(2);
|
|
|
customerCoupon.setCc_getdate(sdf.format(new Date()));
|
|
@@ -119,7 +128,7 @@ public class CouponService {
|
|
|
couponLog.setCl_mp(phone);
|
|
|
couponLog.setCl_user(9527);
|
|
|
couponLog.setCl_date(sdf.format(new Date()));
|
|
|
- couponLog.setCb_code("PVP2018051717019");
|
|
|
+ couponLog.setCb_code(couponNewUserCoupon);
|
|
|
couponLogService.addCouponLog(couponLog);
|
|
|
} catch (Exception ex) {
|
|
|
ex.printStackTrace();
|
|
@@ -130,6 +139,7 @@ public class CouponService {
|
|
|
}
|
|
|
|
|
|
public int getConsultTaskCoupon(String phone, int channel) {//咨询任务
|
|
|
+
|
|
|
try {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
if (customerCouponService.checkSumCustomerCoupon(phone) > 500) {
|
|
@@ -140,7 +150,7 @@ public class CouponService {
|
|
|
}
|
|
|
CustomerCoupon checkCustomer = new CustomerCoupon();
|
|
|
checkCustomer.setCm_phone(phone);
|
|
|
- checkCustomer.setCb_code("PVP2018051739929");
|
|
|
+ checkCustomer.setCb_code(couponConsultTaskCoupon);
|
|
|
int coupons = customerCouponService.checkCustomerCoupon(checkCustomer);
|
|
|
Coupon getCouponAmount = new Coupon();
|
|
|
if (coupons >= 3) {
|
|
@@ -152,14 +162,14 @@ public class CouponService {
|
|
|
} else if (coupons == 0) {
|
|
|
getCouponAmount.setCp_amount(20);
|
|
|
}
|
|
|
- getCouponAmount.setCb_code("PVP2018051739929");
|
|
|
+ getCouponAmount.setCb_code(couponConsultTaskCoupon);
|
|
|
String cp_code = couponDao.getCouponAmount(getCouponAmount);
|
|
|
if (cp_code.equals(null)) {
|
|
|
return 98;
|
|
|
}
|
|
|
CustomerCoupon customerCoupon = new CustomerCoupon();
|
|
|
customerCoupon.setCm_phone(phone);
|
|
|
- customerCoupon.setCb_code("PVP2018051739929");
|
|
|
+ customerCoupon.setCb_code(couponConsultTaskCoupon);
|
|
|
customerCoupon.setCc_code(cp_code);
|
|
|
customerCoupon.setCp_status(2);
|
|
|
customerCoupon.setCc_getdate(sdf.format(new Date()));
|
|
@@ -172,7 +182,7 @@ public class CouponService {
|
|
|
couponLog.setCl_mp(phone);
|
|
|
couponLog.setCl_user(9527);
|
|
|
couponLog.setCl_date(sdf.format(new Date()));
|
|
|
- couponLog.setCb_code("PVP2018051739929");
|
|
|
+ couponLog.setCb_code(couponConsultTaskCoupon);
|
|
|
couponLogService.addCouponLog(couponLog);
|
|
|
} catch (Exception ex) {
|
|
|
ex.printStackTrace();
|
|
@@ -183,6 +193,7 @@ public class CouponService {
|
|
|
}
|
|
|
|
|
|
public int getDetectionTaskCoupon(String phone, int channel) {//测胎心任务
|
|
|
+
|
|
|
try {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
if (customerCouponService.checkSumCustomerCoupon(phone) > 500) {
|
|
@@ -193,7 +204,7 @@ public class CouponService {
|
|
|
}
|
|
|
CustomerCoupon checkCustomer = new CustomerCoupon();
|
|
|
checkCustomer.setCm_phone(phone);
|
|
|
- checkCustomer.setCb_code("PVP2018051713733");
|
|
|
+ checkCustomer.setCb_code(couponDetectionTaskCoupon);
|
|
|
int coupons = customerCouponService.checkCustomerCoupon(checkCustomer);
|
|
|
Coupon getCouponAmount = new Coupon();
|
|
|
if (coupons >= 3) {
|
|
@@ -204,14 +215,14 @@ public class CouponService {
|
|
|
} else if (coupons == 0) {
|
|
|
getCouponAmount.setCp_amount(20);
|
|
|
}
|
|
|
- getCouponAmount.setCb_code("PVP2018051713733");
|
|
|
+ getCouponAmount.setCb_code(couponDetectionTaskCoupon);
|
|
|
String cp_code = couponDao.getCouponAmount(getCouponAmount);
|
|
|
if (cp_code.equals(null)) {
|
|
|
return 98;
|
|
|
}
|
|
|
CustomerCoupon customerCoupon = new CustomerCoupon();
|
|
|
customerCoupon.setCm_phone(phone);
|
|
|
- customerCoupon.setCb_code("PVP2018051713733");
|
|
|
+ customerCoupon.setCb_code(couponDetectionTaskCoupon);
|
|
|
customerCoupon.setCc_code(cp_code);
|
|
|
customerCoupon.setCp_status(2);
|
|
|
customerCoupon.setCc_getdate(sdf.format(new Date()));
|
|
@@ -224,7 +235,7 @@ public class CouponService {
|
|
|
couponLog.setCl_mp(phone);
|
|
|
couponLog.setCl_user(9527);
|
|
|
couponLog.setCl_date(sdf.format(new Date()));
|
|
|
- couponLog.setCb_code("PVP2018051713733");
|
|
|
+ couponLog.setCb_code(couponDetectionTaskCoupon);
|
|
|
couponLogService.addCouponLog(couponLog);
|
|
|
} catch (Exception ex) {
|
|
|
ex.printStackTrace();
|
|
@@ -235,6 +246,7 @@ public class CouponService {
|
|
|
}
|
|
|
|
|
|
public int getRechargeTaskCoupon(String phone, int channel) {//充值任务
|
|
|
+
|
|
|
try {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
if (customerCouponService.checkSumCustomerCoupon(phone) > 500) {
|
|
@@ -245,17 +257,17 @@ public class CouponService {
|
|
|
}
|
|
|
CustomerCoupon checkCustomer = new CustomerCoupon();
|
|
|
checkCustomer.setCm_phone(phone);
|
|
|
- checkCustomer.setCb_code("PVP2018051714111");
|
|
|
+ checkCustomer.setCb_code(couponRechargeTaskCoupon);
|
|
|
if (customerCouponService.checkCustomerCoupon(checkCustomer) > 0) {
|
|
|
return 62;
|
|
|
}
|
|
|
- String cp_code = couponDao.getCoupon("PVP2018051714111");
|
|
|
+ String cp_code = couponDao.getCoupon(couponRechargeTaskCoupon);
|
|
|
if (cp_code.equals(null)) {
|
|
|
return 98;
|
|
|
}
|
|
|
CustomerCoupon customerCoupon = new CustomerCoupon();
|
|
|
customerCoupon.setCm_phone(phone);
|
|
|
- customerCoupon.setCb_code("PVP2018051714111");
|
|
|
+ customerCoupon.setCb_code(couponRechargeTaskCoupon);
|
|
|
customerCoupon.setCc_code(cp_code);
|
|
|
customerCoupon.setCp_status(2);
|
|
|
customerCoupon.setCc_getdate(sdf.format(new Date()));
|
|
@@ -268,7 +280,7 @@ public class CouponService {
|
|
|
couponLog.setCl_mp(phone);
|
|
|
couponLog.setCl_user(9527);
|
|
|
couponLog.setCl_date(sdf.format(new Date()));
|
|
|
- couponLog.setCb_code("PVP2018051714111");
|
|
|
+ couponLog.setCb_code(couponRechargeTaskCoupon);
|
|
|
couponLogService.addCouponLog(couponLog);
|
|
|
} catch (Exception ex) {
|
|
|
ex.printStackTrace();
|