| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- package com.uas.platform.b2c;
- import com.uas.platform.b2c.core.constant.SplitChar;
- import com.uas.platform.b2c.core.utils.StringUtilB2C;
- 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;
- import java.util.UUID;
- /**
- * description
- *
- * @author yuj 2018-09-07 16:07
- */
- public class Test {
- @Autowired
- private ProductService productService;
- @org.junit.Test
- public void test() {
- Product panaVise = productService.getProductByEnuuAndCodeAndBrand(10043560L, "HE1AN-P-DC12V", "PanaVise");
- if (panaVise != null) {
- System.err.println(panaVise.toString());
- } else {
- 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);
- UUID uuid = UUID.randomUUID();
- System.out.println(uuid);
- }
- @org.junit.Test
- public void testCopy() {
- List<Integer> list = new ArrayList<>();
- list.add(1);
- list.add(2);
- list.add(3);
- Integer[] list2 = new Integer[list.size()];
- System.arraycopy(list.toArray(), 0, list2, 0, list.size());
- System.out.println(list2);
- }
- @org.junit.Test
- public void stringBufferTest() {
- List<Long> list = new ArrayList<>();
- list.add(1l);
- list.add(2l);
- String s1 = StringUtilB2C.joinListUseContact(list, SplitChar.COMMA);
- System.out.println(s1);
- StringBuffer st = new StringBuffer();
- for (Long aLong : list) {
- st.append(aLong);
- String s = st.substring(0, 1);
- System.out.println(s);
- }
- System.out.println(st.toString());
- StringBuffer buffer = new StringBuffer();
- buffer.append("1,");
- System.out.println(buffer.length());
- CharSequence charSequence = buffer.subSequence(0, buffer.length() - 1);
- System.out.println(charSequence.toString());
- }
- }
|