|
@@ -210,7 +210,7 @@ public class TPromoCodeController {
|
|
promoCode.setCode(Long.parseLong(code));
|
|
promoCode.setCode(Long.parseLong(code));
|
|
promoCode.setAdminId(adminId);
|
|
promoCode.setAdminId(adminId);
|
|
promoCode.setIsUse("0");
|
|
promoCode.setIsUse("0");
|
|
- promoCode.setDiscount(0f);
|
|
|
|
|
|
+ promoCode.setDiscount(new BigDecimal(0));
|
|
promoCode.setLastUseDate(lastUseDate);
|
|
promoCode.setLastUseDate(lastUseDate);
|
|
promoCode.setType("0");
|
|
promoCode.setType("0");
|
|
promoCode.setUserName(admin.getUsername());
|
|
promoCode.setUserName(admin.getUsername());
|
|
@@ -244,7 +244,7 @@ public class TPromoCodeController {
|
|
if (price > 100) {
|
|
if (price > 100) {
|
|
return R.fail(A0001);
|
|
return R.fail(A0001);
|
|
}
|
|
}
|
|
- promoCode.setDiscount(Float.valueOf(price));
|
|
|
|
|
|
+ promoCode.setDiscount(new BigDecimal(price));
|
|
promoCode.setType("2");
|
|
promoCode.setType("2");
|
|
Long data = Calendar.getInstance().getTimeInMillis();
|
|
Long data = Calendar.getInstance().getTimeInMillis();
|
|
Long t = 3l;
|
|
Long t = 3l;
|
|
@@ -326,7 +326,7 @@ public class TPromoCodeController {
|
|
@ApiOperation(value = "添加优惠码")
|
|
@ApiOperation(value = "添加优惠码")
|
|
@GetMapping("/add")
|
|
@GetMapping("/add")
|
|
public ResponseModel<?> add(String addMode, String codeNum,
|
|
public ResponseModel<?> add(String addMode, String codeNum,
|
|
- Long adminId, int number, Float discount,
|
|
|
|
|
|
+ Long adminId, int number, BigDecimal discount,
|
|
Float month, String type, String frpCode) {
|
|
Float month, String type, String frpCode) {
|
|
if (discount == null || month == null || adminId == null || StringUtils.isEmpty(type)) {
|
|
if (discount == null || month == null || adminId == null || StringUtils.isEmpty(type)) {
|
|
return R.fail(A0001);
|
|
return R.fail(A0001);
|
|
@@ -403,7 +403,7 @@ public class TPromoCodeController {
|
|
return R.fail("没有机器");
|
|
return R.fail("没有机器");
|
|
}
|
|
}
|
|
//0折优惠码需要支付
|
|
//0折优惠码需要支付
|
|
- if (type.equals("0") && discount == 0) {
|
|
|
|
|
|
+ if (type.equals("0") && discount.equals(0)) {
|
|
if (admin.getPromoCodeOpen() == null || admin.getPromoCodeOpen().equals("1")) {
|
|
if (admin.getPromoCodeOpen() == null || admin.getPromoCodeOpen().equals("1")) {
|
|
Long equipmentId = equipment.getId();
|
|
Long equipmentId = equipment.getId();
|
|
Double money = null;
|
|
Double money = null;
|
|
@@ -812,7 +812,7 @@ public class TPromoCodeController {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
TPromoCode promoCode = list.get(0);
|
|
TPromoCode promoCode = list.get(0);
|
|
- Float discount = promoCode.getDiscount();
|
|
|
|
|
|
+ BigDecimal discount = promoCode.getDiscount();
|
|
String type = promoCode.getType();
|
|
String type = promoCode.getType();
|
|
JSONObject kindData = new JSONObject();
|
|
JSONObject kindData = new JSONObject();
|
|
kindData.put("type", type.equals("1") ? type : "0");
|
|
kindData.put("type", type.equals("1") ? type : "0");
|