Merge remote-tracking branch 'origin/master'

This commit is contained in:
zhangzhiqiang
2023-02-04 09:08:02 +08:00
32 changed files with 3299 additions and 1710 deletions

View File

@@ -20,6 +20,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.*;
import java.util.HashMap;
/**
* @author liuxy
@@ -83,6 +84,7 @@ public class PrintServiceImpl implements PrintService {
String date_of_FG_inbound = jsonInbound.getString("date_of_fg_inbound");
//毛重
String box_weight = NumberUtil.round(box_jo.getString("box_weight"),2).toString();
// String box_weight = NumberUtil.round(box_jo.getString("real_weight"),2).toString();
//生产日期:取此箱子中最晚的生产日期
JSONObject jsonProduction = subTab.query("package_box_sn = '" + box_no + "' order by date_of_production DESC").uniqueResult(0);
String date_of_production = jsonProduction.getString("date_of_production");
@@ -211,7 +213,13 @@ public class PrintServiceImpl implements PrintService {
//入库日期:取此箱子中最晚的入库日期
JSONObject jsonInbound= subTab.query("package_box_sn = '" + box_no + "' order by date_of_fg_inbound DESC").uniqueResult(0);
String date_of_FG_inbound = jsonInbound.getString("date_of_fg_inbound");
//毛重
//更新实际重量
double real_weight = whereJson.getDoubleValue("box_weight");
HashMap<String, Object> map = new HashMap<>();
map.put("real_weight",real_weight);
subTab.update(map,"package_box_sn = '"+package_box_sn+"'");
String box_weight = NumberUtil.round(whereJson.getString("box_weight"),2).toString();
//生产日期:取此箱子中最晚的生产日期
JSONObject jsonProduction = subTab.query("package_box_sn = '" + box_no + "' order by date_of_production DESC").uniqueResult(0);

View File

@@ -852,21 +852,61 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
String out_order_seq = jsonDescBox.getString("out_order_seq");
// 上一个货位顺序号
String out_order_seq_desc = String.valueOf(NumberUtil.add(out_order_seq, "1"));
JSONObject jsonDescStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq = '"+out_order_seq_desc+"'").uniqueResult(0);
JSONObject jsonDescStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq = '" + out_order_seq_desc + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonDescStruct)) {
struct_jo = jsonDescStruct;
} else {
// 没有就正序找到第一个物料、判断上一个是否有货位
JSONObject jsonAscBox = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq ASC").uniqueResult(0);
String out_order_seq2 = jsonAscBox.getString("out_order_seq");
// 上一个货位顺序号
String out_order_seq_asc = String.valueOf(NumberUtil.sub(out_order_seq2, "1"));
JSONObject jsonAscStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq = '"+out_order_seq_asc+"'").uniqueResult(0);
// 说明这排有任务在执行,新开一排
//根据分切计划查询该订单物料大概还有多少未入
row_map.put("flag", "12");
JSONArray plan_rows = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(row_map).process().getResultJSONArray(0);
if (ObjectUtil.isEmpty(plan_rows)) {
plan_rows = new JSONArray();
}
//查询该销售订单及行号有多少个生成状态的箱子
row_map.put("flag", "27");
JSONArray box_rows = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(row_map).process().getResultJSONArray(0);
if (ObjectUtil.isEmpty(box_rows)) {
box_rows = new JSONArray();
}
int box_num = (int) Math.ceil(plan_rows.size() / 2) + box_rows.size();
//查询数量与订单物料箱子数量相近的一排
JSONObject empty_row = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("sect_id", sect_id).addParam("flag", "13").addParam("sql_str", " ORDER BY abs(" + box_num + "-a.struct_num),block_num,row_num").process().uniqueResult(0);
if (ObjectUtil.isNotEmpty(empty_row)) {
String block_num2 = empty_row.getString("block_num");
String row_num2 = empty_row.getString("row_num");
String placement_type2 = empty_row.getString("placement_type");
if (placement_type.equals("02")) {
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num2 + "' AND row_num = '" + row_num2 + "' AND placement_type = '" + placement_type2 + "' AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_order_seq ASC").uniqueResult(0);
} else {
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num2 + "' AND row_num = '" + row_num2 + "' AND placement_type = '" + placement_type2 + "'AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_order_seq DESC").uniqueResult(0);
}
} else {
//如果查询不到空的一排,则查询有空位双通的一排
JSONObject have_row = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("sect_id", sect_id).addParam("flag", "14").addParam("sql_str", " ORDER BY abs(" + box_num + "-a.struct_num)").process().uniqueResult(0);
if (ObjectUtil.isNotEmpty(have_row)) {
String block_num3 = have_row.getString("block_num");
String row_num3 = have_row.getString("row_num");
//判断该排是左边为空,还是右边为空
JSONObject right_str = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' order by out_order_seq").uniqueResult(0);
JSONObject left_str = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' order by out_order_seq desc").uniqueResult(0);
if (StrUtil.isNotEmpty(right_str.getString("storagevehicle_code")) || !right_str.getString("lock_type").equals("1")) {
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq").uniqueResult(0);
}
if (StrUtil.isNotEmpty(left_str.getString("storagevehicle_code")) || !left_str.getString("lock_type").equals("1")) {
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq desc").uniqueResult(0);
}
}
}
if (ObjectUtil.isNotEmpty(jsonAscStruct)) struct_jo = jsonAscStruct;
}
}
} else {
//如果不存在相同订单物料的巷道
@@ -904,7 +944,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND placement_type = '" + placement_type + "'AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_order_seq DESC").uniqueResult(0);
}
} else {
//如果查询不到空的一排,则查询有空位双通的一排
JSONObject have_row = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("sect_id", sect_id).addParam("flag", "14").addParam("sql_str", " ORDER BY abs(" + box_num + "-a.struct_num)").process().uniqueResult(0);