diff --git a/ktg-admin/src/test/WmStorageLocationUnitTest.java b/ktg-admin/src/test/WmStorageLocationUnitTest.java new file mode 100644 index 0000000..767efc9 --- /dev/null +++ b/ktg-admin/src/test/WmStorageLocationUnitTest.java @@ -0,0 +1,62 @@ +import com.alibaba.fastjson.JSON; +import com.ktg.RuoYiApplication; +import com.ktg.mes.wm.domain.WmStorageLocation; +import com.ktg.mes.wm.service.IWmStorageLocationService; +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 java.util.List; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = RuoYiApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +public class WmStorageLocationUnitTest { + @Autowired + private IWmStorageLocationService wmStorageLocationService; + + @Test + public void add() { + WmStorageLocation wmStorageLocation = new WmStorageLocation(); + wmStorageLocation.setLocationCode("L061"); + wmStorageLocation.setLocationName("测试库区001"); + wmStorageLocation.setWarehouseId(210L); + wmStorageLocation.setRemark("则是一个测试库区"); + wmStorageLocation.setLocationName("原料仓"); + wmStorageLocationService.insertWmStorageLocation(wmStorageLocation); + System.out.println("add:" + wmStorageLocation.getLocationId()); // 227 + } + + @Test + public void list() { + List list = wmStorageLocationService.selectWmStorageLocationList(new WmStorageLocation()); + System.out.println("list:" + JSON.toJSONString(list)); + } + + @Test + public void getInfo() { + System.out.println("getInfo:" + JSON.toJSONString(wmStorageLocationService.selectWmStorageLocationByLocationId(227L))); + } + + @Test + public void edit() { + WmStorageLocation wmStorageLocation = new WmStorageLocation(); + wmStorageLocation.setRemark("这是一个测试库区"); + wmStorageLocation.setLocationId(227L); + wmStorageLocation.setLocationCode("L061"); + wmStorageLocation.setLocationName("原料仓"); + wmStorageLocation.setWarehouseId(210L); + wmStorageLocation.setAreaFlag("N"); + wmStorageLocation.setFrozenFlag("N"); + int count = wmStorageLocationService.updateWmStorageLocation(wmStorageLocation); + System.out.println("edit:" + count); + } + + @Test + public void remove() { + Long[] ids = {227L}; + int count = wmStorageLocationService.deleteWmStorageLocationByLocationIds(ids); + System.out.println("remove:" + count); + } +}