Authored by mali

费率测试接口

@@ -12,18 +12,18 @@ import java.util.List; @@ -12,18 +12,18 @@ import java.util.List;
12 public class ExcelParseUtil { 12 public class ExcelParseUtil {
13 public static void main(String[] args) { 13 public static void main(String[] args) {
14 try { 14 try {
15 - List<ProductTestModel> dataList = XlsxUtils.parse(new File("E:\\规格\\19年\\业务要求切换数据\\副本系列缺失调整_骆文嘉_20190731 (2).xlsx"), ProductTestModel.class); 15 + List<ProductProfit> dataList = XlsxUtils.parse(new File("E:\\规格\\19年\\商品费率.xlsx"), ProductProfit.class);
16 16
17 - for (ProductTestModel item : dataList) { 17 + for (ProductProfit item : dataList) {
18 //String l = String.format("curl 'http://172.31.70.39:8088/ufoPlatform/live/generateMp4Vedio?debug=XYZ&orderCode=%d&startTime=%d&endTime=%d&cameraCode=%d'", item.getOrderCode(), item.getStartTime(), item.getEndTime() + 1, item.getCameraCode()); 18 //String l = String.format("curl 'http://172.31.70.39:8088/ufoPlatform/live/generateMp4Vedio?debug=XYZ&orderCode=%d&startTime=%d&endTime=%d&cameraCode=%d'", item.getOrderCode(), item.getStartTime(), item.getEndTime() + 1, item.getCameraCode());
19 19
20 - if (item.getSeriesId() == 0) { 20 + /*if (item.getSeriesId() == 0) {
21 System.out.println(String.format("update ufo_product.product set brand_id = %d where id = %d;", item.getBrandId(), item.getId())); 21 System.out.println(String.format("update ufo_product.product set brand_id = %d where id = %d;", item.getBrandId(), item.getId()));
22 } else { 22 } else {
23 System.out.println(String.format("update ufo_product.product set brand_id = %d, series_id = %d where id = %d;", item.getBrandId(), item.getSeriesId(), item.getId())); 23 System.out.println(String.format("update ufo_product.product set brand_id = %d, series_id = %d where id = %d;", item.getBrandId(), item.getSeriesId(), item.getId()));
24 - }  
25 - 24 + }*/
26 25
  26 + System.out.println(String.format("insert into ufo_product.product_profit(product_id, profit_rate) values(%d, %.3f);", item.getProductId(), item.getProfitRate()));
27 } 27 }
28 28
29 29
  1 +package com.yohobuy.ufo;
  2 +
  3 +import com.yoho.ufo.annotation.BatchImportField;
  4 +import lombok.Data;
  5 +
  6 +/**
  7 + * Created by li.ma on 2019/8/6.
  8 + */
  9 +@Data
  10 +public class ProductProfit {
  11 + @BatchImportField(index = 0)
  12 + private Integer productId;
  13 +
  14 + @BatchImportField(index = 1)
  15 + private Double profitRate;
  16 +
  17 +}