修改冰箱贴价格
This commit is contained in:
@@ -7410,24 +7410,17 @@ public class ProductService {
|
|||||||
return priceList;
|
return priceList;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Product> getfridgePrice(Product dto, Double width, Double length, String role) {
|
private double getOtherFridgePrice(double width, double length, Product dto, double min_price, List<String> carft_list) {
|
||||||
List<String> carft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
double price;
|
||||||
List<Product> priceList = new ArrayList<>();
|
|
||||||
String cailiao = dto.getCailiao();
|
String cailiao = dto.getCailiao();
|
||||||
double price = 0;
|
|
||||||
double min_price = 50;
|
|
||||||
int count = dto.getCount();
|
|
||||||
int number = dto.getNumber();
|
|
||||||
double last_price = 1000;
|
double last_price = 1000;
|
||||||
double area = width * length * dto.getCount() / 10000 * dto.getNumber();
|
double area = width * length * dto.getCount() / 10000 * dto.getNumber();
|
||||||
String weight = "";
|
|
||||||
if ("冰箱贴".equals(dto.getKindValue())) {
|
|
||||||
if (width * length / 10000 < 0.001) {
|
if (width * length / 10000 < 0.001) {
|
||||||
double basePrice = 1;
|
double basePrice = 1;
|
||||||
if ("4.2".equals(cailiao)) {
|
if ("4.2".equals(cailiao)) {
|
||||||
basePrice = 1.5;
|
basePrice = 1.5;
|
||||||
}
|
}
|
||||||
price = Math.max(basePrice * count * dto.getNumber() + 8 * dto.getNumber(), min_price);
|
price = Math.max(basePrice * dto.getCount() * dto.getNumber() + 8 * dto.getNumber(), min_price);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
double[] areas = {0, 0.1, 0.15, 0.2, 0.3, 0.4, 0.5, 1, 2, 3, 5, 7, 9, 10, 20, 50};
|
double[] areas = {0, 0.1, 0.15, 0.2, 0.3, 0.4, 0.5, 1, 2, 3, 5, 7, 9, 10, 20, 50};
|
||||||
@@ -7445,12 +7438,34 @@ public class ProductService {
|
|||||||
last_price = 1100;
|
last_price = 1100;
|
||||||
}
|
}
|
||||||
price = PriceUtils.TableUnitPrice(area, prices, areas, last_price);
|
price = PriceUtils.TableUnitPrice(area, prices, areas, last_price);
|
||||||
if (carft_list.contains("激光") && carft_list.contains("滴胶")) {
|
|
||||||
price = price * 1.3;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
price = Math.max(price, min_price) + ((dto.getNumber() - 1) * 8);
|
price = Math.max(price, min_price) + ((dto.getNumber() - 1) * 8);
|
||||||
|
return price;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Product> getfridgePrice(Product dto, Double width, Double length, String role) {
|
||||||
|
List<String> carft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
||||||
|
List<Product> priceList = new ArrayList<>();
|
||||||
|
String cailiao = dto.getCailiao();
|
||||||
|
double price = 0;
|
||||||
|
double min_price = 50;
|
||||||
|
int count = dto.getCount();
|
||||||
|
int number = dto.getNumber();
|
||||||
|
double last_price = 1000;
|
||||||
|
double area = width * length * dto.getCount() / 10000 * dto.getNumber();
|
||||||
|
String weight = "";
|
||||||
|
if ("冰箱贴".equals(dto.getKindValue())) {
|
||||||
|
price = getOtherFridgePrice(width, length, dto, min_price, carft_list);
|
||||||
|
if (carft_list.contains("激光") && carft_list.contains("滴胶")) {
|
||||||
|
price = price * 1.3;
|
||||||
|
}
|
||||||
|
if (carft_list.contains("二层旋转")) {
|
||||||
|
price += getOtherFridgePrice(dto.getLengthSize(), dto.getWidthSize(), dto, 0, carft_list);
|
||||||
|
}
|
||||||
|
if (carft_list.contains("三层旋转")) {
|
||||||
|
price += getOtherFridgePrice(dto.getLengthTang(), dto.getWidthTang(), dto, 0, carft_list);
|
||||||
|
}
|
||||||
weight = df.format(width * length * 4.17 * dto.getCount() * 0.1 * number / 1000 * Double.parseDouble(cailiao));
|
weight = df.format(width * length * 4.17 * dto.getCount() * 0.1 * number / 1000 * Double.parseDouble(cailiao));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9641,7 +9656,7 @@ public class ProductService {
|
|||||||
prices = new double[]{200, 280, 380, 688, 1000, 1620, 2420};
|
prices = new double[]{200, 280, 380, 688, 1000, 1620, 2420};
|
||||||
} else if (num == 3) {
|
} else if (num == 3) {
|
||||||
prices = new double[]{272, 376, 500, 912, 1320, 2140, 3100};
|
prices = new double[]{272, 376, 500, 912, 1320, 2140, 3100};
|
||||||
} else if (num == 5) {
|
} else if (num == 5 || num == 4) {
|
||||||
prices = new double[]{380, 520, 696, 1260, 1832, 2740, 4100};
|
prices = new double[]{380, 520, 696, 1260, 1832, 2740, 4100};
|
||||||
} else if (num == 6) {
|
} else if (num == 6) {
|
||||||
prices = new double[]{480, 640, 880, 1520, 2040, 3200, 4800};
|
prices = new double[]{480, 640, 880, 1520, 2040, 3200, 4800};
|
||||||
|
|||||||
@@ -55,6 +55,6 @@
|
|||||||
select roleId from tbl_sys_user_role where userId = #{userId}
|
select roleId from tbl_sys_user_role where userId = #{userId}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
ORDER BY orderNo ASC,parentId ASC;
|
ORDER BY orderNo ASC,parentId ASC,perId ASC;
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -104,6 +104,19 @@
|
|||||||
<input type="checkbox" name="craft" lay-filter="ui_craft" value="打孔" title="打孔">
|
<input type="checkbox" name="craft" lay-filter="ui_craft" value="打孔" title="打孔">
|
||||||
<input type="checkbox" name="craft" lay-filter="ui_craft" value="带透明边" title="带透明边">
|
<input type="checkbox" name="craft" lay-filter="ui_craft" value="带透明边" title="带透明边">
|
||||||
</div>
|
</div>
|
||||||
|
<div class="layui-input-block rotation">
|
||||||
|
旋转工艺:
|
||||||
|
<input type="checkbox" name="craft" lay-filter="ui_craft" value="二层旋转" title="二层旋转">
|
||||||
|
<span class="layui-inline tow" style="width: 140px;display: none">
|
||||||
|
<input name="lengthSize" placeholder="长边(CM)" type="text" class="layui-input" style="width: 50px;display: inline" disabled/>x
|
||||||
|
<input name="widthSize" placeholder="短边(CM)" type="text" class="layui-input" style="width: 50px;display: inline" disabled/>CM
|
||||||
|
</span>
|
||||||
|
<input type="checkbox" name="craft" lay-filter="ui_craft" value="三层旋转" title="三层旋转">
|
||||||
|
<span class="layui-inline three" style="width: 140px;display: none">
|
||||||
|
<input name="lengthTang" placeholder="长边(CM)" type="text" class="layui-input" style="width: 50px;display: inline" disabled/>x
|
||||||
|
<input name="widthTang" placeholder="短边(CM)" type="text" class="layui-input" style="width: 50px;display: inline" disabled/>CM
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
<div style="font-size: 14px; color: red">现货背卡尺寸:115*95mm</div>
|
<div style="font-size: 14px; color: red">现货背卡尺寸:115*95mm</div>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
背纸工艺:
|
背纸工艺:
|
||||||
@@ -138,7 +151,6 @@
|
|||||||
<input type="checkbox" name="craft" lay-filter="ui_craft" value="背卡异形模切" title="异形模切" disabled>
|
<input type="checkbox" name="craft" lay-filter="ui_craft" value="背卡异形模切" title="异形模切" disabled>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-input-block xhbeika" style="display: none">
|
<div class="layui-input-block xhbeika" style="display: none">
|
||||||
|
|
||||||
背纸颜色:
|
背纸颜色:
|
||||||
<input type="checkbox" name="craft" lay-filter="ui_craft" value="红色款" title="红色款" checked disabled>
|
<input type="checkbox" name="craft" lay-filter="ui_craft" value="红色款" title="红色款" checked disabled>
|
||||||
<input type="checkbox" name="craft" lay-filter="ui_craft" value="黄色款" title="黄色款" disabled>
|
<input type="checkbox" name="craft" lay-filter="ui_craft" value="黄色款" title="黄色款" disabled>
|
||||||
@@ -197,6 +209,9 @@
|
|||||||
|
|
||||||
// 清空轮播图
|
// 清空轮播图
|
||||||
function getImages() {
|
function getImages() {
|
||||||
|
html = " ";
|
||||||
|
remark = " ";
|
||||||
|
ins = carousel.render({});
|
||||||
$("#carousel").empty();
|
$("#carousel").empty();
|
||||||
$("#remark").empty();
|
$("#remark").empty();
|
||||||
$(".ui_feb").show();
|
$(".ui_feb").show();
|
||||||
@@ -251,6 +266,8 @@
|
|||||||
$("input[name='craft'][value='现货背卡']").parent().hide();
|
$("input[name='craft'][value='现货背卡']").parent().hide();
|
||||||
$("input[name='craft'][value='现货背卡']").find("input").prop("disabled", true);
|
$("input[name='craft'][value='现货背卡']").find("input").prop("disabled", true);
|
||||||
$("#craft_tip").hide();
|
$("#craft_tip").hide();
|
||||||
|
$(".rotation").show()
|
||||||
|
$(".rotation").find("input").prop("disabled", false)
|
||||||
if (kindValue == "对联冰箱贴") {
|
if (kindValue == "对联冰箱贴") {
|
||||||
$("input[name='craft'][value='现货背卡']").parent().show();
|
$("input[name='craft'][value='现货背卡']").parent().show();
|
||||||
$("input[name='craft'][value='现货背卡']").find("input").prop("disabled", false);
|
$("input[name='craft'][value='现货背卡']").find("input").prop("disabled", false);
|
||||||
@@ -267,6 +284,12 @@
|
|||||||
$(".xhbeika").show();
|
$(".xhbeika").show();
|
||||||
$(".xhbeika").find("input").prop("disabled", false)
|
$(".xhbeika").find("input").prop("disabled", false)
|
||||||
$("#craft_tip").show();
|
$("#craft_tip").show();
|
||||||
|
$(".tow").hide()
|
||||||
|
$(".tow").find("input").prop("disabled", true)
|
||||||
|
$(".three").hide()
|
||||||
|
$(".three").find("input").prop("disabled", true)
|
||||||
|
$(".rotation").hide()
|
||||||
|
$(".rotation").find("input").prop("disabled", true)
|
||||||
}
|
}
|
||||||
$("#cailiao").empty();
|
$("#cailiao").empty();
|
||||||
$("#cailiao").append(cailiaoHtml);
|
$("#cailiao").append(cailiaoHtml);
|
||||||
@@ -320,6 +343,7 @@
|
|||||||
form.render();
|
form.render();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const carft3 = carft_list3.filter(craft => craft_list.includes(craft));
|
const carft3 = carft_list3.filter(craft => craft_list.includes(craft));
|
||||||
if (carft3.length > 1) {
|
if (carft3.length > 1) {
|
||||||
$(data.elem).prop("checked", false);
|
$(data.elem).prop("checked", false);
|
||||||
@@ -336,6 +360,23 @@
|
|||||||
form.render();
|
form.render();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (craft_list.includes("CNC") && (craft_list.includes("二层旋转") || craft_list.includes("三层旋转"))) {
|
||||||
|
$(data.elem).prop("checked", false);
|
||||||
|
layer.msg("CNC - 旋转 无法同时选择", {offset: ['300px', '300px']}, function () {
|
||||||
|
});
|
||||||
|
form.render();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!craft_list.includes("二层旋转") && craft_list.includes("三层旋转")) {
|
||||||
|
$(data.elem).prop("checked", false);
|
||||||
|
layer.msg("请先选择二层旋转", {offset: ['300px', '300px']}, function () {
|
||||||
|
});
|
||||||
|
form.render();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (data.value == "背卡") {
|
if (data.value == "背卡") {
|
||||||
$(".beika").hide();
|
$(".beika").hide();
|
||||||
$(".beika").find("input").prop("disabled", true)
|
$(".beika").find("input").prop("disabled", true)
|
||||||
@@ -368,6 +409,22 @@
|
|||||||
$(".crop").find("input").prop("disabled", false)
|
$(".crop").find("input").prop("disabled", false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (data.value == '二层旋转') {
|
||||||
|
$(".tow").hide();
|
||||||
|
$(".tow").find("input").prop("disabled", true)
|
||||||
|
if (data.elem.checked) {
|
||||||
|
$(".tow").show();
|
||||||
|
$(".tow").find("input").prop("disabled", false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (data.value == '三层旋转') {
|
||||||
|
$(".three").hide();
|
||||||
|
$(".three").find("input").prop("disabled", true)
|
||||||
|
if (data.elem.checked) {
|
||||||
|
$(".three").show();
|
||||||
|
$(".three").find("input").prop("disabled", false)
|
||||||
|
}
|
||||||
|
}
|
||||||
form.render();
|
form.render();
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -412,6 +469,10 @@
|
|||||||
craft.push($(this).val().replace("背卡", ""));
|
craft.push($(this).val().replace("背卡", ""));
|
||||||
} else if ($(this).val() == "抠图") {
|
} else if ($(this).val() == "抠图") {
|
||||||
craft.push($(this).val() + $("input[name='cropNumber']").val());
|
craft.push($(this).val() + $("input[name='cropNumber']").val());
|
||||||
|
} else if ($(this).val() == "二层旋转") {
|
||||||
|
craft.push($(this).val() + $("input[name='lengthSize']").val() + "*" + $("input[name='widthSize']").val() + "CM");
|
||||||
|
} else if ($(this).val() == "三层旋转") {
|
||||||
|
craft.push($(this).val() + $("input[name='lengthTang']").val() + "*" + $("input[name='widthTang']").val() + "CM");
|
||||||
} else {
|
} else {
|
||||||
craft.push($(this).val());
|
craft.push($(this).val());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user