add:空托盘入库
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
package org.nl.start;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.sun.org.apache.bcel.internal.generic.GETSTATIC;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -15,7 +20,132 @@ import org.springframework.stereotype.Component;
|
||||
public class Init implements ApplicationRunner {
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
/* WQLObject tab = WQLObject.getWQLObject("ST_IVT_StructAttr");
|
||||
// initTwoAttr(4,30,3,2, "2");
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化二期仓位
|
||||
*/
|
||||
private void initTwoAttr(int row_num, int col_num, int layer_num, int block_num, String 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");
|
||||
|
||||
for (int j = 1; j < layer_num + 1; j++) {
|
||||
|
||||
// 层
|
||||
String layer_code = String.valueOf(j);
|
||||
String layer_name = String.valueOf(j);
|
||||
if (j < 10) {
|
||||
layer_code = "0" + j ;
|
||||
layer_name = "0" + j + "层";
|
||||
} else {
|
||||
layer_code = j + "" ;
|
||||
layer_name = j + "层";
|
||||
}
|
||||
|
||||
// 区
|
||||
String block_code = block_num + "0"+zdepth;
|
||||
String block_name = block_num + "0"+zdepth + "区";
|
||||
|
||||
for (int i = 1; i < col_num + 1; i++) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("struct_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
|
||||
// 排
|
||||
String row_code = String.valueOf(row_num);
|
||||
String row_name = String.valueOf(row_num);
|
||||
if (row_num <= 10) {
|
||||
row_code = "0" + String.valueOf(row_num) + "-";
|
||||
row_name = "0" + String.valueOf(row_num) + "排";
|
||||
} else {
|
||||
row_code = String.valueOf(row_num) + "-";
|
||||
row_name = String.valueOf(row_num) + "排";
|
||||
}
|
||||
|
||||
// 列
|
||||
String col_code = String.valueOf(i);
|
||||
String col_name = String.valueOf(i);
|
||||
if (i < 10) {
|
||||
col_code = "0" + i + "-";
|
||||
col_name = "0" + i + "列";
|
||||
} else {
|
||||
col_code = i + "-";
|
||||
col_name = i + "列";
|
||||
}
|
||||
|
||||
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);
|
||||
json.put("col_num", i);
|
||||
json.put("layer_num", j);
|
||||
json.put("block_num", block_num);
|
||||
|
||||
json.put("struct_code","B"+ block_code + row_code + col_code+ layer_code);
|
||||
json.put("struct_name","B"+ block_name + row_name + col_name+ layer_name);
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void createAttr() {
|
||||
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");
|
||||
@@ -98,7 +228,7 @@ public class Init implements ApplicationRunner {
|
||||
tab4.insert(jsonPoint);
|
||||
}
|
||||
|
||||
System.out.println("项目启动成功!");*/
|
||||
System.out.println("项目启动成功!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user