新增工作证
This commit is contained in:
@@ -4618,12 +4618,76 @@ public class ProductService {
|
||||
case "UV磁吸贴":
|
||||
priceList = getMagneticStickerPrice(dto, width, length);
|
||||
return chucklePrice(role, priceList, dto);
|
||||
case "工作证":
|
||||
priceList = getWorkPermitPrice(dto, width, length);
|
||||
return chucklePrice(role, priceList, dto);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<Product> getWorkPermitPrice(Product dto, Double width, Double length) {
|
||||
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("YAKELIZHENGJIAN");
|
||||
if ("1".equals(dto.getKind())) {
|
||||
requstVo.setPaper("亚克力工作证");
|
||||
}
|
||||
requstVo.setWidth(width * 10);
|
||||
requstVo.setHeight(length * 10);
|
||||
requstVo.setSizeUnit("MM");
|
||||
requstVo.setNum(count);
|
||||
requstVo.setStyleNum(number);
|
||||
|
||||
requstVo.setPrintSide(1);
|
||||
|
||||
if (craft_list.contains("双面")) {
|
||||
requstVo.setPrintSide(2);
|
||||
requstVo.setDoubleSideType("不同");
|
||||
}
|
||||
List<ShengDaPriceRequstItemVo> crafts = new ArrayList<>();
|
||||
|
||||
crafts.add(new ShengDaPriceRequstItemVo("打孔"));
|
||||
|
||||
if (craft_list.contains("背喷全打白")) {
|
||||
crafts.add(new ShengDaPriceRequstItemVo("背喷全打白"));
|
||||
}
|
||||
if (craft_list.contains("背喷彩白打局部")) {
|
||||
crafts.add(new ShengDaPriceRequstItemVo("背喷彩白打局部"));
|
||||
}
|
||||
if (craft_list.contains("镭射膜")) {
|
||||
crafts.add(new ShengDaPriceRequstItemVo("镭射膜"));
|
||||
}
|
||||
if (craft_list.contains("模切") || craft_list.contains("镂空")) {
|
||||
crafts.add(new ShengDaPriceRequstItemVo("镂空"));
|
||||
}
|
||||
if (craft_list.contains("挂绳")) {
|
||||
ShengDaPriceRequstItemVo baseCrafts = new ShengDaPriceRequstItemVo("挂绳");
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("颜色", dto.getShen_color());
|
||||
baseCrafts.setParameters(map);
|
||||
crafts.add(baseCrafts);
|
||||
}
|
||||
requstVo.setCrafts(crafts);
|
||||
ShengDaPriceResultVo result = ShengDaPriceUtils.getPrice(requstVo);
|
||||
System.out.println(result);
|
||||
double price = Math.ceil(result.getData().getPrice() / (1 - 0.65));
|
||||
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> getMagneticStickerPrice(Product dto, Double width, Double length) {
|
||||
List<String> craft_list = dto.getCraft() == null ? new ArrayList<>() : Arrays.asList(dto.getCraft());
|
||||
List<Product> priceList = new ArrayList<>();
|
||||
|
||||
@@ -7,6 +7,13 @@ import java.util.Map;
|
||||
@Data
|
||||
public class ShengDaPriceRequstItemVo {
|
||||
|
||||
public ShengDaPriceRequstItemVo() {
|
||||
}
|
||||
|
||||
public ShengDaPriceRequstItemVo(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
private String name;
|
||||
|
||||
private Map<String, String> parameters;
|
||||
|
||||
Reference in New Issue
Block a user