| | |
| | | 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); |
| | | } |
| | | |
| | | } |
| | | //package com.consum.test; |
| | | // |
| | | //import com.consum.ConsumApplication; |
| | | //import com.consum.base.core.CodeGeneratorEnum; |
| | | //import com.consum.base.core.CodeGeneratorService; |
| | | //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; |
| | | // |
| | | // |
| | | //@RunWith(SpringRunner.class) |
| | | //@SpringBootTest(classes = {ConsumApplication.class}) |
| | | //public class CodeGeneratorServiceTest { |
| | | // |
| | | // @Autowired |
| | | // private CodeGeneratorService service; |
| | | // |
| | | // @Test |
| | | // public void createWarehouseCode(){ |
| | | // for (int i=0;i<5;i++){ |
| | | // String code =service.createWarehouseCode(); |
| | | // System.out.println(code); |
| | | // } |
| | | // } |
| | | // |
| | | //// @Test |
| | | //// public void createGoodsTemplateCode(){ |
| | | //// String[] prefixs = new String[] {"A","B","C","A","B"}; |
| | | //// int[] leis = new int[]{1,2,2,1,2}; |
| | | //// for (int i=0;i<5;i++){ |
| | | //// String code =service.createGoodsTemplateCode(prefixs[i],leis[i]); |
| | | //// System.out.println(code); |
| | | //// } |
| | | //// } |
| | | // |
| | | // @Test |
| | | // public void createBusinessFormCode(){ |
| | | // for (int i=0;i<5;i++){ |
| | | // String code =service.createBusinessFormCode(CodeGeneratorEnum.Transfer); |
| | | // System.out.println(code); |
| | | // } |
| | | // } |
| | | // |
| | | //} |