123
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>llsh_wms</artifactId>
|
<artifactId>llsh_wms</artifactId>
|
||||||
<groupId>org.nl</groupId>
|
<groupId>org.nl</groupId>
|
||||||
|
|||||||
@@ -140,8 +140,8 @@ public class Test3 extends BaseTest {
|
|||||||
iodObject.put("col_num", structObject.getString("col"));
|
iodObject.put("col_num", structObject.getString("col"));
|
||||||
iodObject.put("layer_num", structObject.getString("layer"));
|
iodObject.put("layer_num", structObject.getString("layer"));
|
||||||
iodObject.put("height", 10);
|
iodObject.put("height", 10);
|
||||||
iodObject.put("out_seq_no", i*10);
|
iodObject.put("out_seq_no", i * 10);
|
||||||
iodObject.put("in_seq_no", i*10);
|
iodObject.put("in_seq_no", i * 10);
|
||||||
iodObject.put("load_series", 1);
|
iodObject.put("load_series", 1);
|
||||||
iodObject.put("create_id", 1);
|
iodObject.put("create_id", 1);
|
||||||
iodObject.put("create_name", "管理员");
|
iodObject.put("create_name", "管理员");
|
||||||
@@ -241,26 +241,137 @@ public class Test3 extends BaseTest {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//初始化入窑缓存货架
|
||||||
@Test
|
@Test
|
||||||
public void syncStruct4() {
|
public void syncStruct4() {
|
||||||
JSONArray structArray = WQLObject.getWQLObject("st_ivt_structattr").query("is_delete='0'").getResultJSONArray(0);
|
WQLObject structTable = WQLObject.getWQLObject("st_ivt_structattr");
|
||||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_structrelavehicletype");
|
for (int i = 1; i < 4; i++) {
|
||||||
String now = DateUtil.now();
|
for (int j = 1; j < 7; j++) {
|
||||||
for (int i = 0; i < structArray.size(); i++) {
|
for (int k = 1; k < 3; k++) {
|
||||||
for (int j = 1; j <= 3; j++) {
|
String struct_id = IdUtil.getSnowflake(1, 1).nextIdStr();
|
||||||
JSONObject jsonObject = structArray.getJSONObject(i);
|
String struct_code = "L" + i + "-" + j + "-" + k;
|
||||||
JSONObject map = new JSONObject();
|
String struct_name = 1 + "排" + j + "列" + k + "层";
|
||||||
map.put("relation_id", String.valueOf(IdUtil.getSnowflake(1, 1).nextId()));
|
String simple_name = struct_name;
|
||||||
map.put("struct_id", jsonObject.getString("struct_id"));
|
String sect_id = "1518109502010953728";
|
||||||
map.put("vehicle_type", "0" + j);
|
String stor_id = "1518109007364100096";
|
||||||
map.put("create_id", 1);
|
String row_seq = i + "";
|
||||||
map.put("create_name", "管理员");
|
String col = j + "";
|
||||||
map.put("create_time", now);
|
String layer = j + "";
|
||||||
map.put("update_optid", 1);
|
String is_used = "1";
|
||||||
map.put("update_optname", "管理员");
|
String is_delete = "0";
|
||||||
map.put("update_time", now);
|
String create_id = "1";
|
||||||
wo.insert(map);
|
String create_name = "qinx";
|
||||||
|
String create_time = DateUtil.now();
|
||||||
|
JSONObject jo = new JSONObject();
|
||||||
|
jo.put("struct_id", struct_id);
|
||||||
|
jo.put("struct_code", struct_code);
|
||||||
|
jo.put("struct_name", struct_name);
|
||||||
|
jo.put("simple_name", simple_name);
|
||||||
|
jo.put("sect_id", sect_id);
|
||||||
|
jo.put("stor_id", stor_id);
|
||||||
|
jo.put("row_seq", row_seq);
|
||||||
|
jo.put("col", col);
|
||||||
|
jo.put("layer", layer);
|
||||||
|
jo.put("is_used", is_used);
|
||||||
|
jo.put("is_delete", is_delete);
|
||||||
|
jo.put("create_id", create_id);
|
||||||
|
jo.put("create_name", create_name);
|
||||||
|
jo.put("create_time", create_time);
|
||||||
|
structTable.insert(jo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//初始化成品货架
|
||||||
|
@Test
|
||||||
|
public void syncStruct5() {
|
||||||
|
WQLObject structTable = WQLObject.getWQLObject("st_ivt_structattr");
|
||||||
|
for (int i = 4; i < 5; i++) {
|
||||||
|
for (int j = 1; j < 19; j++) {
|
||||||
|
for (int k = 1; k < 3; k++) {
|
||||||
|
String struct_id = IdUtil.getSnowflake(1, 1).nextIdStr();
|
||||||
|
String struct_code = "L" + i + "-" + j + "-" + k;
|
||||||
|
String struct_name = i + "排" + j + "列" + k + "层";
|
||||||
|
String simple_name = struct_name;
|
||||||
|
String sect_id = "1518109805401739264";
|
||||||
|
String stor_id = "1518109007364100096";
|
||||||
|
String row_seq = i + "";
|
||||||
|
String col = j + "";
|
||||||
|
String layer = j + "";
|
||||||
|
String is_used = "1";
|
||||||
|
String is_delete = "0";
|
||||||
|
String create_id = "1";
|
||||||
|
String create_name = "qinx";
|
||||||
|
String create_time = DateUtil.now();
|
||||||
|
JSONObject jo = new JSONObject();
|
||||||
|
jo.put("struct_id", struct_id);
|
||||||
|
jo.put("struct_code", struct_code);
|
||||||
|
jo.put("struct_name", struct_name);
|
||||||
|
jo.put("simple_name", simple_name);
|
||||||
|
jo.put("sect_id", sect_id);
|
||||||
|
jo.put("stor_id", stor_id);
|
||||||
|
jo.put("row_seq", row_seq);
|
||||||
|
jo.put("col", col);
|
||||||
|
jo.put("layer", layer);
|
||||||
|
jo.put("is_used", is_used);
|
||||||
|
jo.put("is_delete", is_delete);
|
||||||
|
jo.put("create_id", create_id);
|
||||||
|
jo.put("create_name", create_name);
|
||||||
|
jo.put("create_time", create_time);
|
||||||
|
structTable.insert(jo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//初始化分配规则
|
||||||
|
@Test
|
||||||
|
public void syncStruct6() {
|
||||||
|
WQLObject structTable = WQLObject.getWQLObject("st_ivt_structattr");
|
||||||
|
WQLObject ruleTable = WQLObject.getWQLObject("st_rule_iodisstruct");
|
||||||
|
JSONArray arr = structTable.query("1=1").getResultJSONArray(0);
|
||||||
|
for (int i = 0; i < arr.size(); i++) {
|
||||||
|
JSONObject jo = arr.getJSONObject(i);
|
||||||
|
String disrule_uuid = IdUtil.getSnowflake(1, 1).nextIdStr();
|
||||||
|
String disrule_type = "00";
|
||||||
|
String struct_uuid = jo.getString("struct_id");
|
||||||
|
String struct_code = jo.getString("struct_code");
|
||||||
|
String struct_name = jo.getString("struct_name");
|
||||||
|
String sect_uuid = jo.getString("sect_id");
|
||||||
|
String store_uuid = jo.getString("store_id");
|
||||||
|
String row_num = jo.getString("row_seq");
|
||||||
|
String col_num = jo.getString("col");
|
||||||
|
String layer_num = jo.getString("layer");
|
||||||
|
String height = "10";
|
||||||
|
String out_seq_no = i * 10 + "";
|
||||||
|
String in_seq_no = i * 10 + "";
|
||||||
|
String load_series = "10";
|
||||||
|
String create_time = DateUtil.now();
|
||||||
|
String create_name = "qinx";
|
||||||
|
String create_id = "1";
|
||||||
|
JSONObject joObj = new JSONObject();
|
||||||
|
joObj.put("create_id", create_id);
|
||||||
|
joObj.put("create_name", create_name);
|
||||||
|
joObj.put("create_time", create_time);
|
||||||
|
joObj.put("load_series", load_series);
|
||||||
|
joObj.put("in_seq_no", in_seq_no);
|
||||||
|
joObj.put("out_seq_no", out_seq_no);
|
||||||
|
joObj.put("height", height);
|
||||||
|
joObj.put("layer_num", layer_num);
|
||||||
|
joObj.put("sect_uuid", sect_uuid);
|
||||||
|
joObj.put("col_num", col_num);
|
||||||
|
joObj.put("row_num", row_num);
|
||||||
|
joObj.put("store_uuid", store_uuid);
|
||||||
|
joObj.put("struct_name", struct_name);
|
||||||
|
joObj.put("struct_code", struct_code);
|
||||||
|
joObj.put("struct_uuid", struct_uuid);
|
||||||
|
joObj.put("disrule_type", disrule_type);
|
||||||
|
joObj.put("disrule_uuid", disrule_uuid);
|
||||||
|
ruleTable.insert(joObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package org.nl.mongodb;
|
||||||
|
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
class Tx {
|
||||||
|
static int[] arr = {100,50,20,5,1}; //用来存纸币面额
|
||||||
|
static int[] num = new int[5]; //每种纸币的数量
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
Scanner sc = new Scanner(System.in);
|
||||||
|
int n = sc.nextInt();
|
||||||
|
|
||||||
|
f(n);
|
||||||
|
|
||||||
|
for (int i = 0; i < arr.length; i++) {
|
||||||
|
System.out.println(arr[i]+":"+num[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static void f(int n) {
|
||||||
|
//遍历arr数组
|
||||||
|
for (int i = 0; i < arr.length; i++) {
|
||||||
|
// 求出每类纸币需要多少张
|
||||||
|
num[i] = n / arr[i];
|
||||||
|
n = n % arr[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user