修改手提袋重量

This commit is contained in:
2025-08-02 17:13:18 +08:00
parent 28d4b5682a
commit f6dda50c22
4 changed files with 219 additions and 163 deletions
@@ -7,6 +7,7 @@ import lingtao.net.bean.SysUser;
import lingtao.net.dao.ProductMapper;
import lingtao.net.dao.QuoteLogMapper;
import lingtao.net.util.*;
import lingtao.net.vo.FunReturnVo;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -866,6 +867,17 @@ public class ProductService {
// return priceList;
}
priceList = getHekaPrice(min, dto, priceList, count);
//四个位拼多多价格调整
if (role.indexOf("1045") > -1 && min == 4) {
for (Product product : priceList) {
if (product.getCount() == 200) {
product.setPrice(product.getPrice() - 30);
}
if (product.getCount() == 500) {
product.setPrice(product.getPrice() - 10);
}
}
}
getCraft(dto, priceList, length * 10, width * 10, min);
// 刮刮膜增加价格
if (dto.getKind().equals("13")) {
@@ -1925,7 +1937,7 @@ public class ProductService {
}
// 给产品加上重量
for (Product product : priceList) {
product.setWeight(df.format(number * length / 1000 * height / 1000 * product.getCount() * 0.13 * 1.25));
product.setWeight(df.format(product.getCount() * 0.03));
}
} else {
if ("4".equals(dto.getK())) {
@@ -1935,172 +1947,21 @@ public class ProductService {
double[] base_price = null;
length = 0.0;
height = 0.0;
width = 0.0;
List<String> kind2ValueList = Arrays.asList("11", "12", "31", "37", "38", "62");
if ("0".equals(kindValue) && !kind2ValueList.contains(kind2Value)) {
base_count = new int[]{100, 500, 1000, 2000, 3000, 5000, 10000};
} else {
base_count = new int[]{500, 1000, 2000, 3000, 5000, 10000};
}
if ("1".equals(kind2Value)) {
if ("0".equals(kindValue)) {
base_price = new double[]{420, 627, 1056, 1980, 2920, 4785, 9240};
}
if ("1".equals(kindValue)) {
base_price = new double[]{726, 1073, 1914, 2723, 4290, 7920};
}
length = 25.0;
height = 23.0;
}
if ("2".equals(kind2Value)) {
if ("0".equals(kindValue)) {
base_price = new double[]{480, 644, 1089, 2046, 2970, 4785, 9240};
}
if ("1".equals(kindValue)) {
base_price = new double[]{743, 1089, 1947, 2772, 4372, 8085};
}
length = 24.0;
height = 26.5;
}
if ("3".equals(kind2Value)) {
if ("0".equals(kindValue)) {
base_price = new double[]{480, 730, 1320, 2330, 3300, 5280, 9800};
}
if ("1".equals(kindValue)) {
base_price = new double[]{770, 1200, 2380, 3400, 5300, 9500};
}
length = 28.0;
height = 26.5;
}
if ("4".equals(kind2Value)) {
if ("0".equals(kindValue)) {
base_price = new double[]{420, 576, 896, 1600, 2304, 3760, 7040};
}
if ("1".equals(kindValue)) {
base_price = new double[]{576, 880, 1568, 2256, 3600, 6880};
}
length = 13.0;
height = 16.0;
}
if ("5".equals(kind2Value)) {
if ("0".equals(kindValue)) {
base_price = new double[]{450, 733, 980, 1700, 2500, 4000, 7600};
}
if ("1".equals(kindValue)) {
base_price = new double[]{651, 890, 1480, 2150, 3450, 6625};
}
length = 11.0;
height = 25.0;
}
if ("6".equals(kind2Value)) {
if ("0".equals(kindValue)) {
base_price = new double[]{390, 658, 1030, 1800, 2600, 4200, 8350};
}
if ("1".equals(kindValue)) {
base_price = new double[]{593, 1000, 1720, 2500, 4000, 7800};
}
length = 16.0;
height = 23.0;
}
if ("7".equals(kind2Value)) {
if ("0".equals(kindValue)) {
base_price = new double[]{320, 520, 860, 1550, 2240, 3750, 6900};
}
if ("1".equals(kindValue)) {
base_price = new double[]{500, 890, 1530, 2130, 3430, 6280};
}
length = 21.0;
height = 27.0;
}
if ("8".equals(kind2Value)) {
if ("0".equals(kindValue)) {
base_price = new double[]{400, 540, 1100, 1640, 2400, 3950, 7380};
}
if ("1".equals(kindValue)) {
base_price = new double[]{560, 980, 1640, 2230, 3600, 6580};
}
length = 21.0;
height = 26.5;
}
if ("9".equals(kind2Value)) {
if ("0".equals(kindValue)) {
base_price = new double[]{500, 760, 1200, 2260, 3300, 5200, 9910};
}
if ("1".equals(kindValue)) {
base_price = new double[]{700, 1100, 1920, 2800, 4400, 8500};
}
length = 25.0;
height = 27.0;
}
if ("10".equals(kind2Value)) {
if ("0".equals(kindValue)) {
base_price = new double[]{600, 970, 1450, 2480, 3600, 5450, 9380};
}
if ("1".equals(kindValue)) {
base_price = new double[]{910, 1350, 2300, 3400, 5100, 8600};
}
length = 32.0;
height = 27.0;
}
if ("11".equals(kind2Value)) {
if ("0".equals(kindValue)) {
base_price = new double[]{1192, 1600, 2800, 4100, 6500, 11280};
}
if ("1".equals(kindValue)) {
base_price = new double[]{920, 1350, 2250, 3500, 6350, 10800};
}
length = 32.0;
height = 39.0;
}
if ("12".equals(kind2Value)) {
if ("0".equals(kindValue)) {
base_price = new double[]{1419, 2013, 3234, 4800, 7672, 11385};
}
if ("1".equals(kindValue)) {
base_price = new double[]{1338, 1898, 3069, 4500, 7260, 10395};
}
length = 25.0;
height = 32.0;
}
if ("31".equals(kind2Value)) {
if ("0".equals(kindValue)) {
base_price = new double[]{528, 875, 1650, 2426, 3878, 7590};
}
if ("1".equals(kindValue)) {
base_price = new double[]{680, 957, 1716, 2475, 3878, 7095};
}
length = 23.0;
height = 21.0;
}
if ("37".equals(kind2Value)) {
if ("0".equals(kindValue)) {
base_price = new double[]{600, 990, 1848, 2723, 4455, 8580};
}
if ("1".equals(kindValue)) {
base_price = new double[]{710, 1040, 1848, 2624, 4125, 7755};
}
length = 23.0;
height = 21.0;
}
if ("38".equals(kind2Value)) {
if ("0".equals(kindValue)) {
base_price = new double[]{600, 924, 1650, 2376, 3878, 7260};
}
if ("1".equals(kindValue)) {
base_price = new double[]{600, 908, 1617, 2328, 3713, 7095};
}
length = 21.0;
height = 21.0;
}
if ("62".equals(kind2Value)) {
if ("0".equals(kindValue)) {
base_price = new double[]{578, 975, 1848, 2673, 5360, 10240};
}
if ("1".equals(kindValue)) {
base_price = new double[]{693, 1008, 1749, 2475, 4960, 9600};
}
length = 24.0;
height = 32.0;
FunReturnVo funReturnVo = new PriceUtils().getBagTagPrice(kind2Value, kindValue);
if (funReturnVo.getBase_price() != null) {
base_price = funReturnVo.getBase_price();
width = funReturnVo.getWidth();
height = funReturnVo.getHeight();
length = funReturnVo.getLength();
}
Product pro = null;
double color_price = 0;
double bei_price = 0;
@@ -2139,7 +2000,7 @@ public class ProductService {
for (Product product : priceList) {
product.setPrice(product.getPrice() * number);
product.setWeight(df.format(number * length / 1000 * height / 1000 * product.getCount() * 0.13 * 1.25));
product.setWeight(df.format((width + height) * length * 2 * 0.25 * 1.5 * product.getCount() / 10000));
}
return priceList;
+184 -2
View File
@@ -1,6 +1,7 @@
package lingtao.net.util;
import lingtao.net.bean.Product;
import lingtao.net.vo.FunReturnVo;
import org.springframework.util.StringUtils;
import java.text.DecimalFormat;
@@ -3546,8 +3547,8 @@ public class PriceUtils {
} else if (startIndex == endIndex) {
price = (price_list[endIndex] * areas[endIndex] / areas[endIndex]) * area;
} else {
double end_price = price_list[endIndex]*areas[endIndex];
double start_price = price_list[startIndex]*areas[startIndex];
double end_price = price_list[endIndex] * areas[endIndex];
double start_price = price_list[startIndex] * areas[startIndex];
price = ((areas[endIndex] - area) / (areas[endIndex] - areas[startIndex])) * start_price + ((area - areas[startIndex]) / (areas[endIndex] - areas[startIndex])) * end_price;
}
@@ -3584,4 +3585,185 @@ public class PriceUtils {
return price;
}
public FunReturnVo getBagTagPrice(String kind2Value, String kindValue) {
FunReturnVo vo = new FunReturnVo();
if ("1".equals(kind2Value)) {
if ("0".equals(kindValue)) {
vo.setBase_price(new double[]{420, 627, 1056, 1980, 2920, 4785, 9240});
}
if ("1".equals(kindValue)) {
vo.setBase_price(new double[]{726, 1073, 1914, 2723, 4290, 7920});
}
vo.setLength(25.0);
vo.setHeight(23.0);
vo.setWidth(15.0);
}
if ("2".equals(kind2Value)) {
if ("0".equals(kindValue)) {
vo.setBase_price(new double[]{480, 644, 1089, 2046, 2970, 4785, 9240});
}
if ("1".equals(kindValue)) {
vo.setBase_price(new double[]{743, 1089, 1947, 2772, 4372, 8085});
}
vo.setLength(24.0);
vo.setHeight(26.5);
vo.setWidth(14.0);
}
if ("3".equals(kind2Value)) {
if ("0".equals(kindValue)) {
vo.setBase_price(new double[]{480, 730, 1320, 2330, 3300, 5280, 9800});
}
if ("1".equals(kindValue)) {
vo.setBase_price(new double[]{770, 1200, 2380, 3400, 5300, 9500});
}
vo.setLength(28.0);
vo.setHeight(26.5);
vo.setWidth(15.0);
}
if ("4".equals(kind2Value)) {
if ("0".equals(kindValue)) {
vo.setBase_price(new double[]{420, 576, 896, 1600, 2304, 3760, 7040});
}
if ("1".equals(kindValue)) {
vo.setBase_price(new double[]{576, 880, 1568, 2256, 3600, 6880});
}
vo.setLength(13.0);
vo.setHeight(16.0);
vo.setWidth(8.0);
}
if ("5".equals(kind2Value)) {
if ("0".equals(kindValue)) {
vo.setBase_price(new double[]{450, 733, 980, 1700, 2500, 4000, 7600});
}
if ("1".equals(kindValue)) {
vo.setBase_price(new double[]{651, 890, 1480, 2150, 3450, 6625});
}
vo.setLength(11.0);
vo.setHeight(25.0);
vo.setWidth(9.5);
}
if ("6".equals(kind2Value)) {
if ("0".equals(kindValue)) {
vo.setBase_price(new double[]{390, 658, 1030, 1800, 2600, 4200, 8350});
}
if ("1".equals(kindValue)) {
vo.setBase_price(new double[]{593, 1000, 1720, 2500, 4000, 7800});
}
vo.setLength(16.0);
vo.setHeight(23.0);
vo.setWidth(8.0);
}
if ("7".equals(kind2Value)) {
if ("0".equals(kindValue)) {
vo.setBase_price(new double[]{320, 520, 860, 1550, 2240, 3750, 6900});
}
if ("1".equals(kindValue)) {
vo.setBase_price(new double[]{500, 890, 1530, 2130, 3430, 6280});
}
vo.setLength(21.0);
vo.setHeight(27.0);
vo.setWidth(11.0);
}
if ("8".equals(kind2Value)) {
if ("0".equals(kindValue)) {
vo.setBase_price(new double[]{400, 540, 1100, 1640, 2400, 3950, 7380});
}
if ("1".equals(kindValue)) {
vo.setBase_price(new double[]{560, 980, 1640, 2230, 3600, 6580});
}
vo.setLength(21.0);
vo.setHeight(26.5);
vo.setWidth(14.0);
}
if ("9".equals(kind2Value)) {
if ("0".equals(kindValue)) {
vo.setBase_price(new double[]{500, 760, 1200, 2260, 3300, 5200, 9910});
}
if ("1".equals(kindValue)) {
vo.setBase_price(new double[]{700, 1100, 1920, 2800, 4400, 8500});
}
vo.setLength(25.0);
vo.setHeight(27.0);
vo.setWidth(17.0);
}
if ("10".equals(kind2Value)) {
if ("0".equals(kindValue)) {
vo.setBase_price(new double[]{600, 970, 1450, 2480, 3600, 5450, 9380});
}
if ("1".equals(kindValue)) {
vo.setBase_price(new double[]{910, 1350, 2300, 3400, 5100, 8600});
}
vo.setLength(32.0);
vo.setHeight(27.0);
vo.setWidth(11.0);
}
if ("11".equals(kind2Value)) {
if ("0".equals(kindValue)) {
vo.setBase_price(new double[]{1192, 1600, 2800, 4100, 6500, 11280});
}
if ("1".equals(kindValue)) {
vo.setBase_price(new double[]{920, 1350, 2250, 3500, 6350, 10800});
}
vo.setLength(32.0);
vo.setHeight(39.0);
vo.setWidth(11.0);
}
if ("12".equals(kind2Value)) {
if ("0".equals(kindValue)) {
vo.setBase_price(new double[]{1419, 2013, 3234, 4800, 7672, 11385});
}
if ("1".equals(kindValue)) {
vo.setBase_price(new double[]{1338, 1898, 3069, 4500, 7260, 10395});
}
vo.setLength(25.0);
vo.setHeight(32.0);
vo.setWidth(13.0);
}
if ("31".equals(kind2Value)) {
if ("0".equals(kindValue)) {
vo.setBase_price(new double[]{528, 875, 1650, 2426, 3878, 7590});
}
if ("1".equals(kindValue)) {
vo.setBase_price(new double[]{680, 957, 1716, 2475, 3878, 7095});
}
vo.setLength(23.0);
vo.setHeight(21.0);
vo.setWidth(15.0);
}
if ("37".equals(kind2Value)) {
if ("0".equals(kindValue)) {
vo.setBase_price(new double[]{600, 990, 1848, 2723, 4455, 8580});
}
if ("1".equals(kindValue)) {
vo.setBase_price(new double[]{710, 1040, 1848, 2624, 4125, 7755});
}
vo.setLength(23.0);
vo.setHeight(21.0);
vo.setWidth(11.0);
}
if ("38".equals(kind2Value)) {
if ("0".equals(kindValue)) {
vo.setBase_price(new double[]{600, 924, 1650, 2376, 3878, 7260});
}
if ("1".equals(kindValue)) {
vo.setBase_price(new double[]{600, 908, 1617, 2328, 3713, 7095});
}
vo.setLength(21.0);
vo.setHeight(21.0);
vo.setWidth(14.0);
}
if ("62".equals(kind2Value)) {
if ("0".equals(kindValue)) {
vo.setBase_price(new double[]{578, 975, 1848, 2673, 5360, 10240});
}
if ("1".equals(kindValue)) {
vo.setBase_price(new double[]{693, 1008, 1749, 2475, 4960, 9600});
}
vo.setLength(24.0);
vo.setHeight(32.0);
vo.setWidth(14.0);
}
return vo;
}
}
@@ -0,0 +1,11 @@
package lingtao.net.vo;
import lombok.Data;
@Data
public class FunReturnVo {
double width;
double length;
double height;
double[] base_price;
}
+2
View File
@@ -432,6 +432,8 @@
<div class="swiper" style="height: 100%;width: 800px;">
<div class="swiper-wrapper">
<div class="swiper-slide" data-swiper-autoplay="5000">【新增】特种纸新增打码 烫金工艺 注意!!!雅柔纸打码烫金的工艺材质会比报价系统的材质偏黄点 接单的时候要跟客户沟通清楚 以免造成不必要的售后</div>
<div class="swiper-slide" data-swiper-autoplay="5000">【新增】双面不干胶-水标价格更新</div>
<div class="swiper-slide" data-swiper-autoplay="5000">【修改】手提袋重量修改</div>
</div>
</div>
</div>