新增杯垫盛大

This commit is contained in:
2026-07-10 09:56:48 +08:00
parent b5f9823175
commit a984fce392
4 changed files with 625 additions and 245 deletions
@@ -4545,7 +4545,7 @@ public class ProductService {
basePrice = 22;
basePrice = new PriceUtils().calcByTargetN(5000, 24, 10000, 22, num);
} else {
basePrice = 20*num;
basePrice = 20 * num;
//basePrice = new PriceUtils().calcByTargetN(10000, 20, 10000, 20, num);
}
double craftPrice = 0;
@@ -5119,6 +5119,7 @@ public class ProductService {
}
rate = 1.2;
}
List<String> sdList = Arrays.asList("14", "15", "16", "17", "18", "19", "20");
// 300克
if ("3".equals(kind)) {
// 异形模切价格
@@ -5222,6 +5223,123 @@ public class ProductService {
priceList.add(pro);
return priceList;
} else if (sdList.contains(dto.getKindValue())) {
ShengDaPriceNoPartsRequstVo requstVo = new ShengDaPriceNoPartsRequstVo();
requstVo.setProductCategory("BEIDIAN");
requstVo.setWidth(width * 10);
requstVo.setHeight(length * 10);
requstVo.setSizeUnit("MM");
requstVo.setNum(count);
requstVo.setStyleNum(number);
requstVo.setSize(dto.getNotePaperKind());
requstVo.setPrintSide(1);
List<ShengDaPriceRequstItemVo> craft = new ArrayList<>();
boolean isMO = true;
double base_rate = 0;
double min_pirce = 80;
double[] rate_list = {0.75, 0.72, 0.70, 0.68, 0.65, 0.60, 0.58, 0.55, 0.50};
int[] counts = {200, 400, 600, 800, 1000, 2000, 3000, 5000, 10000};
double maxRate = 0.48;
if ("14".equals(dto.getKindValue())) {
requstVo.setPaper("250克吸水棉纸");
if ("90*90圆形".equals(requstVo.getSize())) {
isMO = false;
}
if ("90*90方形".equals(requstVo.getSize())) {
isMO = false;
}
if ("90*90花边".equals(requstVo.getSize())) {
isMO = false;
}
if ("100*100圆形".equals(requstVo.getSize())) {
isMO = false;
}
}
if ("15".equals(dto.getKindValue())) {
requstVo.setPaper("450克瑞典棉卡");
}
if ("16".equals(dto.getKindValue())) {
requstVo.setPaper("500克吸水棉纸");
}
if ("17".equals(dto.getKindValue())) {
requstVo.setPaper("980克吸水杯垫");
}
if ("18".equals(dto.getKindValue())) {
requstVo.setPaper("PU皮革杯垫");
isMO = false;
}
if ("19".equals(dto.getKindValue())) {
requstVo.setProductCategory("MAOZHANDIAN");
requstVo.setPaper("3MM毛毡");
isMO = false;
}
if ("20".equals(dto.getKindValue())) {
requstVo.setProductCategory("MAOZHANDIAN");
requstVo.setPaper("彩色毛毡");
isMO = false;
ShengDaPriceRequstItemVo item = new ShengDaPriceRequstItemVo();
item.setName("彩色毛毡");
item.setParameters(Collections.singletonMap("颜色", dto.getTcolor()));
craft.add(item);
}
if ("18".equals(dto.getKindValue()) || "19".equals(dto.getKindValue()) || "20".equals(dto.getKindValue())) {
rate_list = new double[]{0.70, 0.65, 0.60, 0.55, 0.50};
counts = new int[]{50, 100, 200, 500, 1000};
maxRate = 0.45;
}
if (craft_list.contains("双面")) {
requstVo.setPrintSide(2);
requstVo.setDoubleSideType("不同");
}
if (craft_list.contains("装OPP袋")) {
ShengDaPriceRequstItemVo item = new ShengDaPriceRequstItemVo();
item.setName("装OPP袋");
item.setParameters(Collections.singletonMap("类型", "平口袋"));
craft.add(item);
}
if (craft_list.contains("模切")) {
ShengDaPriceRequstItemVo item = new ShengDaPriceRequstItemVo();
item.setName("模切");
item.setParameters(Collections.singletonMap("类型", "圆形(仅模切外轮廓 "));
craft.add(item);
}
if (craft_list.contains("激光")) {
ShengDaPriceRequstItemVo item = new ShengDaPriceRequstItemVo();
item.setName("激光");
craft.add(item);
}
if (craft_list.contains("雕刻")) {
ShengDaPriceRequstItemVo item = new ShengDaPriceRequstItemVo();
item.setName("雕刻");
craft.add(item);
}
if (isMO) {
ShengDaPriceRequstItemVo item = new ShengDaPriceRequstItemVo();
item.setName("光油");
craft.add(item);
}
requstVo.setCrafts(craft);
ShengDaPriceResultVo result = ShengDaPriceUtils.getPrice(requstVo);
for (int i = 0; i < counts.length; i++) {
if (counts[i] < count) {
continue;
}
base_rate = rate_list[i];
break;
}
if (base_rate == 0) {
base_rate = maxRate;
}
double price = Math.ceil(result.getData().getPrice() / (1 - base_rate));
double designPrice = 0;
Product product = new Product();
product.setPrice(Math.ceil(Math.max(price, min_pirce) + designPrice));
product.setCount(dto.getCount());
product.setNumber(dto.getNumber());
priceList.add(product);
} else {
priceList = new PriceUtils().tags600Price(dto, kind, kind2, area, count);
// 服装吊牌里面的900克吊牌把价格*1.3倍
@@ -30,4 +30,12 @@ public class ShengDaPriceUtils {
return result;
}
public static ShengDaPriceResultVo getPrice(ShengDaPriceNoPartsRequstVo params) {
Map<String, String> heards = new HashMap<>();
heards.put("Authorization", "Bearer " + getToken());
String resultText = HttpUtils.sendPostRequest("https://open.sd2000.com/api/app/calculate", JSONObject.toJSONString(params), heards);
ShengDaPriceResultVo result = JSONObject.parseObject(resultText, ShengDaPriceResultVo.class);
return result;
}
}
@@ -0,0 +1,24 @@
package lingtao.net.vo;
import lombok.Data;
import java.util.List;
@Data
public class ShengDaPriceNoPartsRequstVo {
private String productCategory;
private String paper;
private List<ShengDaPriceRequstItemVo> crafts;
private String name;
private String size;
private Integer num;
private String sizeUnit;
private String doubleSideType;
private Double height;
private Double width;
private Integer printSide;
private Integer styleNum;
}