This commit is contained in:
2022-12-05 17:30:38 +08:00
parent f8144305f2
commit 30f864d37b
4 changed files with 238 additions and 151 deletions

View File

@@ -39,13 +39,13 @@ public class SapToLmsServiceImpl implements SapToLmsService {
for (int i = 0; i < rows.size(); i++) { for (int i = 0; i < rows.size(); i++) {
JSONObject row = rows.getJSONObject(i); JSONObject row = rows.getJSONObject(i);
String MATNR = row.getString("MATNR"); String MATNR = row.getString("MATNR");
if (StrUtil.isEmpty(MATNR)){ if (StrUtil.isEmpty(MATNR)) {
throw new BadRequestException("物料编码不能为空!"); throw new BadRequestException("物料编码不能为空!");
} }
JSONObject mater_jo = WQLObject.getWQLObject("md_me_materialbaseext").query("MATNR ='"+MATNR+"'").uniqueResult(0); JSONObject mater_jo = WQLObject.getWQLObject("md_me_materialbaseext").query("MATNR ='" + MATNR + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(mater_jo)){ if (ObjectUtil.isEmpty(mater_jo)) {
WQLObject.getWQLObject("md_me_materialbaseext").insert(row); WQLObject.getWQLObject("md_me_materialbaseext").insert(row);
}else { } else {
WQLObject.getWQLObject("md_me_materialbaseext").update(row); WQLObject.getWQLObject("md_me_materialbaseext").update(row);
} }
} }
@@ -69,16 +69,33 @@ public class SapToLmsServiceImpl implements SapToLmsService {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
try { try {
JSONArray item = jo.getJSONArray("ITEM"); JSONArray items = jo.getJSONArray("ITEM");
HashMap<String, JSONArray> mst_rows = new HashMap<>();
for (int i = 0; i < items.size(); i++) {
JSONObject dtl = items.getJSONObject(i);
String vbeln = dtl.getString(" ");
if (mst_rows.containsKey(vbeln)) {
JSONArray objects = mst_rows.get(vbeln);
objects.add(dtl);
mst_rows.put(vbeln, objects);
} else {
JSONArray objects = new JSONArray();
objects.add(dtl);
mst_rows.put(vbeln, objects);
}
}
for (String s : mst_rows.keySet()) {
JSONArray item = mst_rows.get(s);
JSONObject jsonMst = new JSONObject(); JSONObject jsonMst = new JSONObject();
//获取SAP的存储地点 //获取SAP的存储地点
String LGORT = item.getJSONObject(0).getString("LGORT"); String LGORT = item.getJSONObject(0).getString("LGORT");
JSONObject stor_jo = WQLObject.getWQLObject("ST_IVT_BSRealStorAttr").query("ext_id = '"+LGORT+"'").uniqueResult(0); JSONObject stor_jo = WQLObject.getWQLObject("ST_IVT_BSRealStorAttr").query("ext_id = '" + LGORT + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(stor_jo)){ if (ObjectUtil.isEmpty(stor_jo)) {
result.put("RTYPE", "E"); result.put("RTYPE", "E");
result.put("RTMSG", "操作失败!" + "未查询到外部标识为:"+LGORT+"对应的仓库!"); result.put("RTMSG", "操作失败!" + "未查询到外部标识为:" + LGORT + "对应的仓库!");
result.put("RTOAL", 1); result.put("RTOAL", 1);
result.put("RTDAT", null); result.put("RTDAT", null);
return result; return result;
@@ -221,6 +238,8 @@ public class SapToLmsServiceImpl implements SapToLmsService {
jsonMst.put("bill_status", "30"); jsonMst.put("bill_status", "30");
rawAssistIStorService.insertDtl(jsonMst); rawAssistIStorService.insertDtl(jsonMst);
} }
}
} catch (Exception e) { } catch (Exception e) {
result.put("RTYPE", "E"); result.put("RTYPE", "E");
result.put("RTMSG", "操作失败!" + e.getMessage()); result.put("RTMSG", "操作失败!" + e.getMessage());

View File

@@ -158,7 +158,7 @@ public class ChangeServiceImpl implements ChangeService {
HashMap<String, HashMap> set = new HashMap<>(); HashMap<String, HashMap> set = new HashMap<>();
for (int i = 0; i < rows.size(); i++) { for (int i = 0; i < rows.size(); i++) {
HashMap row = rows.get(i); HashMap row = rows.get(i);
String package_box_sn = (String) row.get("package_box_sn"); String package_box_sn = (String) row.get("storagevehicle_code");
if (set.containsKey(package_box_sn)) { if (set.containsKey(package_box_sn)) {
continue; continue;
} else { } else {

View File

@@ -128,7 +128,54 @@
/> />
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-card class="box-card" shadow="never" :body-style="{padding:'20px 20px 0 20px'}" style="margin-top: 5px;">
<el-form ref="form2" :inline="true" :model="form" :rules="rules" size="mini">
<el-form-item label="销售订单-" prop="new_sale_order_name">
<el-input v-model="form.new_sale_order_name" class="input-with-select"/>
</el-form-item>
<el-form-item label="客户编码-" prop="new_sale_order_name">
<el-input v-model="form.new_customer_name" class="input-with-select"/>
</el-form-item>
<el-form-item label="客户描述-" prop="form.new_sale_order_name">
<el-input v-model="form.new_customer_description" class="input-with-select"/>
</el-form-item>
<el-form-item label="交货日期-" prop="demand_date">
<el-date-picker
v-model="form.demand_date"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
<el-form-item label="制造日期-" prop="date_of_fg_inbound">
<el-date-picker
v-model="form.date_of_fg_inbound"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
<el-form-item label="更换外包装标签" prop="isreprintpackageboxlabel">
<el-switch
v-model="form.isreprintpackageboxlabel"
active-value="1"
inactive-value="0"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</el-form-item>
<el-form-item label="更换子卷标签" prop="isunpackbox">
<el-switch
v-model="form.isunpackbox"
active-value="1"
inactive-value="0"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</el-form-item>
</el-form>
<el-button class="filter-item" @click="allSend()" size="medium" icon="el-icon-plus" style="float: right; padding: 3px 0" type="warning">一键填充</el-button>
</el-card>
<div class="crud-opts2"> <div class="crud-opts2">
<span class="role-span">变更明细</span> <span class="role-span">变更明细</span>
<span v-if="crud.status.cu > 0" class="crud-opts-right2"> <span v-if="crud.status.cu > 0" class="crud-opts-right2">
@@ -299,6 +346,10 @@ const defaultForm = {
remark: '', remark: '',
biz_date: new Date(), biz_date: new Date(),
create_mode: '', create_mode: '',
demand_date: '',
new_customer_description: '',
new_customer_name: '',
new_sale_order_name: '',
tableData: [] tableData: []
} }
export default { export default {
@@ -461,6 +512,23 @@ export default {
this.storId = this.form.stor_id this.storId = this.form.stor_id
this.dtlShow = true this.dtlShow = true
}, },
allSend() {
if (this.form.tableData.length === 0) {
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
for (let i = 0; i < this.form.tableData.length; i++) {
this.$set(this.form.tableData[i], 'new_sale_order_name', this.form.new_sale_order_name)
this.$set(this.form.tableData[i], 'new_customer_name', this.form.new_customer_name)
this.$set(this.form.tableData[i], 'new_customer_description', this.form.new_customer_description)
this.$set(this.form.tableData[i], 'demand_date', this.form.demand_date)
this.$set(this.form.tableData[i], 'date_of_fg_inbound', this.form.date_of_fg_inbound)
this.$set(this.form.tableData[i], 'isunpackbox', this.form.isunpackbox)
this.$set(this.form.tableData[i], 'isreprintpackageboxlabel', this.form.isreprintpackageboxlabel)
this.form.tableData.splice(i, 1, this.form.tableData[i]) // 通过splice 替换数据 触发视图更新
}
},
async queryStruct(index, row) { async queryStruct(index, row) {
this.structShow = true this.structShow = true
this.$refs.child.getMsg(false) this.$refs.child.getMsg(false)
@@ -564,12 +632,12 @@ export default {
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO) this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
return false return false
} }
for (let i = 0; i < this.form.tableData.length; i++) { /* for (let i = 0; i < this.form.tableData.length; i++) {
if (!this.form.tableData[i].edit) { if (!this.form.tableData[i].edit) {
this.crud.notify('尚有未完成编辑的物料明细序号' + (i + 1) + ',请检查!') this.crud.notify('尚有未完成编辑的物料明细序号' + (i + 1) + ',请检查!')
return false return false
} }
} }*/
} }
} }
} }

View File

@@ -106,7 +106,7 @@
@current-change="handleDtlCurrentChange" @current-change="handleDtlCurrentChange"
> >
<el-table-column type="index" label="序号" width="55" align="center" /> <el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column prop="bill_code" label="出库单号" align="center" width="100"/> <el-table-column prop="bill_code" label="出库单号" align="center" width="120"/>
<el-table-column :formatter="bill_statusFormat" prop="bill_status" label="状态" /> <el-table-column :formatter="bill_statusFormat" prop="bill_status" label="状态" />
<el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="物料编码" align="center" /> <el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" /> <el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />