add:仓位初始化
This commit is contained in:
@@ -22,6 +22,120 @@ public class Init implements ApplicationRunner {
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
// initTwoAttr(4,30,3,2, "2");
|
||||
// createAttr();
|
||||
// initTwoAttr2(1,10,2, 2, 1, 2);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化二期仓位
|
||||
* row_num: 当前排
|
||||
* col_all:共多少列
|
||||
* layer_all: 共多少层
|
||||
* row_num_now : 系统程序排
|
||||
* block_num: 巷道
|
||||
* zdepth: 深度
|
||||
*/
|
||||
private void initTwoAttr2(int row_num, int col_all, int layer_all, int row_num_now ,int block_num, int zdepth) {
|
||||
|
||||
WQLObject tab = WQLObject.getWQLObject("ST_IVT_StructAttr");
|
||||
WQLObject tab2 = WQLObject.getWQLObject("st_ivt_bsrealstorattr");
|
||||
WQLObject tab3 = WQLObject.getWQLObject("st_ivt_sectattr");
|
||||
WQLObject tab4 = WQLObject.getWQLObject("sch_base_point");
|
||||
|
||||
// 排
|
||||
String row = row_num + "";
|
||||
|
||||
if (row_num < 10) {
|
||||
row = "0" + row_num + "";
|
||||
}
|
||||
|
||||
for (int j = 1; j < layer_all + 1; j++) {
|
||||
|
||||
// 层
|
||||
String layer_num = j + "";
|
||||
if (j < 10) {
|
||||
layer_num = "0" + j;
|
||||
}
|
||||
|
||||
for (int i = 1; i < col_all + 1; i++) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("struct_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
|
||||
// 列
|
||||
String col_num = i + "";
|
||||
if (i < 10) {
|
||||
col_num = "0" + i;
|
||||
}
|
||||
|
||||
String struct_code = "L" + row + "-" + col_num + "-" + layer_num + "";
|
||||
|
||||
JSONObject jsonObject = tab2.query("stor_id = '1582991156504039455'").uniqueResult(0);
|
||||
JSONObject jsonObjec2 = tab3.query("stor_id = '1582991156504039455' and sect_code = 'BZC01'").uniqueResult(0);
|
||||
|
||||
// 新增仓位
|
||||
json.put("sect_id", jsonObjec2.getString("sect_id"));
|
||||
json.put("sect_code", jsonObjec2.getString("sect_code"));
|
||||
json.put("sect_name", jsonObjec2.getString("sect_name"));
|
||||
json.put("stor_id", jsonObject.getString("stor_id"));
|
||||
json.put("stor_code", jsonObject.getString("stor_code"));
|
||||
json.put("stor_name", jsonObject.getString("stor_name"));
|
||||
json.put("lock_type", "1");
|
||||
|
||||
json.put("row_num", row_num_now);
|
||||
json.put("col_num", i);
|
||||
json.put("layer_num", j);
|
||||
json.put("block_num", block_num);
|
||||
json.put("capacity", row_num);
|
||||
|
||||
json.put("struct_code",struct_code);
|
||||
json.put("struct_name",row + "排" + col_num+ "列"+ layer_num +"层");
|
||||
json.put("simple_name",json.getString("struct_name"));
|
||||
|
||||
json.put("in_order_seq", i);
|
||||
json.put("out_order_seq", i);
|
||||
json.put("in_empty_seq", i);
|
||||
json.put("out_empty_seq", i);
|
||||
json.put("zdepth", Integer.valueOf(zdepth));
|
||||
|
||||
json.put("create_id", "1");
|
||||
json.put("create_name", "管理员");
|
||||
json.put("create_time", DateUtil.now());
|
||||
json.put("material_height_type", 1);
|
||||
tab.insert(json);
|
||||
|
||||
// 新增点位
|
||||
JSONObject jsonPoint = new JSONObject();
|
||||
jsonPoint.put("point_id",IdUtil.getSnowflake(1,1).nextId());
|
||||
jsonPoint.put("point_code", json.getString("struct_code"));
|
||||
jsonPoint.put("point_name", json.getString("struct_name"));
|
||||
jsonPoint.put("region_id", json.getString("sect_id"));
|
||||
jsonPoint.put("region_code", json.getString("sect_code"));
|
||||
jsonPoint.put("region_name", json.getString("sect_name"));
|
||||
jsonPoint.put("point_type", "2");
|
||||
jsonPoint.put("point_status", "1");
|
||||
jsonPoint.put("lock_type", "1");
|
||||
jsonPoint.put("vehicle_max_qty", 0);
|
||||
jsonPoint.put("vehicle_qty", 0);
|
||||
jsonPoint.put("block_num", json.getBigDecimal("block_num"));
|
||||
jsonPoint.put("row_num", json.getBigDecimal("row_num"));
|
||||
jsonPoint.put("col_num", json.getBigDecimal("col_num"));
|
||||
jsonPoint.put("layer_num", json.getBigDecimal("layer_num"));
|
||||
jsonPoint.put("in_order_seq", i);
|
||||
jsonPoint.put("out_order_seq", i);
|
||||
jsonPoint.put("in_empty_seq", i);
|
||||
jsonPoint.put("out_empty_seq", i);
|
||||
jsonPoint.put("is_have_workder", "0");
|
||||
jsonPoint.put("is_used", "1");
|
||||
jsonPoint.put("source_id", json.get("struct_id"));
|
||||
jsonPoint.put("is_delete", "0");
|
||||
jsonPoint.put("create_id", "1");
|
||||
jsonPoint.put("create_name", "管理员");
|
||||
jsonPoint.put("create_time", DateUtil.now());
|
||||
tab4.insert(jsonPoint);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -232,4 +346,5 @@ public class Init implements ApplicationRunner {
|
||||
System.out.println("项目启动成功!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user