|
@@ -17,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.math.BigInteger;
|
|
|
import java.sql.Timestamp;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
@@ -1456,6 +1457,25 @@ public class PayOrderController {
|
|
|
String isCardFlag = coupon.getIsCardFlag();
|
|
|
String isGradeFlag = coupon.getIsGradeFlag();
|
|
|
PayOrder p = new PayOrder();
|
|
|
+
|
|
|
+ String couponType = coupon.getCouponType(); //优惠劵类型 1现金劵,2折扣券,3兑换券
|
|
|
+ switch (couponType){
|
|
|
+ case "1":
|
|
|
+ //现金券
|
|
|
+ p.setAmt(new BigDecimal(payOrder.getReceivableAmt().toString()).subtract(coupon.getCouponAmt()).doubleValue());
|
|
|
+ //是否与营销方案叠加
|
|
|
+ if(isMarketFlag.equals("1"))
|
|
|
+ p.setAmt(new BigDecimal(new BigInteger(payOrder.getAmt().toString())).subtract(coupon.getCouponAmt()).doubleValue());
|
|
|
+
|
|
|
+ break;
|
|
|
+ case "2":
|
|
|
+ //折扣券
|
|
|
+ if(isMarketFlag.equals("1"))
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ //
|
|
|
resultData = ResultData.success(payOrder);
|
|
|
|
|
|
}else {
|