|
|
@@ -4,12 +4,15 @@ import com.uas.platform.b2c.prod.commodity.model.Product;
|
|
|
import com.uas.platform.b2c.prod.commodity.service.ProductService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* description
|
|
|
*
|
|
|
* @author yuj 2018-09-07 16:07
|
|
|
*/
|
|
|
-public class Test extends BaseJunitTest {
|
|
|
+public class Test {
|
|
|
|
|
|
@Autowired
|
|
|
private ProductService productService;
|
|
|
@@ -23,4 +26,14 @@ public class Test extends BaseJunitTest {
|
|
|
System.err.println("没有");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @org.junit.Test
|
|
|
+ public void testList() {
|
|
|
+ String list = "PreparedStatementCallback; SQL [insert into product$users(pu_date, pu_enuu, pu_prid, pu_useruu) values (?, ?, ?, ?)]; Duplicate entry '10030994-34298797-1000001778' for key 'UNIQUE_ENUU_USERUU_PRID'; nested exception is java.sql.BatchUpdateException: Duplicate entry '10030994-34298797-1000001778' for key 'UNIQUE_ENUU_USERUU_PRID'";
|
|
|
+ int li = list.lastIndexOf("-");
|
|
|
+ String substring = list.substring(0, li);
|
|
|
+ int l = substring.lastIndexOf("-");
|
|
|
+ String substring1 = substring.substring(l + 1);
|
|
|
+ System.out.println(substring1);
|
|
|
+ }
|
|
|
}
|