LMS基线更新马钢版本
This commit is contained in:
@@ -0,0 +1,156 @@
|
||||
package org.nl.point;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.nl.wms.sch.point.service.ISchBasePointService;
|
||||
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||
import org.nl.wms.sch.region.service.ISchBaseRegionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 创建点位
|
||||
* @Date: 2023/6/15
|
||||
*/
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
public class PointCreate {
|
||||
|
||||
@Autowired
|
||||
private ISchBasePointService pointService;
|
||||
@Autowired
|
||||
private ISchBaseRegionService regionService;
|
||||
@Test
|
||||
void test01() {
|
||||
// 创建YJ01-08
|
||||
List<SchBasePoint> pointList = new ArrayList<>();
|
||||
for (int i = 3; i <= 8; i++) {
|
||||
String pointName = "压机0";
|
||||
String pointCode = "YJ0";
|
||||
pointName = pointName + i;
|
||||
pointCode = pointCode + i;
|
||||
SchBasePoint point = new SchBasePoint();
|
||||
point.setPoint_code(pointCode);
|
||||
point.setPoint_name(pointName);
|
||||
point.setRegion_code("YZ");
|
||||
point.setRegion_name("压制区域");
|
||||
point.setPoint_type("1");
|
||||
point.setParent_point_code(pointCode);
|
||||
point.setIs_has_workder(true);
|
||||
point.setIs_auto(true);
|
||||
pointList.add(point);
|
||||
}
|
||||
pointService.saveBatch(pointList);
|
||||
}
|
||||
|
||||
@Test
|
||||
void test02() { // 压机接料位
|
||||
// 创建YJ01JLW01
|
||||
List<SchBasePoint> pointList = new ArrayList<>();
|
||||
for (int i = 3; i <= 8; i++) {
|
||||
String pointName = "压机0";
|
||||
String pointCode = "YJ0";
|
||||
pointName = pointName + i;
|
||||
pointCode = pointCode + i;
|
||||
for (int j = 1; j <= 2; j++) {
|
||||
String jlw = "JLW0";
|
||||
String jlw2 = "接料位0";
|
||||
jlw = jlw + j;
|
||||
jlw2 = jlw2 + j;
|
||||
SchBasePoint point = new SchBasePoint();
|
||||
point.setPoint_code(pointCode + jlw);
|
||||
point.setPoint_name(pointName + jlw2);
|
||||
point.setRegion_code("YZ");
|
||||
point.setRegion_name("压制区域");
|
||||
point.setPoint_type("2");
|
||||
point.setParent_point_code(pointCode);
|
||||
point.setIs_has_workder(false);
|
||||
point.setIs_auto(true);
|
||||
pointList.add(point);
|
||||
}
|
||||
}
|
||||
pointService.saveBatch(pointList);
|
||||
}
|
||||
|
||||
@Test
|
||||
void test03() { // 料盅睏料线区域
|
||||
// 创建LZKL01 - 32
|
||||
List<SchBasePoint> pointList = new ArrayList<>();
|
||||
for (int i = 1; i <= 12; i++) {// 3台
|
||||
String pointName = "睏料位";
|
||||
String pointCode = "KLW";
|
||||
if (i < 10) {
|
||||
pointName = pointName + "0" + i;
|
||||
pointCode = pointCode + "0" + i;
|
||||
} else {
|
||||
pointName = pointName + i;
|
||||
pointCode = pointCode + i;
|
||||
}
|
||||
SchBasePoint point = new SchBasePoint();
|
||||
point.setPoint_code(pointCode);
|
||||
point.setPoint_name(pointName);
|
||||
point.setRegion_code("LZKLX");
|
||||
point.setRegion_name("料盅睏料线区域");
|
||||
point.setParent_point_code(pointCode);
|
||||
point.setIs_has_workder(false);
|
||||
point.setIs_auto(true);
|
||||
pointList.add(point);
|
||||
}
|
||||
pointService.saveBatch(pointList);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void test04() { // 缓存库位区域
|
||||
List<SchBasePoint> pointList = new ArrayList<>();
|
||||
int count = 1;
|
||||
for (int i = 1; i <= 2; i++) {
|
||||
for (int j = 1; j <= 29; j++) {
|
||||
for (int k = 1; k <= 3; k++) {
|
||||
String code = "HCHJ";
|
||||
String name = "缓存货架";
|
||||
if (count < 10) {
|
||||
code = code + "00" + count;
|
||||
name = name + "00" + count;
|
||||
} else if (count >= 10 && count < 100) {
|
||||
code = code + "0" + count;
|
||||
name = name + "0" + count;
|
||||
} else {
|
||||
code = code + count;
|
||||
name = name + count;
|
||||
}
|
||||
SchBasePoint point = new SchBasePoint();
|
||||
point.setPoint_code(code);
|
||||
point.setPoint_name(name);
|
||||
point.setRegion_code("GTPHC");
|
||||
point.setRegion_name("钢托盘缓存区域");
|
||||
point.setPoint_status("1");
|
||||
point.setCan_vehicle_type("2");
|
||||
point.setVehicle_max_qty(1);
|
||||
point.setBlock_num(1);
|
||||
point.setRow_num(i);
|
||||
point.setCol_num(j);
|
||||
point.setLayer_num(k);
|
||||
point.setIn_order_seq(count);
|
||||
point.setOut_order_seq(count);
|
||||
point.setIn_empty_seq(count);
|
||||
point.setOut_empty_seq(count);
|
||||
point.setParent_point_code(code);
|
||||
point.setCreate_id("1");
|
||||
point.setCreate_name("管理员");
|
||||
point.setCreate_time(DateUtil.now());
|
||||
point.setIs_has_workder(false);
|
||||
point.setIs_auto(true);
|
||||
point.setIs_used(true);
|
||||
pointList.add(point);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
pointService.saveBatch(pointList);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user