|
|
@ -496,8 +496,14 @@ public class SapToWmsServiceImpl implements SapToWmsService { |
|
|
|
String matnr_begin = form.optString("matnr_begin"); |
|
|
|
String matnr_end = form.optString("matnr_end"); |
|
|
|
//如果查询未填入工厂编码,默认查1060
|
|
|
|
String werks_begin = form.optString("werks_begin","1060"); |
|
|
|
String werks_end = form.optString("werks_end","1060"); |
|
|
|
String werks_begin = form.optString("werks_begin"); |
|
|
|
if (uString.isBlank(werks_begin)) { |
|
|
|
werks_begin = "1060"; |
|
|
|
} |
|
|
|
String werks_end = form.optString("werks_end"); |
|
|
|
if (uString.isBlank(werks_end)) { |
|
|
|
werks_end = "1060"; |
|
|
|
} |
|
|
|
String lgort_begin = form.optString("lgort_begin"); |
|
|
|
String lgort_end = form.optString("lgort_end"); |
|
|
|
|
|
|
@ -777,7 +783,7 @@ public class SapToWmsServiceImpl implements SapToWmsService { |
|
|
|
// 新增
|
|
|
|
wo_SAP_Mater.insert(joi); |
|
|
|
|
|
|
|
JSONObject jo = MD_ME_MaterialBase.query("material_code='" + MATNR + "'").uniqueResult(0); |
|
|
|
JSONObject jo = MD_ME_MaterialBase.query("sysisdelete='0' and material_code='" + MATNR + "'").uniqueResult(0); |
|
|
|
|
|
|
|
String datanow = WDK.getDateTime(); |
|
|
|
if (jo == null) {// 新增
|
|
|
@ -789,8 +795,13 @@ public class SapToWmsServiceImpl implements SapToWmsService { |
|
|
|
JSONObject unit = WQLObject.getWQLObject("MD_PB_MeasureUnit") |
|
|
|
.query("unit_name = '" + joi.optString("MEINS") + "'").uniqueResult(0); |
|
|
|
jo.put("base_unit_uuid", unit.optString("measure_unit_uuid")); |
|
|
|
|
|
|
|
String GEWEI = joi.optString("GEWEI"); |
|
|
|
if (uString.isBlank(GEWEI)) { |
|
|
|
GEWEI = "KG"; |
|
|
|
} |
|
|
|
JSONObject weight_unit = WQLObject.getWQLObject("MD_PB_MeasureUnit") |
|
|
|
.query("unit_name = '" + joi.optString("GEWEI","KG") + "'").uniqueResult(0); |
|
|
|
.query("unit_name = '" + GEWEI + "'").uniqueResult(0); |
|
|
|
if(weight_unit==null||weight_unit.isNullObject()){ |
|
|
|
jo.put("weight_unit_uuid", "EFA1CBA910AF4EBFA7246DBA89C73058"); |
|
|
|
}else{ |
|
|
@ -806,8 +817,13 @@ public class SapToWmsServiceImpl implements SapToWmsService { |
|
|
|
jo.put("salver_limit_height", "0"); |
|
|
|
jo.put("salver_qty", "0"); |
|
|
|
jo.put("net_weight", joi.optString("NTGEW")); |
|
|
|
|
|
|
|
String LGORT2 = joi.optString("LGORT"); |
|
|
|
if (uString.isBlank(LGORT2)) { |
|
|
|
LGORT2 = "-1"; |
|
|
|
} |
|
|
|
JSONObject sect = WQLObject.getWQLObject("ST_BS_SectAttr") |
|
|
|
.query("ext_id = '" + joi.optString("LGORT") + "'").uniqueResult(0); |
|
|
|
.query("sysisdelete='0' and ext_id = '" + LGORT2 + "'").uniqueResult(0); |
|
|
|
if (sect == null) { |
|
|
|
sect = new JSONObject(); |
|
|
|
sect.put("sect_type", ""); |
|
|
@ -854,16 +870,25 @@ public class SapToWmsServiceImpl implements SapToWmsService { |
|
|
|
JSONObject unit = WQLObject.getWQLObject("MD_PB_MeasureUnit") |
|
|
|
.query("unit_name = '" + joi.optString("MEINS") + "'").uniqueResult(0); |
|
|
|
jo.put("base_unit_uuid", unit.optString("measure_unit_uuid")); |
|
|
|
|
|
|
|
String GEWEI = joi.optString("GEWEI"); |
|
|
|
if (uString.isBlank(GEWEI)) { |
|
|
|
GEWEI = "KG"; |
|
|
|
} |
|
|
|
JSONObject weight_unit = WQLObject.getWQLObject("MD_PB_MeasureUnit") |
|
|
|
.query("unit_name = '" + joi.optString("GEWEI","KG") + "'").uniqueResult(0); |
|
|
|
.query("unit_name = '" + GEWEI + "'").uniqueResult(0); |
|
|
|
if(weight_unit==null||weight_unit.isNullObject()){ |
|
|
|
jo.put("weight_unit_uuid", "EFA1CBA910AF4EBFA7246DBA89C73058"); |
|
|
|
}else{ |
|
|
|
jo.put("weight_unit_uuid", weight_unit.optString("measure_unit_uuid")); |
|
|
|
} |
|
|
|
jo.put("net_weight", joi.optString("NTGEW")); |
|
|
|
String LGORT2 = joi.optString("LGORT"); |
|
|
|
if (uString.isBlank(LGORT2)) { |
|
|
|
LGORT2 = "-1"; |
|
|
|
} |
|
|
|
JSONObject sect = WQLObject.getWQLObject("ST_BS_SectAttr") |
|
|
|
.query("ext_id = '" + joi.optString("LGORT") + "'").uniqueResult(0); |
|
|
|
.query("sysisdelete='0' and ext_id = '" + LGORT2 + "'").uniqueResult(0); |
|
|
|
if (sect == null) { |
|
|
|
sect = new JSONObject(); |
|
|
|
sect.put("sect_type", ""); |
|
|
|