添加重量。修改扇子异形工艺

This commit is contained in:
2025-08-01 11:11:53 +08:00
parent 949fe99610
commit 28d4b5682a
3 changed files with 36 additions and 18 deletions
@@ -2578,6 +2578,7 @@ public class ProductService {
for (Product product : priceList) { for (Product product : priceList) {
product.setPrice(Math.ceil(product.getPrice() + (number - 1) * 0.5)); product.setPrice(Math.ceil(product.getPrice() + (number - 1) * 0.5));
product.setWeight(df.format((width + 0.6) * (length + 0.6) * product.getCount() / 10000));
} }
return priceList; return priceList;
@@ -2606,9 +2607,9 @@ public class ProductService {
} }
} }
// double base = number < 6 && number > 1 ? 5 : 0; // double base = number < 6 && number > 1 ? 5 : 0;
// for (Product product : priceList) { for (Product product : priceList) {
// product.setPrice(product.getPrice() + base); product.setWeight(df.format((width + 0.6) * (length + 0.6) * product.getCount() / 10000));
// } }
/* } */ /* } */
@@ -3515,7 +3516,14 @@ public class ProductService {
for (Product product : priceList) { for (Product product : priceList) {
product.setPrice(Math.ceil(product.getPrice() * product.getPriceMultiple())); product.setPrice(Math.ceil(product.getPrice() * product.getPriceMultiple()));
} }
if (!StringUtils.isEmpty(dto.getCraft())) {
List<String> craftList = Arrays.asList(dto.getCraft());
if (craftList.contains("异形")) {
for (Product product : priceList) {
product.setPrice(Math.floor(product.getPrice() * 1.2));
}
}
}
// 异形工艺 // 异形工艺
//getCraft(dto, priceList, null, null, 0); //getCraft(dto, priceList, null, null, 0);
@@ -3530,7 +3538,7 @@ public class ProductService {
product.setPrice(Math.floor(product.getPrice() * number)); product.setPrice(Math.floor(product.getPrice() * number));
} }
// 根据款数重新算重量重量在数据库中 // 根据款数重新算重量重量在数据库中
if (!StringUtils.isEmpty(priceList.get(0).getWeight())) { if (priceList.size() > 0 && !StringUtils.isEmpty(priceList.get(0).getWeight())) {
for (Product product : priceList) { for (Product product : priceList) {
product.setWeight(df.format(Double.valueOf(product.getWeight()) * number)); product.setWeight(df.format(Double.valueOf(product.getWeight()) * number));
} }
@@ -4712,7 +4720,12 @@ public class ProductService {
count_list = new int[]{100, 200, 300, 400, 500, 800, 1000, 2000, 5000, 10000}; count_list = new int[]{100, 200, 300, 400, 500, 800, 1000, 2000, 5000, 10000};
areas = new double[]{22.5, 35.1, 40.5, 45.9, 48.6, 67.75, 75, 96, 108, 140, 150}; areas = new double[]{22.5, 35.1, 40.5, 45.9, 48.6, 67.75, 75, 96, 108, 140, 150};
area = length * width; area = length * width;
return getAreaCenterPrice(count_list, count, area, prices, areas, number); priceList = getAreaCenterPrice(count_list, count, area, prices, areas, number);
for (Product product : priceList) {
product.setWeight(df.format(width / 100 * length / 100 * product.getCount() * 0.48 * 1.4));
}
return priceList;
case "澜达海报": case "澜达海报":
//铜版纸200g 售价 //铜版纸200g 售价
prices = new int[][]{ prices = new int[][]{
@@ -4825,7 +4838,11 @@ public class ProductService {
int[] count_list = new int[]{200, 500, 1000, 2000, 3000, 5000, 10000}; int[] count_list = new int[]{200, 500, 1000, 2000, 3000, 5000, 10000};
double[] areas = new double[]{16, 25, 30.25, 36, 42.25, 49, 56.25, 64, 72.25, 81, 90.25, 100, 110.25, 121}; double[] areas = new double[]{16, 25, 30.25, 36, 42.25, 49, 56.25, 64, 72.25, 81, 90.25, 100, 110.25, 121};
double area = length * width; double area = length * width;
return getAreaCenterPrice(count_list, count, area, prices, areas, number); List<Product> productList = getAreaCenterPrice(count_list, count, area, prices, areas, number);
for (Product product : productList) {
product.setWeight(df.format(product.getCount() / (product.getCount() / (width * length / 10000) / 0.76 / 1.47) * product.getCount()));
}
return productList;
} }
return new ArrayList<>(); return new ArrayList<>();
} }
+2 -2
View File
@@ -542,8 +542,8 @@
<span class="tj"> <span class="tj">
<input type="checkbox" name="craft" lay-filter="switchCraft" value="烫金" title="烫金" <input type="checkbox" name="craft" lay-filter="switchCraft" value="烫金" title="烫金"
lay-skin="primary" class="tjCraft"> lay-skin="primary" class="tjCraft">
<input type="checkbox" name="craft" lay-filter="switchCraft" value="彩色印刷+烫金" <%-- <input type="checkbox" name="craft" lay-filter="switchCraft" value="彩色印刷+烫金"--%>
title="彩色印刷+烫金" lay-skin="primary" class="tjCraft"> <%-- title="彩色印刷+烫金" lay-skin="primary" class="tjCraft">--%>
</span> </span>
</div> </div>
</form> </form>
+10 -9
View File
@@ -163,17 +163,18 @@
//建造实例 //建造实例
ins = carousel.render({}); ins = carousel.render({});
form.on('checkbox(switch)', function (data) { // form.on('checkbox(switch)', function (data) {
if (!data.elem.checked && data.value == "异形") { // if (!data.elem.checked && data.value == "异形") {
layer.msg('不能取消 [异形] 工艺!', {offset: ['300px', '300px']}, function () { // layer.msg('不能取消 [异形] 工艺!', {offset: ['300px', '300px']}, function () {
}); // });
$('#mq').prop('checked', true); // $('#mq').prop('checked', true);
form.render('checkbox'); // form.render('checkbox');
return false; // return false;
} // }
}) // })
$(".kind2").find(":input").attr("disabled", true); $(".kind2").find(":input").attr("disabled", true);
$(".kind3").find(":input").attr("disabled", true); $(".kind3").find(":input").attr("disabled", true);
$(".kind4").find(":input").attr("disabled", true);
// 没切换款式的时候默认禁用其它的下拉框,(防止提交表单) // 没切换款式的时候默认禁用其它的下拉框,(防止提交表单)
$(".kind2").find(":input").attr("disabled", true); $(".kind2").find(":input").attr("disabled", true);
form.on('radio(kindValue)', function (data) { form.on('radio(kindValue)', function (data) {