新增种子纸材质

This commit is contained in:
2026-07-13 09:47:24 +08:00
parent 29b585c195
commit 0701c0c60d
2 changed files with 182 additions and 67 deletions
@@ -2766,73 +2766,98 @@ public class ProductService {
int av_count = count;
double unitPrice = 0;
if (count <= 50) {
unitPrice = 140;
} else if (count > 50 && count <= 100) {
unitPrice = 130;
} else if (count > 100 && count <= 200) {
unitPrice = 120;
} else if (count > 200 && count <= 500) {
unitPrice = 110;
} else if (count > 500 && count <= 1000) {
unitPrice = 100;
} else if (count > 1000 && count <= 2000) {
unitPrice = 95;
} else {
unitPrice = 90;
}
if ("4".equals(dto.getZ3type())) {
double price = 0;
if ("5".equals(dto.getZ3type())) {
if (count <= 50) {
unitPrice = 160;
unitPrice = 4.4;
unitPrice = new PriceUtils().calcByTargetN(50, 4.4, 50, 4.4, count);
} else if (count > 50 && count <= 100) {
unitPrice = 155;
unitPrice = 4.32;
unitPrice = new PriceUtils().calcByTargetN(50, 4.4, 100, 4.32, count);
} else if (count > 100 && count <= 200) {
unitPrice = 150;
} else if (count > 200 && count <= 500) {
unitPrice = 145;
} else if (count > 500 && count <= 1000) {
unitPrice = 140;
} else if (count > 1000 && count <= 2000) {
unitPrice = 135;
unitPrice = 4.28;
unitPrice = new PriceUtils().calcByTargetN(100, 4.32, 200, 4.28, count);
} else if (count > 200 && count <= 1339) {
unitPrice = 4.26;
unitPrice = new PriceUtils().calcByTargetN(200, 4.28, 1339, 4.26, count);
} else if (count > 1339 && count <= 5021) {
unitPrice = 3.8;
unitPrice = new PriceUtils().calcByTargetN(1339, 4.26, 5021, 3.8, count);
} else {
unitPrice = 3.2 * count;
}
price = Math.max(Math.ceil(unitPrice), 50) * number;
if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("装opp袋")) {
price += Math.ceil(Math.max(count * 0.3 * number, 5));
}
} else {
if (count <= 50) {
unitPrice = 140;
} else if (count > 50 && count <= 100) {
unitPrice = 130;
} else if (count > 100 && count <= 200) {
unitPrice = 120;
} else if (count > 200 && count <= 500) {
unitPrice = 110;
} else if (count > 500 && count <= 1000) {
unitPrice = 100;
} else if (count > 1000 && count <= 2000) {
unitPrice = 95;
} else {
unitPrice = 90;
}
if ("4".equals(dto.getZ3type())) {
if (count <= 50) {
unitPrice = 160;
} else if (count > 50 && count <= 100) {
unitPrice = 155;
} else if (count > 100 && count <= 200) {
unitPrice = 150;
} else if (count > 200 && count <= 500) {
unitPrice = 145;
} else if (count > 500 && count <= 1000) {
unitPrice = 140;
} else if (count > 1000 && count <= 2000) {
unitPrice = 135;
} else {
unitPrice = 130;
}
}
price = Math.ceil((length * width * count * unitPrice) / 10000);//价格计算尺寸*数量*200/10000
if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("编码")) {//起步价10
price += Math.max(count * 0.5, 10);
}
if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("打孔")) {
price += Math.max(count * 0.2, 10);
}
if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("手撕线")) {
price += Math.max(count * 0.2, 10);
}
if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("压痕")) {
price += Math.max(count * 0.2, 10);
}
price = price * number;//款数翻倍
price = Math.max(price, 50);
if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("装opp袋")) {
price += Math.ceil(Math.max(count * 0.15 * number, 5));
}
craft_list = crafts != null ? Arrays.asList(crafts) : new ArrayList<>();
if (craft_list.size() > 0 && craft_list.contains("绳子")) {
price += Math.max(5, Math.ceil(0.1 * number * count));
}
if (craft_list.size() > 0 && craft_list.contains("葫芦针")) {
price += Math.max(Math.ceil(0.04 * number * count), 5);
}
if (craft_list.size() > 0 && craft_list.contains("棉绳")) {
price += Math.max(Math.ceil(0.1 * number * count), 5);
}
}
double price = Math.ceil((length * width * count * unitPrice) / 10000);//价格计算尺寸*数量*200/10000
if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("编码")) {//起步价10
price += Math.max(count * 0.5, 10);
}
if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("打孔")) {
price += Math.max(count * 0.2, 10);
}
if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("手撕线")) {
price += Math.max(count * 0.2, 10);
}
if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("压痕")) {
price += Math.max(count * 0.2, 10);
}
price = price * number;//款数翻倍
price = Math.max(price, 50);
if (!StringUtils.isEmpty(crafts) && Arrays.asList(crafts).contains("装opp袋")) {
price += Math.ceil(Math.max(count * 0.15 * number, 5));
}
// if ("4".equals(dto.getZ3type())) {
// price += 100;
// }
craft_list = crafts != null ? Arrays.asList(crafts) : new ArrayList<>();
if (craft_list.size() > 0 && craft_list.contains("绳子")) {
price += Math.max(5, Math.ceil(0.1 * number * count));
}
if (craft_list.size() > 0 && craft_list.contains("葫芦针")) {
price += Math.max(Math.ceil(0.04 * number * count), 5);
}
if (craft_list.size() > 0 && craft_list.contains("棉绳")) {
price += Math.max(Math.ceil(0.1 * number * count), 5);
}
Product dto2 = new Product();
dto2.setCount(av_count);
dto2.setWeight(df.format(number * (length / 100) * (width / 100) * av_count * 0.3 * 0.86));
+98 -8
View File
@@ -169,8 +169,15 @@
<input type="radio" lay-filter="z3type" name="z3type" value="1" title="卡片">
<input type="radio" lay-filter="z3type" name="z3type" value="2" title="圆形">
<input type="radio" lay-filter="z3type" name="z3type" value="3" title="开窗">
<input type="radio" lay-filter="z3type" name="z3type" value="5" title="奖牌">
<input type="radio" name="z3type" lay-filter="z3type" value="4" title="自定义">
</div>
<p>材质</p>
<div class="z3type">
<select id="material">
<option>400克种子纸</option>
</select>
</div>
</form>
<div class="tagOther">
<form class="layui-form">
@@ -238,6 +245,11 @@
<option value="9*9">9*9 cm</option>
</select>
</div>
<div id="3z_jiangpai_size" style="display: none">
<select name="z3size1" lay-filter="z3size1" class="select">
<option value="8*9">8*9 cm</option>
</select>
</div>
<div id="3z_chuang_size" style="display: none">
<select name="z3size1" lay-filter="z3size1" class="select">
<option value="16*7">16*7 cm</option>
@@ -270,8 +282,6 @@
<input type="radio" name="3z_vice" value="圆角+手撕线+缺口(副券4.5cm"
title="圆角+手撕线+缺口(副券4.5cm">
</div>
</div>
<div class="ui_sdk" style="display: none;">
<select name="ui_sdk_size" id="ui_sdk_size" class="select">
@@ -739,7 +749,9 @@
<span class="z3_craft_opp">
<input type="checkbox" name="craft" lay-filter="z3Crafts" value="装opp袋" title="装opp袋"/>
</span>
<input type="checkbox" class="shengz" name="craft" lay-filter="z3Crafts" value="绳子" title="绳子">
<span class="z3_craft_shengz">
<input type="checkbox" class="shengz" name="craft" lay-filter="z3Crafts" value="绳子" title="绳子">
</span>
<div class="shengz scolor" style="width: 150px;display: none">
<select class="select">
<option value="白色绳子">白色绳子</option>
@@ -747,8 +759,27 @@
<option value="红色绳子">红色绳子</option>
</select>
</div>
<input type="checkbox" name="craft" lay-filter="z3Crafts" value="葫芦针" title="葫芦针"/>
<input type="checkbox" name="craft" lay-filter="z3Crafts" value="棉绳" title="棉绳"/>
<span class="z3_craft_peiother">
<input type="checkbox" name="craft" lay-filter="z3Crafts" value="葫芦针" title="葫芦针"/>
<input type="checkbox" name="craft" lay-filter="z3Crafts" value="棉绳" title="棉绳"/>
</span>
<span class="z3_craft_guasheng">
<input type="checkbox" class="guasheng" name="craft" lay-filter="z3Crafts" value="挂绳" title="挂绳"/>
<div class="shengz gscolor" style="width: 150px;display: none">
<select class="select" disabled>
<option value="黑色">黑色</option>
<option value="藏青色">藏青色</option>
<option value="草绿色">草绿色</option>
<option value="宝蓝色">宝蓝色</option>
<option value="紫色">紫色</option>
<option value="咖啡色">咖啡色</option>
<option value="浅天蓝色">浅天蓝色</option>
<option value="红色">红色</option>
<option value="橘橙色">橘橙色</option>
<option value="白色">白色</option>
</select>
</div>
</span>
</div>
<div>
覆膜工艺:
@@ -1103,6 +1134,13 @@
if (craftValue != '') {
data.craftValue = craftValue;
}
if (kind == "种子纸") {
let z3type = $("input[name='z3type']:checked").val()
data.kind2Value = 400
if(z3type == 5){
data.kind2Value = 1000
}
}
$("#carousel").empty();
$("#remark").empty();
$.ajax({
@@ -1189,22 +1227,31 @@
$(".z3_craft_yh").show();
$(".z3_craft_bm").show();
$(".z3_craft_mq").show();
$(".z3_craft_peiother").show();
$(".z3_craft_shengz").show();
$("#3z_menpiao_size").hide();
$("#3z_kapian_size").hide();
$("#3z_yuan_size").hide();
$("#3z_chuang_size").hide();
$("#3z_jiangpai_size").hide();
$(".z3_craft_ssx").hide();
$(".scolor").hide();
$(".scolor select").attr("disabled", true)
$(".gscolor").hide();
$(".gscolor select").attr("disabled", true)
$(".z3_craft_yh").hide();
$("#3z_menpiao_size select").attr("disabled", true)
$("#3z_kapian_size select").attr("disabled", true)
$("#3z_yuan_size select").attr("disabled", true)
$("#3z_chuang_size select").attr("disabled", true)
$("#3z_jiangpai_size select").attr("disabled", true)
$(".z3_craft input[name='craft']").prop("checked", false);
$(".z3_craft input[name='craft']").prop("disabled", false);
$("#3z_size").show();
$("#size").val($('select[name="z3size1"]:not(:disabled) option:checked').val());//尺寸重新赋值
$(".qt").hide()
$("#3zValueForm").show();
let html = `<option>400克种子纸</option>`;
if (val == 0) {
let menpiao_size = $("#3z_menpiao_size select option:selected").val();
@@ -1268,6 +1315,28 @@
$(".z3_craft_bm").show();
$(".z3_craft_mq").show();
}
if (val == 5) {
$("#3z_jiangpai_size").show();
$("#3z_jiangpai_size select").attr("disabled", false)
if (!$('input[name="switchz3Size"]:checked').val()) {
$("#size").val($("#3z_jiangpai_size select option:selected").val());
}
$(".z3_craft_yj").hide();
$(".z3_craft_zj").hide();
$(".z3_craft_bm").hide();
$(".z3_craft_mq").show();
$(".z3_craft_peiother").hide();
$(".z3_craft_shengz").hide();
$(".z3_craft_mq input").click();
$(".z3_craft_dk input").click();
$(".z3_craft_guasheng input").click();
$(".gscolor").css("display", "inline-block")
$(".gscolor select").prop("disabled", false);
z3Craft($("#size").val())
html = `<option>1000克种子纸</option>`;
}
$("#material").empty().append(html);
getProductImage()
form.render();
}
@@ -1304,6 +1373,8 @@
$("#peijian_ui .tscolor select").prop("disabled", true);
$("#peijian_ui .scolor").hide();
$("#peijian_ui .scolor select").prop("disabled", true);
$("#peijian_ui .gscolor").hide();
$("#peijian_ui .gscolor select").prop("disabled", true);
$("#peijian_ui .select_nilongshen").hide();
$("#peijian_ui .select_nilongshen select").prop("disabled", true);
$("#peijian_ui .select_liusu").hide();
@@ -2496,6 +2567,7 @@
form.on('checkbox(z3Crafts)', (data) => {
let value = data.value;
let checked = $(data.elem).is(":checked");
let z3type = $("input[name='z3type']:checked").val();
if (value == '直角' && $(".z3_craft_yj input[name='craft']").is(":checked")) {
$(data.elem).prop("checked", false);
@@ -2508,21 +2580,35 @@
if (value == '模切') {
$(".z3_craft_yj input[name='craft']").prop("disabled", checked);
$(".z3_craft_zj input[name='craft']").prop("disabled", checked);
$(".z3_craft_dk input[name='craft']").prop("disabled", checked);
if (z3type != 5) {
$(".z3_craft_dk input[name='craft']").prop("disabled", checked);
}
$(".z3_craft_ssx input[name='craft']").prop("disabled", checked);
$(".z3_craft_yh input[name='craft']").prop("disabled", checked);
$(".z3_craft_bm input[name='craft']").prop("disabled", checked);
} else {
let other_list = ["圆角", "直角", "打孔", "编码"];
if (other_list.indexOf(value) != -1 || (other_list.indexOf(value) != -1 && checked)) {
$(".z3_craft_mq input[name='craft']").prop("disabled", checked);
if (z3type != 5) {
if (other_list.indexOf(value) != -1 || (other_list.indexOf(value) != -1 && checked)) {
$(".z3_craft_mq input[name='craft']").prop("disabled", checked);
}
}
}
let shengz = $(".shengz:checked").length;
if (shengz == 1) {
$(".scolor").css("display", "inline-block")
$(".scolor select").prop("disabled", false);
} else {
$(".scolor").hide()
$(".scolor select").prop("disabled", true);
}
let guasheng = $(".guasheng:checked").length;
if (guasheng == 1) {
$(".gscolor").css("display", "inline-block")
$(".gscolor select").prop("disabled", false);
} else {
$(".gscolor").hide()
$(".gscolor select").prop("disabled", true);
}
form.render();
})
@@ -3499,6 +3585,10 @@
arr.push($(this).val() + $("input[name='cropNumber']").val());
return;
}
if ($(this).val() == "挂绳") {
arr.push($(".gscolor select option:selected").val() + $(this).val());
return;
}
if ($(this).val() == "内部模切") {
return;
}