新增无纺布手提袋
This commit is contained in:
@@ -4434,12 +4434,100 @@ public class ProductService {
|
||||
case "立牌":
|
||||
priceList = getStandingSignPrice(dto, width, length);
|
||||
return chucklePrice(role, priceList, dto);
|
||||
case "无纺布手提袋":
|
||||
priceList = getNonwovensPrice(dto, width, length, height);
|
||||
return chucklePrice(role, priceList, dto);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<Product> getNonwovensPrice(Product dto, Double width, Double length, Double height) {
|
||||
List<String> craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
||||
List<Product> priceList = new ArrayList<>();
|
||||
|
||||
int count = dto.getCount();
|
||||
int number = dto.getNumber();
|
||||
ShengDaPriceNoPartsRequstVo requstVo = new ShengDaPriceNoPartsRequstVo();
|
||||
requstVo.setProductCategory("JIZHIWUFANGBUDAI");
|
||||
requstVo.setPaper(dto.getKind2Value());
|
||||
|
||||
requstVo.setWidth(width * 10);
|
||||
requstVo.setHeight(length * 10);
|
||||
requstVo.setThickness(height * 10);
|
||||
requstVo.setSizeUnit("MM");
|
||||
requstVo.setNum(count);
|
||||
requstVo.setStyleNum(number);
|
||||
|
||||
requstVo.setPrintSide(1);
|
||||
|
||||
List<ShengDaPriceRequstItemVo> crafts = new ArrayList<>();
|
||||
|
||||
if (craft_list.contains("侧面印刷")) {
|
||||
ShengDaPriceRequstItemVo ceCrafts = new ShengDaPriceRequstItemVo("侧面印刷");
|
||||
ceCrafts.setParameters(Collections.singletonMap("颜色", ""));
|
||||
crafts.add(ceCrafts);
|
||||
}
|
||||
if (craft_list.contains("单面")) {
|
||||
ShengDaPriceRequstItemVo ceCrafts = new ShengDaPriceRequstItemVo("印刷面");
|
||||
ceCrafts.setParameters(Collections.singletonMap("类型", "单色单面"));
|
||||
crafts.add(ceCrafts);
|
||||
}
|
||||
if (craft_list.contains("双面")) {
|
||||
ShengDaPriceRequstItemVo ceCrafts = new ShengDaPriceRequstItemVo("印刷面");
|
||||
ceCrafts.setParameters(Collections.singletonMap("类型", "双面不一样"));
|
||||
crafts.add(ceCrafts);
|
||||
}
|
||||
if (craft_list.contains("增加印刷内容颜色")) {
|
||||
ShengDaPriceRequstItemVo ceCrafts = new ShengDaPriceRequstItemVo("增加印刷内容颜色");
|
||||
ceCrafts.setParameters(Collections.singletonMap("颜色", dto.getShen_color()));
|
||||
crafts.add(ceCrafts);
|
||||
}
|
||||
if (craft_list.contains("印刷内容颜色")) {
|
||||
ShengDaPriceRequstItemVo ceCrafts = new ShengDaPriceRequstItemVo("印刷内容颜色");
|
||||
ceCrafts.setParameters(Collections.singletonMap("颜色", dto.getTcolor()));
|
||||
crafts.add(ceCrafts);
|
||||
}
|
||||
if (craft_list.contains("空白袋")) {
|
||||
ShengDaPriceRequstItemVo ceCrafts = new ShengDaPriceRequstItemVo("空白袋");
|
||||
ceCrafts.setParameters(Collections.singletonMap("个数", ""));
|
||||
crafts.add(ceCrafts);
|
||||
}
|
||||
if (craft_list.contains("加暗扣")) {
|
||||
ShengDaPriceRequstItemVo ceCrafts = new ShengDaPriceRequstItemVo("加暗扣");
|
||||
ceCrafts.setParameters(Collections.singletonMap("颜色", dto.getPlantName()));
|
||||
crafts.add(ceCrafts);
|
||||
}
|
||||
|
||||
requstVo.setCrafts(crafts);
|
||||
ShengDaPriceResultVo result = ShengDaPriceUtils.getPrice(requstVo);
|
||||
System.out.println(result);
|
||||
//这个手提袋100-500的价格按照毛率40% 600-1000毛率38% 2000-5000个35% 6000-1w个32% 2w以上按照30%
|
||||
|
||||
double rate = 0.65;
|
||||
if (count <= 500) {
|
||||
rate = 0.4;
|
||||
} else if (count < 1000) {
|
||||
rate = 0.38;
|
||||
} else if (count < 5000) {
|
||||
rate = 0.35;
|
||||
} else if (count < 10000) {
|
||||
rate = 0.32;
|
||||
} else {
|
||||
rate = 0.3;
|
||||
}
|
||||
double price = Math.ceil(result.getData().getPrice() / (1 - rate));
|
||||
double designPrice = number * 8;
|
||||
|
||||
Product product = new Product();
|
||||
product.setPrice(Math.ceil(Math.max(price, 30) + designPrice));
|
||||
product.setCount(dto.getCount());
|
||||
product.setNumber(dto.getNumber());
|
||||
priceList.add(product);
|
||||
return priceList;
|
||||
}
|
||||
|
||||
private List<Product> getStandingSignPrice(Product dto, Double width, Double length) {
|
||||
List<String> craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
||||
List<Product> priceList = new ArrayList<>();
|
||||
|
||||
@@ -19,6 +19,7 @@ public class ShengDaPriceNoPartsRequstVo {
|
||||
private String doubleSideType;
|
||||
private Double height;
|
||||
private Double width;
|
||||
private Double thickness;
|
||||
private Integer printSide;
|
||||
private Integer styleNum;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user