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