futian.liu
2023-12-11 6586db1ec90fd6fbf0e4c7795137379b80ee31c1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.consum.test;
 
import java.util.ArrayList;
 
import org.apache.commons.compress.utils.Lists;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
 
import com.consum.base.service.LWhFormInventoryGoodsService;
import com.consum.model.po.LWhFormInventoryGoods;
 
@RunWith(SpringRunner.class)
@SpringBootTest
public class CodeGeneratorServiceTest {
 
    @Autowired
    private LWhFormInventoryGoodsService service;
 
    @Test
    public void createWarehouseCode() {
        ArrayList<LWhFormInventoryGoods> objects = Lists.newArrayList();
        for (int i = 1; i < 4; i++) {
            LWhFormInventoryGoods entity = new LWhFormInventoryGoods();
            entity.setId(Long.valueOf(i));
            entity.setPrice(10.00);
            objects.add(entity);
        }
        int i = service.updateBatch(objects);
        System.out.println(i);
    }
 
}