opt:代码优化

This commit is contained in:
2026-06-26 10:00:30 +08:00
parent 29460f0e76
commit 408eecf17a
3 changed files with 15 additions and 11 deletions

View File

@@ -129,9 +129,13 @@ public class PrintServiceImpl implements PrintService {
}
//查询这个客户的外包装标签打印份数
Integer num = 1;
Integer num;
try {
num = jsonCust.getInteger("outer_packaging_print_num");
if (null == jsonCust.getInteger("outer_packaging_print_num")) {
num = 1;
} else {
num = jsonCust.getInteger("outer_packaging_print_num");
}
} catch (Exception e) {
num = 1;
}

View File

@@ -187,10 +187,10 @@ public class ProductInstorServiceImpl implements ProductInstorService {
//查询仓库
JSONObject stor = new JSONObject();
if ("F001".equals(sub_jo.getString("ext_code"))) {
stor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("is_delete = '0' AND is_used = '1' AND is_productstore = '0' AND stor_code = 'F001'").uniqueResult(0);
} else if ("NC01".equals(sub_jo.getString("ext_code"))){
stor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("is_delete = '0' AND is_used = '1' AND is_productstore = '1' AND stor_code = 'NC01'").uniqueResult(0);
if ("BC01".equals(sub_jo.getString("ext_code"))) {
stor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("is_delete = '0' AND is_used = '1' AND is_productstore = '0' AND stor_code = 'BC01'").uniqueResult(0);
} else if ("F001".equals(sub_jo.getString("ext_code"))){
stor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("is_delete = '0' AND is_used = '1' AND is_productstore = '1' AND stor_code = 'F001'").uniqueResult(0);
}else {
stor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("is_delete = '0' AND is_used = '1' AND is_productstore = '1' ").uniqueResult(0);
}
@@ -212,7 +212,7 @@ public class ProductInstorServiceImpl implements ProductInstorService {
}
//判断是否虚拟
if (!"1".equals(is_virtual)) {
if ("F001".equals(sub_jo.getString("ext_code"))) {
if ("BC01".equals(sub_jo.getString("ext_code"))) {
throw new BadRequestException("二期仓库木箱,请进行虚拟入库!");
}
@@ -387,7 +387,7 @@ public class ProductInstorServiceImpl implements ProductInstorService {
String task_id = IdUtil.getSnowflake(1, 1).nextId() + "";
//直接分配虚拟区货位,并确认
if ("F001".equals(sub_jo.getString("ext_code"))) {
if ("BC01".equals(sub_jo.getString("ext_code"))) {
JSONObject jsonObject = WQLObject.getWQLObject("st_ivt_sectattr").query("sect_id = '" + whereJson.getString("sect_id") + "'")
.uniqueResult(0);
@@ -403,7 +403,7 @@ public class ProductInstorServiceImpl implements ProductInstorService {
}
//直接分配虚拟区货位,并确认
if ("NC01".equals(sub_jo.getString("ext_code"))) {
if ("F001".equals(sub_jo.getString("ext_code"))) {
JSONObject jsonObject = WQLObject.getWQLObject("st_ivt_sectattr").query("sect_id = '" + whereJson.getString("sect_id") + "'")
.uniqueResult(0);

View File

@@ -166,7 +166,7 @@ public class OutChargeServiceImpl implements OutChargeService {
JSONArray dis_rows = dis_wql.query("iostorinv_id = '" + whereJson.get("iostorinv_id") + "'").getResultJSONArray(0);
//生成手工入库单
String iostorinv_id = org.nl.common.utils.IdUtil.getLongId() + "";
String iostorinv_id = IdUtil.getLongId() + "";
String bill_code = CodeUtil.getNewCode("IO_CODE");
whereJson.put("iostorinv_id", iostorinv_id);
whereJson.put("bill_code", bill_code);
@@ -199,7 +199,7 @@ public class OutChargeServiceImpl implements OutChargeService {
ArrayList<String> ivtList = new ArrayList<>(); // 存在库存的集合
for (int i = 0; i < dis_rows.size(); i++) {
//插入明细表
String iostorinvdtl_id = org.nl.common.utils.IdUtil.getLongId() + "";
String iostorinvdtl_id = IdUtil.getLongId() + "";
JSONObject dis_row = dis_rows.getJSONObject(i);
// 校验是否存在库存