diff --git a/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/controller/app/ShoppingController.java b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/controller/app/ShoppingController.java index 7dbea506..e44b9d2a 100644 --- a/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/controller/app/ShoppingController.java +++ b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/controller/app/ShoppingController.java @@ -523,23 +523,19 @@ public class ShoppingController extends ControllerBase { */ @Transactional @PostMapping("/quotation/generate") - public ApiResult generateQuotation(@RequestBody @NotEmpty List cartIds) { + public ApiResult generateQuotation(@Valid @RequestBody QuotationGenerateRequest request) { List carts = shoppingCartService.lambdaQuery() .eq(QuotationShoppingCart::getStatus, 0) .eq(QuotationShoppingCart::getCreateByType, AppUserUtil.isAgent() ? 1 : 0) .eq(QuotationShoppingCart::getCreateById, AppUserUtil.getUserId()) - .in(QuotationShoppingCart::getId, cartIds) + .in(QuotationShoppingCart::getId, request.getCartIds()) .list(); VUtils.trueThrowBusinessError(CollectionUtil.isEmpty(carts)).throwMessage("未找到购物车信息"); - VUtils.trueThrowBusinessError(cartIds.size() != carts.size()).throwMessage("数据无效"); + VUtils.trueThrowBusinessError(request.getCartIds().size() != carts.size()).throwMessage("数据无效"); VUtils.trueThrowBusinessError(carts.stream().map(QuotationShoppingCart::getCustomerName).collect(Collectors.toSet()).size() > 1) .throwMessage("客户名称不一致"); VUtils.trueThrowBusinessError(carts.stream().map(QuotationShoppingCart::getTargetId).collect(Collectors.toSet()).size() > 1) .throwMessage("报价主体不一致"); - VUtils.trueThrowBusinessError(carts.stream().map(QuotationShoppingCart::getCurrency).collect(Collectors.toSet()).size() > 1) - .throwMessage("币种不一致"); - VUtils.trueThrowBusinessError(carts.stream().map(QuotationShoppingCart::getExchangeRate).collect(Collectors.toSet()).size() > 1) - .throwMessage("汇率不一致"); QuotationShoppingOrder order = new QuotationShoppingOrder() .setCreateByType(AppUserUtil.isAgent() ? 1 : 0) .setCreateBy(AppUserUtil.getUserName()) @@ -553,7 +549,7 @@ public class ShoppingController extends ControllerBase { .setTargetId(carts.get(0).getTargetId()) .setTotalFee(carts.stream().map(QuotationShoppingCart::getActualFee).reduce(BigDecimal::add).get()); order.setActualFee(order.getTotalFee()); - order.setExchangeFee(NumberUtil.multiply(order.getActualFee(), carts.get(0).getExchangeRate())); + order.setExchangeFee(NumberUtil.multiply(order.getActualFee(), request.getExchangeRate())); shoppingOrderItemService.saveBatch( carts.stream() .map(cart -> new QuotationShoppingOrderItem() @@ -566,7 +562,7 @@ public class ShoppingController extends ControllerBase { shoppingCartService.lambdaUpdate() .set(QuotationShoppingCart::getStatus, 1) .eq(QuotationShoppingCart::getStatus, 0) - .in(QuotationShoppingCart::getId, cartIds) + .in(QuotationShoppingCart::getId, request.getCartIds()) .update(); return ApiResult.success(order.getId()); } diff --git a/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/pojo/request/QuotationGenerateRequest.java b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/pojo/request/QuotationGenerateRequest.java new file mode 100644 index 00000000..e52059c1 --- /dev/null +++ b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/pojo/request/QuotationGenerateRequest.java @@ -0,0 +1,60 @@ +package com.nflg.mobilebroken.quotation.pojo.request; + +import lombok.Data; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.math.BigDecimal; +import java.util.List; + +@Data +public class QuotationGenerateRequest { + + /** + * 购物车id列表 + */ + @NotEmpty + private List cartIds; + + /** + * 交货方式列表 + */ + @Valid + @NotEmpty + private List deliveryMethods; + + /** + * 付款方式 + */ + @NotBlank(message = "付款方式不能为空") + private String paymentMethod; + + /** + * 付款方式产生的费用 + */ + @NotBlank(message = "付款方式产生的费用不能为空") + private BigDecimal paymentFee; + + /** + * 币种,字典id + */ + @NotBlank(message = "币种不能为空") + private Long currency; + + /** + * 汇率 + */ + @NotBlank(message = "汇率不能为空") + private BigDecimal exchangeRate; + + /** + * 补充说明 + */ + private String additionalNotes; + + /** + * 备注 + */ + private String remark; +} diff --git a/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/pojo/request/QuotationShoppingOrderDeliveryMethodRequest.java b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/pojo/request/QuotationShoppingOrderDeliveryMethodRequest.java new file mode 100644 index 00000000..6c63f27f --- /dev/null +++ b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/pojo/request/QuotationShoppingOrderDeliveryMethodRequest.java @@ -0,0 +1,35 @@ +package com.nflg.mobilebroken.quotation.pojo.request; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; + +@Data +public class QuotationShoppingOrderDeliveryMethodRequest { + + /** + * 交货方式,字典id + */ + @NotNull(message = "交货方式不能为空") + private Long deliveryMethod; + + /** + * 交货时间 + */ + @NotBlank(message = "交货时间不能为空") + private String deliveryDate; + + /** + * 交货地点 + */ + @NotBlank(message = "交货地点不能为空") + private String deliveryAddress; + + /** + * 运费 + */ + @NotNull(message = "运费不能为空") + private BigDecimal deliveryFee; +} diff --git a/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/pojo/request/ShoppingSaveRequest.java b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/pojo/request/ShoppingSaveRequest.java index e2dd73cb..d5f9ef88 100644 --- a/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/pojo/request/ShoppingSaveRequest.java +++ b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/pojo/request/ShoppingSaveRequest.java @@ -19,19 +19,19 @@ public class ShoppingSaveRequest { /** * 机型batch_number */ - @NotNull + @NotNull(message = "机型不能为空") private Long modelId; /** * 价格id */ - @NotNull + @NotNull(message = "价格id不能为空") private Long priceId; /** * 配置id */ - @NotNull + @NotNull(message = "配置id不能为空") private Long configId; /** @@ -52,52 +52,43 @@ public class ShoppingSaveRequest { /** * 客户名称 */ - @NotBlank + @NotBlank(message = "客户名称不能为空") private String customerName; /** * 报价主体,代理商时为公司id,内部用户时为其用户id */ - @NotNull + @NotNull(message = "报价主体不能为空") private Integer targetId; /** - * 油漆要求 + * 其他要求总费用 */ - private String paintRequirements; - - /** - * 其他要求 - */ - private String otherRequirements; - - /** - * 其他要求费用 - */ - private BigDecimal otherFee; + @NotNull(message = "其他要求总费用不能为空") + private BigDecimal otherRequirementsFee; /** * 标配价格 */ - @NotNull + @NotNull(message = "标配价格不能为空") private BigDecimal standardFee; /** * 选配价格 */ - @NotNull + @NotNull(message = "选配价格不能为空") private BigDecimal optionalFee; /** * 总价 */ - @NotNull + @NotNull(message = "总价不能为空") private BigDecimal totalFee; /** * 实际总价 */ - @NotNull + @NotNull(message = "实际总价不能为空") private BigDecimal actualFee; /** @@ -110,57 +101,35 @@ public class ShoppingSaveRequest { */ private BigDecimal serviceFee = BigDecimal.ZERO; - /** - * 交货方式,字典id - */ - @NotNull - private Long deliveryMethod; - - /** - * 交货时间 - */ - @NotBlank - private String deliveryDate; - - /** - * 交货地点 - */ - @NotBlank - private String deliveryAddress; - - /** - * 运费 - */ - @NotNull - private BigDecimal deliveryFee; - - /** - * 付款方式 - */ - @NotBlank - private String paymentMethod; - - /** - * 付款方式产生的费用 - */ - private BigDecimal paymentFee; - - /** - * 币种,字典id - */ - @NotNull - private Long currency; - - /** - * 汇率 - */ - private BigDecimal exchangeRate; - /** * 优惠金额 */ private BigDecimal discount; + /** + * 质保服务描述 + */ + @NotBlank(message = "质保服务描述不能为空") + private String warrantyServiceDesc; + + /** + * 质保服务费用 + */ + @NotNull(message = "质保服务费用不能为空") + private BigDecimal warrantyServiceFee; + + /** + * 随机配件包装费 + */ + @NotNull(message = "随机配件包装费不能为空") + private BigDecimal accessoryPackagingFee; + + /** + * 随机配件运费 + */ + @NotNull(message = "随机配件运费不能为空") + private BigDecimal accessoryShippingFee; + /** * 部件列表 */ diff --git a/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/pojo/request/ShoppingSaveServiceRequest.java b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/pojo/request/ShoppingSaveServiceRequest.java index ee800f36..29d4b652 100644 --- a/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/pojo/request/ShoppingSaveServiceRequest.java +++ b/nflg-mobilebroken-quotation/src/main/java/com/nflg/mobilebroken/quotation/pojo/request/ShoppingSaveServiceRequest.java @@ -31,4 +31,14 @@ public class ShoppingSaveServiceRequest { */ @NotNull private BigDecimal totalFee; + + /** + * 地点 + */ + private String address; + + /** + * 备注 + */ + private String remark; } diff --git a/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/QuotationShoppingCart.java b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/QuotationShoppingCart.java index 2e35b775..1d79932d 100644 --- a/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/QuotationShoppingCart.java +++ b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/QuotationShoppingCart.java @@ -67,19 +67,9 @@ public class QuotationShoppingCart implements Serializable { private Integer targetId; /** - * 油漆要求 + * 其他要求总费用 */ - private String paintRequirements; - - /** - * 其他要求 - */ - private String otherRequirements; - - /** - * 其他要求费用 - */ - private BigDecimal otherFee; + private BigDecimal otherRequirementsFee; /** * 标配价格 @@ -111,46 +101,6 @@ public class QuotationShoppingCart implements Serializable { */ private BigDecimal serviceFee; - /** - * 交货方式,字典id - */ - private Long deliveryMethod; - - /** - * 交货时间 - */ - private String deliveryDate; - - /** - * 交货地点 - */ - private String deliveryAddress; - - /** - * 运费 - */ - private BigDecimal deliveryFee; - - /** - * 付款方式 - */ - private String paymentMethod; - - /** - * 付款方式产生的费用 - */ - private BigDecimal paymentFee; - - /** - * 币种,字典id - */ - private Long currency; - - /** - * 汇率 - */ - private BigDecimal exchangeRate; - /** * 创建人类型,0:内部人员;1:代理商 */ @@ -185,4 +135,24 @@ public class QuotationShoppingCart implements Serializable { * 状态,0:未生成报价单;1:已生成报价单; */ private Integer status; + + /** + * 质保服务描述 + */ + private String warrantyServiceDesc; + + /** + * 质保服务费用 + */ + private BigDecimal warrantyServiceFee; + + /** + * 随机配件包装费 + */ + private BigDecimal accessoryPackagingFee; + + /** + * 随机配件运费 + */ + private BigDecimal accessoryShippingFee; } diff --git a/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/QuotationShoppingCartService.java b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/QuotationShoppingCartService.java index 40d53059..3a39fab6 100644 --- a/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/QuotationShoppingCartService.java +++ b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/QuotationShoppingCartService.java @@ -54,4 +54,14 @@ public class QuotationShoppingCartService implements Serializable { * 服务总费用 */ private BigDecimal totalFee; + + /** + * 地点 + */ + private String address; + + /** + * 备注 + */ + private String remark; } diff --git a/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/QuotationShoppingOrder.java b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/QuotationShoppingOrder.java index 0cb9df34..2d69373c 100644 --- a/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/QuotationShoppingOrder.java +++ b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/QuotationShoppingOrder.java @@ -105,4 +105,34 @@ public class QuotationShoppingOrder implements Serializable { * 最后修改时间 */ private LocalDateTime updateTime; + + /** + * 付款方式 + */ + private String paymentMethod; + + /** + * 付款方式产生的费用 + */ + private BigDecimal paymentFee; + + /** + * 币种,字典id + */ + private Long currency; + + /** + * 汇率 + */ + private BigDecimal exchangeRate; + + /** + * 补充说明 + */ + private String additionalNotes; + + /** + * 备注 + */ + private String remark; } diff --git a/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/QuotationShoppingOrderDeliveryMethod.java b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/QuotationShoppingOrderDeliveryMethod.java new file mode 100644 index 00000000..304cba55 --- /dev/null +++ b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/entity/QuotationShoppingOrderDeliveryMethod.java @@ -0,0 +1,54 @@ +package com.nflg.mobilebroken.repository.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + *

+ * 报价-报价单-交货方式 + *

+ * + * @author 代码生成器生成 + * @since 2026 + */ +@Getter +@Setter +@Accessors(chain = true) +@TableName("quotation_shopping_order_delivery_method") +public class QuotationShoppingOrderDeliveryMethod implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long id; + + /** + * 报价单id + */ + private Long orderId; + + /** + * 交货方式,字典id + */ + private Long deliveryMethod; + + /** + * 交货时间 + */ + private String deliveryDate; + + /** + * 交货地点 + */ + private String deliveryAddress; + + /** + * 运费 + */ + private BigDecimal deliveryFee; +} diff --git a/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/mapper/QuotationShoppingOrderDeliveryMethodMapper.java b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/mapper/QuotationShoppingOrderDeliveryMethodMapper.java new file mode 100644 index 00000000..961d7364 --- /dev/null +++ b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/mapper/QuotationShoppingOrderDeliveryMethodMapper.java @@ -0,0 +1,16 @@ +package com.nflg.mobilebroken.repository.mapper; + +import com.nflg.mobilebroken.repository.entity.QuotationShoppingOrderDeliveryMethod; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 报价-报价单-交货方式 Mapper 接口 + *

+ * + * @author 代码生成器生成 + * @since 2026 + */ +public interface QuotationShoppingOrderDeliveryMethodMapper extends BaseMapper { + +} diff --git a/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/service/IQuotationShoppingOrderDeliveryMethodService.java b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/service/IQuotationShoppingOrderDeliveryMethodService.java new file mode 100644 index 00000000..89068f0a --- /dev/null +++ b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/service/IQuotationShoppingOrderDeliveryMethodService.java @@ -0,0 +1,16 @@ +package com.nflg.mobilebroken.repository.service; + +import com.nflg.mobilebroken.repository.entity.QuotationShoppingOrderDeliveryMethod; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 报价-报价单-交货方式 服务类 + *

+ * + * @author 代码生成器生成 + * @since 2026 + */ +public interface IQuotationShoppingOrderDeliveryMethodService extends IService { + +} diff --git a/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/service/impl/QuotationShoppingOrderDeliveryMethodServiceImpl.java b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/service/impl/QuotationShoppingOrderDeliveryMethodServiceImpl.java new file mode 100644 index 00000000..03cd98a7 --- /dev/null +++ b/nflg-mobilebroken-repository/src/main/java/com/nflg/mobilebroken/repository/service/impl/QuotationShoppingOrderDeliveryMethodServiceImpl.java @@ -0,0 +1,20 @@ +package com.nflg.mobilebroken.repository.service.impl; + +import com.nflg.mobilebroken.repository.entity.QuotationShoppingOrderDeliveryMethod; +import com.nflg.mobilebroken.repository.mapper.QuotationShoppingOrderDeliveryMethodMapper; +import com.nflg.mobilebroken.repository.service.IQuotationShoppingOrderDeliveryMethodService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 报价-报价单-交货方式 服务实现类 + *

+ * + * @author 代码生成器生成 + * @since 2026 + */ +@Service +public class QuotationShoppingOrderDeliveryMethodServiceImpl extends ServiceImpl implements IQuotationShoppingOrderDeliveryMethodService { + +}