update:
1. fix for new design
This commit is contained in:
@@ -9,8 +9,6 @@ public class RefillApiRequest implements Serializable {
|
|||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
private String phone;
|
private String content;
|
||||||
|
|
||||||
private String email;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -199,6 +199,7 @@ public class KioskServiceImpl implements IKioskApiService {
|
|||||||
throw new ServiceException("Invalid price.");
|
throw new ServiceException("Invalid price.");
|
||||||
}
|
}
|
||||||
detailAmount = detailAmount.add(priceList.getActualPrice());
|
detailAmount = detailAmount.add(priceList.getActualPrice());
|
||||||
|
orderDetail.setPriceListId(item.getPriceList());
|
||||||
orderDetail.setQuantity(item.getQuantity());
|
orderDetail.setQuantity(item.getQuantity());
|
||||||
orderDetail.setTag(priceList.getTag());
|
orderDetail.setTag(priceList.getTag());
|
||||||
|
|
||||||
@@ -416,9 +417,7 @@ public class KioskServiceImpl implements IKioskApiService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean refillOrder(RefillApiRequest request) {
|
public boolean refillOrder(RefillApiRequest request) {
|
||||||
if (StringUtil.isBlank(request.getEmail()) && StringUtil.isBlank(request.getPhone())) {
|
|
||||||
throw new ServiceException("Invalid parameters.");
|
|
||||||
}
|
|
||||||
OrderEntity order = orderService.getById(request.getId());
|
OrderEntity order = orderService.getById(request.getId());
|
||||||
if (order == null) {
|
if (order == null) {
|
||||||
throw new ServiceException("Invalid order.");
|
throw new ServiceException("Invalid order.");
|
||||||
@@ -426,14 +425,14 @@ public class KioskServiceImpl implements IKioskApiService {
|
|||||||
if (order.getStatus() != 1) {
|
if (order.getStatus() != 1) {
|
||||||
throw new ServiceException("Invalid order status.");
|
throw new ServiceException("Invalid order status.");
|
||||||
}
|
}
|
||||||
if (StringUtil.isNotBlank(request.getEmail()) && StringUtil.isNotBlank(order.getUserEmail())) {
|
|
||||||
throw new ServiceException("Email already exists.");
|
boolean match = RegexUtil.match(request.getContent(), RegexUtil.EMAIL);
|
||||||
}
|
if (StringUtil.isBlank(request.getContent())) {
|
||||||
boolean match = RegexUtil.match(request.getEmail(), RegexUtil.EMAIL);
|
|
||||||
if (match) {
|
if (match) {
|
||||||
order.setUserEmail(request.getEmail());
|
order.setUserEmail(request.getContent());
|
||||||
} else {
|
} else if (request.getContent().chars().allMatch(Character::isDigit)) {
|
||||||
order.setUserPhone(request.getPhone());
|
order.setUserPhone(request.getContent());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (StringUtil.isNotBlank(request.getEmail())) {
|
// if (StringUtil.isNotBlank(request.getEmail())) {
|
||||||
|
|||||||
Reference in New Issue
Block a user