dev:改切出库支持多条明细推送,幅宽精度显示优化
This commit is contained in:
@@ -29,8 +29,8 @@ public class SapToLmsServiceImpl implements SapToLmsService {
|
||||
|
||||
|
||||
@Override
|
||||
public JSONObject getReCutInfo(JSONObject jo) {
|
||||
log.info("getReCutInfo的输入参数为:------------------------" + jo.toString());
|
||||
public JSONObject getReCutInfo(JSONObject json) {
|
||||
log.info("getReCutInfo的输入参数为:------------------------" + json.toString());
|
||||
|
||||
JSONObject jsonMst = new JSONObject();
|
||||
|
||||
@@ -38,7 +38,8 @@ public class SapToLmsServiceImpl implements SapToLmsService {
|
||||
|
||||
String msg = "改切出库单据推送成功!";
|
||||
try {
|
||||
String LGORT = jo.getString("LGORT");
|
||||
JSONArray dtl_ja = json.getJSONArray("ITEM");
|
||||
String LGORT = dtl_ja.getJSONObject(0).getString("LGORT");
|
||||
JSONObject stor_jo = WQLObject.getWQLObject("ST_IVT_BSRealStorAttr").query("ext_id = '" + LGORT + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(stor_jo)) {
|
||||
result.put("RTYPE", "E");
|
||||
@@ -51,7 +52,7 @@ public class SapToLmsServiceImpl implements SapToLmsService {
|
||||
jsonMst.put("stor_id", stor_jo.getString("stor_id"));
|
||||
jsonMst.put("stor_code", stor_jo.getString("stor_code"));
|
||||
jsonMst.put("stor_name", stor_jo.getString("stor_name"));
|
||||
jsonMst.put("detail_count", "1");
|
||||
jsonMst.put("detail_count", dtl_ja.size());
|
||||
jsonMst.put("bill_status", "10");
|
||||
jsonMst.put("create_mode", "03");
|
||||
jsonMst.put("bill_type", "1003");
|
||||
@@ -59,49 +60,55 @@ public class SapToLmsServiceImpl implements SapToLmsService {
|
||||
jsonMst.put("user", "sap");
|
||||
|
||||
JSONArray dtls = new JSONArray();
|
||||
String sap_pcsn = jo.getString("CHARG");
|
||||
if (StrUtil.isEmpty("sap_pcsn")) {
|
||||
throw new BadRequestException("请求参数SAP批次不能为空!");
|
||||
}
|
||||
JSONObject sub_jo = WQLObject.getWQLObject("PDM_BI_SubPackageRelation").query("sap_pcsn = '" + sap_pcsn + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(sub_jo)) {
|
||||
throw new BadRequestException("LMS中不存在SAP批次为【" + sap_pcsn + "】的包装关系");
|
||||
}
|
||||
String container_name = sub_jo.getString("container_name");
|
||||
JSONObject struct_ivt = WQLObject.getWQLObject("st_ivt_structivt").query("pcsn = '" + container_name + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(struct_ivt)) {
|
||||
throw new BadRequestException("SAP批次为【" + sap_pcsn + "】的成品卷不存在或已经出库!");
|
||||
} else {
|
||||
if (struct_ivt.getDoubleValue("frozen_qty") > 0) {
|
||||
msg = "SAP批次为【" + sap_pcsn + "】的成品卷已经被分配或出库中";
|
||||
}else {
|
||||
JSONObject dtl = new JSONObject();
|
||||
//查询该物料
|
||||
JSONObject mater_jo = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + sub_jo.getString("product_name") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(mater_jo)) {
|
||||
throw new BadRequestException("未查询到物料:" + sub_jo.getString("product_name") + ",信息!");
|
||||
}
|
||||
dtl.put("material_id", mater_jo.getString("material_id"));
|
||||
dtl.put("pcsn", container_name);
|
||||
dtl.put("box_no", sub_jo.getString("package_box_sn"));
|
||||
JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id = '" + mater_jo.getString("base_unit_id") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(unit)) {
|
||||
throw new BadRequestException("未查询到物料计量单位:" + mater_jo.getString("base_unit_id") + ",信息!");
|
||||
}
|
||||
dtl.put("qty_unit_id", unit.getString("measure_unit_id"));
|
||||
dtl.put("qty_unit_name", unit.getString("unit_name"));
|
||||
dtl.put("plan_qty", sub_jo.getString("net_weight"));
|
||||
dtls.add(dtl);
|
||||
|
||||
|
||||
jsonMst.put("tableData", dtls);
|
||||
String iostorinv_id = checkOutBillService.insertDtl(jsonMst);
|
||||
|
||||
//调用自动分配
|
||||
JSONObject out_jo = new JSONObject();
|
||||
out_jo.put("iostorinv_id", iostorinv_id);
|
||||
checkOutBillService.allDiv(out_jo);
|
||||
for (int i = 0; i < dtl_ja.size(); i++) {
|
||||
JSONObject jo = dtl_ja.getJSONObject(i);
|
||||
String sap_pcsn = jo.getString("CHARG");
|
||||
if (StrUtil.isEmpty("sap_pcsn")) {
|
||||
throw new BadRequestException("请求参数SAP批次不能为空!");
|
||||
}
|
||||
JSONObject sub_jo = WQLObject.getWQLObject("PDM_BI_SubPackageRelation").query("sap_pcsn = '" + sap_pcsn + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(sub_jo)) {
|
||||
throw new BadRequestException("LMS中不存在SAP批次为【" + sap_pcsn + "】的包装关系");
|
||||
}
|
||||
String container_name = sub_jo.getString("container_name");
|
||||
JSONObject struct_ivt = WQLObject.getWQLObject("st_ivt_structivt").query("pcsn = '" + container_name + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(struct_ivt)) {
|
||||
throw new BadRequestException("SAP批次为【" + sap_pcsn + "】的成品卷不存在或已经出库!");
|
||||
} else {
|
||||
if (struct_ivt.getDoubleValue("frozen_qty") > 0) {
|
||||
msg = "SAP批次为【" + sap_pcsn + "】的成品卷已经被分配或出库中";
|
||||
} else {
|
||||
JSONObject dtl = new JSONObject();
|
||||
//查询该物料
|
||||
JSONObject mater_jo = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + sub_jo.getString("product_name") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(mater_jo)) {
|
||||
throw new BadRequestException("未查询到物料:" + sub_jo.getString("product_name") + ",信息!");
|
||||
}
|
||||
dtl.put("material_id", mater_jo.getString("material_id"));
|
||||
dtl.put("pcsn", container_name);
|
||||
dtl.put("box_no", sub_jo.getString("package_box_sn"));
|
||||
JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id = '" + mater_jo.getString("base_unit_id") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(unit)) {
|
||||
throw new BadRequestException("未查询到物料计量单位:" + mater_jo.getString("base_unit_id") + ",信息!");
|
||||
}
|
||||
dtl.put("qty_unit_id", unit.getString("measure_unit_id"));
|
||||
dtl.put("qty_unit_name", unit.getString("unit_name"));
|
||||
dtl.put("plan_qty", sub_jo.getString("net_weight"));
|
||||
dtls.add(dtl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!dtls.isEmpty()){
|
||||
jsonMst.put("tableData", dtls);
|
||||
String iostorinv_id = checkOutBillService.insertDtl(jsonMst);
|
||||
|
||||
//调用自动分配
|
||||
JSONObject out_jo = new JSONObject();
|
||||
out_jo.put("iostorinv_id", iostorinv_id);
|
||||
checkOutBillService.allDiv(out_jo);
|
||||
}else {
|
||||
throw new BadRequestException("推送失败!SAP推送的子卷明细不符合出库状态!");
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
result.put("TYPE", "E");
|
||||
@@ -498,10 +505,12 @@ public class SapToLmsServiceImpl implements SapToLmsService {
|
||||
JSONObject jsonDtl = new JSONObject();
|
||||
|
||||
JSONObject jsonMater = materTab.query("material_code = '" + jsonObject.getString("MATNR") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonMater)) throw new BadRequestException("此物料不存在" + jsonObject.getString("MATNR"));
|
||||
if (ObjectUtil.isEmpty(jsonMater))
|
||||
throw new BadRequestException("此物料不存在" + jsonObject.getString("MATNR"));
|
||||
JSONObject jsonUnit = unitTab.query("measure_unit_id = '" + jsonMater.getString("base_unit_id") + "'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonObject.getString("KALAB"))) throw new BadRequestException("调拨数量不能为空!");
|
||||
if (ObjectUtil.isEmpty(jsonObject.getString("KALAB")))
|
||||
throw new BadRequestException("调拨数量不能为空!");
|
||||
if (ObjectUtil.isEmpty(jsonObject.getString("ZVBELN"))) throw new BadRequestException("订单不能为空!");
|
||||
|
||||
jsonDtl.put("material_id", jsonMater.getString("material_id"));
|
||||
|
||||
@@ -125,7 +125,7 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
||||
mst_jo.put("tableData", box_rows);
|
||||
mst_jo.put("biz_date", DateUtil.now());
|
||||
|
||||
RLock lock = redissonClient.getLock("pda_ioIn:" + option);
|
||||
RLock lock = redissonClient.getLock("pda_ioIn");
|
||||
boolean tryLock = lock.tryLock(5, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock) {
|
||||
|
||||
@@ -50,7 +50,7 @@ public class SlittingproductionplanDto implements Serializable {
|
||||
private String split_group;
|
||||
|
||||
/** 生产顺序 */
|
||||
private BigDecimal manufacture_sort;
|
||||
private String manufacture_sort;
|
||||
|
||||
/** 生产订单 */
|
||||
private String mfg_order_name;
|
||||
@@ -138,4 +138,7 @@ public class SlittingproductionplanDto implements Serializable {
|
||||
|
||||
/** 气涨轴编码 */
|
||||
private String qzzno;
|
||||
|
||||
/** 销售订单及行号 */
|
||||
private String sale_order_name;
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ public class OutBillQueryServiceImpl implements OutBillQueryService {
|
||||
mp.put("发货客户名称", json.getString("customer_description"));
|
||||
mp.put("销售订单", json.getString("sale_order_name"));
|
||||
mp.put("出库日期", json.getString("input_time"));
|
||||
mp.put("产品规格", json.getString("width"));
|
||||
mp.put("产品规格", String.format("%.0f", json.getDoubleValue("width")));
|
||||
mp.put("产品厚度", json.getString("thickness"));
|
||||
mp.put("单位面积", json.getString("mass_per_unit_area"));
|
||||
mp.put("制单人", json.getString("input_optname"));
|
||||
@@ -247,7 +247,7 @@ public class OutBillQueryServiceImpl implements OutBillQueryService {
|
||||
mp.put("发货客户名称", json.getString("customer_description"));
|
||||
mp.put("销售订单", json.getString("sale_order_name"));
|
||||
mp.put("出库日期", json.getString("input_time"));
|
||||
mp.put("产品规格", json.getIntValue("width"));
|
||||
mp.put("产品规格", String.format("%.0f", json.getDoubleValue("width")));
|
||||
mp.put("产品厚度", json.getString("thickness"));
|
||||
mp.put("单位面积", json.getString("mass_per_unit_area"));
|
||||
mp.put("制单人", json.getString("input_optname"));
|
||||
|
||||
@@ -380,44 +380,53 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="纸筒规格" prop="paper_tube_model">
|
||||
<el-input v-model="form.paper_tube_model" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="FRP管物料编码" prop="FRP_material">
|
||||
<el-input v-model="form.FRP_material" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="FRP管物料描述" prop="FRP_description">
|
||||
<el-input v-model="form.FRP_description" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="FRP管规格" prop="FRP_model">
|
||||
<el-input v-model="form.FRP_model" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="子卷幅宽" prop="split_breadth">
|
||||
<el-input v-model="form.split_breadth" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="子卷理论长度" prop="split_height">
|
||||
<el-input v-model="form.split_height" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="子卷理论重量" prop="split_weight">
|
||||
<el-input v-model="form.split_weight" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="销售订单及行号" prop="sale_order_name">
|
||||
<el-input v-model="form.sale_order_name" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
@@ -513,6 +522,7 @@ const defaultForm = {
|
||||
end_time: null,
|
||||
status: null,
|
||||
remark: null,
|
||||
sale_order_name: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
@@ -559,6 +569,18 @@ export default {
|
||||
container_name: [
|
||||
{ required: true, message: '子卷号不能为空', trigger: 'blur' }
|
||||
],
|
||||
split_weight: [
|
||||
{ required: true, message: '子卷理论重量不能为空', trigger: 'blur' }
|
||||
],
|
||||
split_breadth: [
|
||||
{ required: true, message: '子卷幅宽不能为空', trigger: 'blur' }
|
||||
],
|
||||
split_height: [
|
||||
{ required: true, message: '子卷长度不能为空', trigger: 'blur' }
|
||||
],
|
||||
sale_order_name: [
|
||||
{ required: true, message: '销售订单及行号不能为空', trigger: 'blur' }
|
||||
],
|
||||
product_name: [
|
||||
{ required: true, message: '产品编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
|
||||
@@ -83,6 +83,14 @@
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="120" label="销售订单及行号">
|
||||
<el-input
|
||||
v-model="query.sale_order_name"
|
||||
size="mini"
|
||||
clearable
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产区域">
|
||||
<el-select
|
||||
v-model="query.product_area"
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
<el-table-column show-overflow-tooltip prop="customer_description" label="发货客户名称" :min-width="flexWidth('customer_description',crud.data,'客户名称')" />
|
||||
<el-table-column show-overflow-tooltip prop="sale_order_name" label="销售订单" :min-width="flexWidth('sale_order_name',crud.data,'销售订单')" />
|
||||
<el-table-column show-overflow-tooltip prop="input_time" label="出库日期" :min-width="flexWidth('input_time',crud.data,'出库日期')" />
|
||||
<el-table-column show-overflow-tooltip prop="width" label="产品规格" :min-width="flexWidth('width',crud.data,'产品规格')" />
|
||||
<el-table-column show-overflow-tooltip prop="width" label="产品规格" :formatter="crud.formatNum0" :min-width="flexWidth('width',crud.data,'产品规格')" />
|
||||
<el-table-column show-overflow-tooltip prop="thickness" label="产品厚度" :min-width="flexWidth('thickness',crud.data,'产品厚度')" />
|
||||
<el-table-column show-overflow-tooltip prop="paper_type" label="管件类型" :min-width="flexWidth('paper_type',crud.data,'管件类型')" />
|
||||
<el-table-column show-overflow-tooltip prop="paper_code" label="管件编码" :min-width="flexWidth('paper_code',crud.data,'管件编码')" />
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
<el-table-column show-overflow-tooltip prop="customer_description" label="发货客户名称" :min-width="flexWidth('customer_description',crud.data,'客户名称')" />
|
||||
<el-table-column show-overflow-tooltip prop="sale_order_name" label="销售订单" :min-width="flexWidth('sale_order_name',crud.data,'销售订单')" />
|
||||
<el-table-column show-overflow-tooltip prop="input_time" label="出库日期" :min-width="flexWidth('input_time',crud.data,'出库日期')" />
|
||||
<el-table-column show-overflow-tooltip prop="width" label="产品规格" :min-width="flexWidth('width',crud.data,'产品规格')" />
|
||||
<el-table-column show-overflow-tooltip prop="width" label="产品规格" :formatter="crud.formatNum0" :min-width="flexWidth('width',crud.data,'产品规格')" />
|
||||
<el-table-column show-overflow-tooltip prop="thickness" label="产品厚度" :min-width="flexWidth('thickness',crud.data,'产品厚度')" />
|
||||
<el-table-column show-overflow-tooltip prop="paper_type" label="管件类型" :min-width="flexWidth('paper_type',crud.data,'管件类型')" />
|
||||
<el-table-column show-overflow-tooltip prop="paper_code" label="管件编码" :min-width="flexWidth('paper_code',crud.data,'管件编码')" />
|
||||
|
||||
Reference in New Issue
Block a user