You've already forked FrameTour-BE
Compare commits
2 Commits
29637bc5e5
...
6fb3cb93a9
Author | SHA1 | Date | |
---|---|---|---|
6fb3cb93a9 | |||
c1ca4e8631 |
@@ -76,6 +76,7 @@ public class TemplateEntity {
|
||||
|
||||
private Integer sort;
|
||||
private Integer cropEnable;
|
||||
private Integer zoomCut;
|
||||
private String onlyIf;
|
||||
private String resolution;
|
||||
private List<TemplateEntity> children;
|
||||
|
@@ -35,7 +35,21 @@ public class PriceCalculationServiceImpl implements IPriceCalculationService {
|
||||
if (request.getProducts() == null || request.getProducts().isEmpty()) {
|
||||
throw new PriceCalculationException("商品列表不能为空");
|
||||
}
|
||||
|
||||
|
||||
request.getProducts().forEach(product -> {
|
||||
if (product.getProductType() == null) {
|
||||
throw new PriceCalculationException("商品类型不能为空");
|
||||
}
|
||||
if (product.getProductId() == null) {
|
||||
throw new PriceCalculationException("商品ID不能为空");
|
||||
}
|
||||
if (product.getPurchaseCount() == null) {
|
||||
product.setPurchaseCount(1);
|
||||
}
|
||||
if (product.getQuantity() == null) {
|
||||
product.setQuantity(1);
|
||||
}
|
||||
});
|
||||
// 计算商品价格和原价
|
||||
PriceDetails priceDetails = calculateProductsPriceWithOriginal(request.getProducts());
|
||||
BigDecimal totalAmount = priceDetails.getTotalAmount();
|
||||
|
@@ -2,8 +2,8 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ycwl.basic.mapper.TemplateMapper">
|
||||
<insert id="add">
|
||||
insert into template(id, scenic_id, `name`, pid, is_placeholder, source_url, effects, luts, overlays, audios, cover_url, frame_rate, speed, price, slash_price, sort, crop_enable, only_if, resolution, create_time)
|
||||
values (#{id}, #{scenicId}, #{name}, #{pid}, #{isPlaceholder}, #{sourceUrl}, #{effects}, #{luts}, #{overlays}, #{audios}, #{coverUrl}, #{frameRate}, #{speed}, #{price}, #{slashPrice}, #{sort}, #{cropEnable}, #{onlyIf}, #{resolution}, now())
|
||||
insert into template(id, scenic_id, `name`, pid, is_placeholder, source_url, effects, luts, overlays, audios, cover_url, frame_rate, speed, price, slash_price, sort, crop_enable, zoom_cut, only_if, resolution, create_time)
|
||||
values (#{id}, #{scenicId}, #{name}, #{pid}, #{isPlaceholder}, #{sourceUrl}, #{effects}, #{luts}, #{overlays}, #{audios}, #{coverUrl}, #{frameRate}, #{speed}, #{price}, #{slashPrice}, #{sort}, #{cropEnable}, #{zoomCut}, #{onlyIf}, #{resolution}, now())
|
||||
</insert>
|
||||
<insert id="addConfig">
|
||||
insert into template_config(id, template_id, create_time)
|
||||
@@ -29,6 +29,7 @@
|
||||
<if test="speed!= null">speed = #{speed}, </if>
|
||||
<if test="sort!= null">sort = #{sort}, </if>
|
||||
<if test="cropEnable!= null">crop_enable = #{cropEnable}, </if>
|
||||
<if test="zoomCut!= null">zoom_cut = #{zoomCut}, </if>
|
||||
<if test="onlyIf!= null">only_if = #{onlyIf}, </if>
|
||||
<if test="resolution!= null">resolution = #{resolution}, </if>
|
||||
</set>
|
||||
|
Reference in New Issue
Block a user