新建预约必填与默认值调整:款式名称必填加星标,价格空值默认0、时长空值默认60,移除名称为空回退客户姓名/散客款式,非必填标签统一(选填)
自动发布开发环境 Nacos 配置 / publish (push) Successful in 26s
自动发布开发环境 Nacos 配置 / publish (push) Successful in 26s
This commit is contained in:
+2
-5
@@ -809,14 +809,11 @@ public class PlanningServiceImpl implements PlanningService {
|
||||
String title = trimToNull(dto.getManualProductTitle());
|
||||
String imageFileIds = trimToNull(dto.getManualProductImageFileIds());
|
||||
if (!hasText(title)) {
|
||||
title = firstNonBlank(dto.getCustomerName(), hasText(imageFileIds) ? "散客款式" : null);
|
||||
}
|
||||
if (!hasText(title) && !hasText(imageFileIds)) {
|
||||
throw new RuntimeException("请填写美甲款式名称或上传款式图片");
|
||||
throw new RuntimeException("请填写美甲款式名称");
|
||||
}
|
||||
BigDecimal price = dto.getManualProductPrice() == null ? dto.getAmount() : dto.getManualProductPrice();
|
||||
if (price == null) {
|
||||
throw new RuntimeException("成交金额不能为空");
|
||||
price = BigDecimal.ZERO;
|
||||
}
|
||||
if (price.compareTo(BigDecimal.ZERO) < 0) {
|
||||
throw new RuntimeException("成交金额不能小于0");
|
||||
|
||||
+3
-2
@@ -451,7 +451,7 @@ class PlanningServiceImplTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void createsWalkInAppointmentWithoutCustomerUsingWalkInStyleTitle() {
|
||||
void createsWalkInAppointmentWithManualStyleTitle() {
|
||||
service = spy(service);
|
||||
UserDO operator = new UserDO();
|
||||
operator.setType(2);
|
||||
@@ -481,6 +481,7 @@ class PlanningServiceImplTest {
|
||||
|
||||
PlanningAppointmentCreateDTO dto = new PlanningAppointmentCreateDTO();
|
||||
dto.setCreateCustomerRecord(false);
|
||||
dto.setManualProductTitle("手绘款");
|
||||
dto.setManualProductImageFileIds("file-43");
|
||||
dto.setAmount(java.math.BigDecimal.valueOf(88));
|
||||
dto.setAppointmentDate(java.time.LocalDate.now().plusDays(2).toString());
|
||||
@@ -491,7 +492,7 @@ class PlanningServiceImplTest {
|
||||
|
||||
ArgumentCaptor<ProductDO> productCaptor = ArgumentCaptor.forClass(ProductDO.class);
|
||||
verify(productMapper).insert(productCaptor.capture());
|
||||
assertEquals("散客款式", productCaptor.getValue().getTitle());
|
||||
assertEquals("手绘款", productCaptor.getValue().getTitle());
|
||||
|
||||
ArgumentCaptor<OrderDO> orderCaptor = ArgumentCaptor.forClass(OrderDO.class);
|
||||
verify(orderMapper).insert(orderCaptor.capture());
|
||||
|
||||
Reference in New Issue
Block a user