Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -11,6 +11,7 @@ export default {
|
|||||||
'Endpoint_two': 'Endpoint Two',
|
'Endpoint_two': 'Endpoint Two',
|
||||||
'Material': 'Material',
|
'Material': 'Material',
|
||||||
'Quantity': 'Quantity',
|
'Quantity': 'Quantity',
|
||||||
|
'agv_action_type': 'The type of AGV secondary distribution',
|
||||||
'Numbering': 'Numbering',
|
'Numbering': 'Numbering',
|
||||||
'Value': 'Value',
|
'Value': 'Value',
|
||||||
'Input_task_instruction_number': 'Enter Task Number Or Instruction Number',
|
'Input_task_instruction_number': 'Enter Task Number Or Instruction Number',
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ export default {
|
|||||||
'Transit_point': 'Titik transit',
|
'Transit_point': 'Titik transit',
|
||||||
'Endpoint_two': 'Titik Akhir Dua',
|
'Endpoint_two': 'Titik Akhir Dua',
|
||||||
'Material': 'Bahan',
|
'Material': 'Bahan',
|
||||||
'Quantity': 'Jumlah',
|
'Quantity': 'Jenis distribusi sekunder AGV',
|
||||||
|
'agv_action_type': 'agv二次分配类型',
|
||||||
'Numbering': 'Nomor',
|
'Numbering': 'Nomor',
|
||||||
'Value': 'Nilai',
|
'Value': 'Nilai',
|
||||||
'Input_task_instruction_number': 'Masukkan Nomor Tugas Atau Nomor Instruksi',
|
'Input_task_instruction_number': 'Masukkan Nomor Tugas Atau Nomor Instruksi',
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ export default {
|
|||||||
'Endpoint_two': '终点2',
|
'Endpoint_two': '终点2',
|
||||||
'Material': '物料',
|
'Material': '物料',
|
||||||
'Quantity': '数量',
|
'Quantity': '数量',
|
||||||
|
'agv_action_type': 'agv二次分配类型',
|
||||||
'Numbering': '编号',
|
'Numbering': '编号',
|
||||||
'Value': '值',
|
'Value': '值',
|
||||||
'Input_task_instruction_number': '输入任务号或指令号',
|
'Input_task_instruction_number': '输入任务号或指令号',
|
||||||
|
|||||||
@@ -275,9 +275,9 @@
|
|||||||
@selection-change="crud.selectionChangeHandler"
|
@selection-change="crud.selectionChangeHandler"
|
||||||
>
|
>
|
||||||
<el-table-column v-if="false" prop="task_id" label="任务标识" />
|
<el-table-column v-if="false" prop="task_id" label="任务标识" />
|
||||||
<el-table-column prop="task_code" :label="$t('task.txt_box.Task_code')" />
|
<el-table-column prop="task_code" :label="$t('task.txt_box.Task_code')" :min-width="flexWidth('task_code',crud.data,$t('task.txt_box.Task_code'))" />
|
||||||
<el-table-column prop="vehicle_code" :label="$t('task.txt_box.Vehicle_number')" />
|
<el-table-column prop="vehicle_code" :label="$t('task.txt_box.Vehicle_number')" />
|
||||||
<el-table-column prop="task_type" :label="$t('task.txt_box.Task_type')" :min-width="flexWidth('task_type',crud.data,$t('task.txt_box.Task_type'))">
|
<el-table-column prop="task_type" :label="$t('task.txt_box.Task_type')" width="100px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ dict.label.task_type[scope.row.task_type] }}
|
{{ dict.label.task_type[scope.row.task_type] }}
|
||||||
</template>
|
</template>
|
||||||
@@ -290,9 +290,9 @@
|
|||||||
<span v-if="scope.row.task_status=='3' ">{{ $t('task.select.Cancel') }}</span>
|
<span v-if="scope.row.task_status=='3' ">{{ $t('task.select.Cancel') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="priority" :label="$t('TaskRecord.table.Priority')" />
|
<el-table-column prop="priority" :label="$t('TaskRecord.table.Priority')" :min-width="flexWidth('priority',crud.data,$t('TaskRecord.table.Priority'))" />
|
||||||
<el-table-column prop="start_point_code" :label="$t('task.select.Start_point')" />
|
<el-table-column prop="start_point_code" :label="$t('task.select.Start_point')" :min-width="flexWidth('start_point_code',crud.data,$t('task.select.Start_point'))" />
|
||||||
<el-table-column prop="next_point_code" :label="$t('task.select.Destination')" />
|
<el-table-column prop="next_point_code" :label="$t('task.select.Destination')" :min-width="flexWidth('next_point_code',crud.data,$t('task.select.Destination'))" />
|
||||||
<el-table-column prop="start_point_code2" :label="$t('TaskRecord.table.Starting_point_two')" :min-width="flexWidth('start_point_code2',crud.data,$t('TaskRecord.table.Starting_point_two'))" />
|
<el-table-column prop="start_point_code2" :label="$t('TaskRecord.table.Starting_point_two')" :min-width="flexWidth('start_point_code2',crud.data,$t('TaskRecord.table.Starting_point_two'))" />
|
||||||
<el-table-column prop="next_point_code2" :label="$t('TaskRecord.table.Endpoint_two')" :min-width="flexWidth('next_point_code2',crud.data,$t('TaskRecord.table.Endpoint_two'))" />
|
<el-table-column prop="next_point_code2" :label="$t('TaskRecord.table.Endpoint_two')" :min-width="flexWidth('next_point_code2',crud.data,$t('TaskRecord.table.Endpoint_two'))" />
|
||||||
<el-table-column prop="interaction_json" :label="$t('task.select.Interaction_json')" :show-overflow-tooltip="true" width="150px" />
|
<el-table-column prop="interaction_json" :label="$t('task.select.Interaction_json')" :show-overflow-tooltip="true" width="150px" />
|
||||||
@@ -301,6 +301,8 @@
|
|||||||
<el-table-column prop="remark" :label="$t('task.select.Remark')" />
|
<el-table-column prop="remark" :label="$t('task.select.Remark')" />
|
||||||
<el-table-column prop="create_by" :label="$t('task.select.Creator')" />
|
<el-table-column prop="create_by" :label="$t('task.select.Creator')" />
|
||||||
<el-table-column prop="create_time" :label="$t('task.select.Create_time')" width="135" />
|
<el-table-column prop="create_time" :label="$t('task.select.Create_time')" width="135" />
|
||||||
|
<el-table-column prop="update_by" :label="$t('TaskRecord.table.Update_by')" :min-width="flexWidth('update_by',crud.data,$t('TaskRecord.table.Update_by'))" />
|
||||||
|
<el-table-column prop="update_time" :label="$t('TaskRecord.table.Update_time')" :min-width="flexWidth('update_time',crud.data,$t('task.select.Update_time'))" />
|
||||||
</el-table>
|
</el-table>
|
||||||
<!--分页组件-->
|
<!--分页组件-->
|
||||||
<pagination />
|
<pagination />
|
||||||
@@ -330,7 +332,6 @@ const defaultForm = {
|
|||||||
start_point_code: null,
|
start_point_code: null,
|
||||||
start_device_code: null,
|
start_device_code: null,
|
||||||
next_point_code: null,
|
next_point_code: null,
|
||||||
start_point_code: null,
|
|
||||||
remark: null,
|
remark: null,
|
||||||
material: null,
|
material: null,
|
||||||
route_plan_code: 'normal',
|
route_plan_code: 'normal',
|
||||||
|
|||||||
@@ -123,7 +123,7 @@
|
|||||||
<el-table-column v-if="false" prop="task_id" label="任务标识" />
|
<el-table-column v-if="false" prop="task_id" label="任务标识" />
|
||||||
<el-table-column prop="task_code" :label="$t('TaskRecord.table.Task_number')" :min-width="flexWidth('task_code',crud.data,$t('TaskRecord.table.Task_number'))" />
|
<el-table-column prop="task_code" :label="$t('TaskRecord.table.Task_number')" :min-width="flexWidth('task_code',crud.data,$t('TaskRecord.table.Task_number'))" />
|
||||||
<el-table-column prop="vehicle_code" :label="$t('task.txt_box.Vehicle_number')" :min-width="flexWidth('vehicle_code',crud.data,$t('task.txt_box.Vehicle_number'))" />
|
<el-table-column prop="vehicle_code" :label="$t('task.txt_box.Vehicle_number')" :min-width="flexWidth('vehicle_code',crud.data,$t('task.txt_box.Vehicle_number'))" />
|
||||||
<el-table-column prop="task_type" :label="$t('task.txt_box.Task_type')" :min-width="flexWidth('task_type',crud.data,$t('task.txt_box.Task_type'))">
|
<el-table-column prop="task_type" :label="$t('task.txt_box.Task_type')" width="100px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ dict.label.task_type[scope.row.task_type] }}
|
{{ dict.label.task_type[scope.row.task_type] }}
|
||||||
</template>
|
</template>
|
||||||
@@ -142,11 +142,22 @@
|
|||||||
<el-table-column prop="start_point_code2" :label="$t('TaskRecord.table.Starting_point_two')" :min-width="flexWidth('start_point_code2',crud.data,$t('TaskRecord.table.Starting_point_two'))" />
|
<el-table-column prop="start_point_code2" :label="$t('TaskRecord.table.Starting_point_two')" :min-width="flexWidth('start_point_code2',crud.data,$t('TaskRecord.table.Starting_point_two'))" />
|
||||||
<el-table-column prop="next_point_code2" :label="$t('TaskRecord.table.Endpoint_two')" :min-width="flexWidth('next_point_code2',crud.data,$t('TaskRecord.table.Endpoint_two'))" />
|
<el-table-column prop="next_point_code2" :label="$t('TaskRecord.table.Endpoint_two')" :min-width="flexWidth('next_point_code2',crud.data,$t('TaskRecord.table.Endpoint_two'))" />
|
||||||
<el-table-column prop="put_point_code" :label="$t('TaskRecord.table.Transit_point')" :min-width="flexWidth('put_point_code',crud.data,$t('TaskRecord.table.Transit_point'))" />
|
<el-table-column prop="put_point_code" :label="$t('TaskRecord.table.Transit_point')" :min-width="flexWidth('put_point_code',crud.data,$t('TaskRecord.table.Transit_point'))" />
|
||||||
|
<el-table-column prop="interaction_json" :label="$t('task.select.Interaction_json')" show-overflow-tooltip="true" width="150px" />
|
||||||
<el-table-column prop="matarial" :label="$t('TaskRecord.table.Material')" :min-width="flexWidth('matarial',crud.data,$t('TaskRecord.table.Material'))" />
|
<el-table-column prop="matarial" :label="$t('TaskRecord.table.Material')" :min-width="flexWidth('matarial',crud.data,$t('TaskRecord.table.Material'))" />
|
||||||
<el-table-column prop="quantity" :label="$t('TaskRecord.table.Quantity')" :min-width="flexWidth('quantity',crud.data,$t('TaskRecord.table.Quantity'))" />
|
<el-table-column prop="quantity" :label="$t('TaskRecord.table.Quantity')" :min-width="flexWidth('quantity',crud.data,$t('TaskRecord.table.Quantity'))" />
|
||||||
|
<el-table-column prop="agv_action_type" :label="$t('TaskRecord.table.agv_action_type')" :min-width="flexWidth('agv_action_type',crud.data,$t('TaskRecord.table.agv_action_type'))">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.agv_action_type===1 ">{{ $t('task.txt_box.ORDINARY') }}</span>
|
||||||
|
<span v-if="scope.row.agv_action_type===2 ">{{ $t('task.txt_box.IN_STOCK') }}</span>
|
||||||
|
<span v-if="scope.row.agv_action_type===3 ">{{ $t('task.txt_box.OUT_STOCK') }}</span>
|
||||||
|
<span v-if="scope.row.agv_action_type===4 ">{{ $t('task.txt_box.IN_OUT_STOCK') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="remark" :label="$t('task.select.Remark')" :min-width="flexWidth('remark',crud.data,$t('task.select.Remark'))" />
|
<el-table-column prop="remark" :label="$t('task.select.Remark')" :min-width="flexWidth('remark',crud.data,$t('task.select.Remark'))" />
|
||||||
<el-table-column prop="create_by" :label="$t('task.select.Creator')" :min-width="flexWidth('create_by',crud.data,$t('task.select.Creator'))" />
|
<el-table-column prop="create_by" :label="$t('task.select.Creator')" :min-width="flexWidth('create_by',crud.data,$t('task.select.Creator'))" />
|
||||||
<el-table-column prop="create_time" :label="$t('task.select.Create_time')" width="135" :min-width="flexWidth('create_time',crud.data,$t('task.select.Create_time'))" />
|
<el-table-column prop="create_time" :label="$t('task.select.Create_time')" width="135" :min-width="flexWidth('create_time',crud.data,$t('task.select.Create_time'))" />
|
||||||
|
<el-table-column prop="update_by" :label="$t('TaskRecord.table.Update_by')" :min-width="flexWidth('update_by',crud.data,$t('TaskRecord.table.Update_by'))" />
|
||||||
|
<el-table-column prop="update_time" :label="$t('TaskRecord.table.Update_time')" :min-width="flexWidth('update_time',crud.data,$t('task.select.Update_time'))" />
|
||||||
</el-table>
|
</el-table>
|
||||||
<!--分页组件-->
|
<!--分页组件-->
|
||||||
<pagination />
|
<pagination />
|
||||||
|
|||||||
@@ -505,7 +505,7 @@
|
|||||||
<el-table-column type="selection" width="25" />
|
<el-table-column type="selection" width="25" />
|
||||||
<el-table-column v-if="false" prop="task_id" label="任务标识" />
|
<el-table-column v-if="false" prop="task_id" label="任务标识" />
|
||||||
<el-table-column prop="task_code" :label="$t('task.txt_box.Task_code')" :min-width="flexWidth('task_code',crud.data,$t('task.txt_box.Task_code'))" />
|
<el-table-column prop="task_code" :label="$t('task.txt_box.Task_code')" :min-width="flexWidth('task_code',crud.data,$t('task.txt_box.Task_code'))" />
|
||||||
<el-table-column prop="task_type" :label="$t('task.txt_box.Task_type')" :min-width="flexWidth('task_type',crud.data,$t('task.txt_box.Task_type'))">
|
<el-table-column prop="task_type" :label="$t('task.txt_box.Task_type')" width="100px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ dict.label.task_type[scope.row.task_type] }}
|
{{ dict.label.task_type[scope.row.task_type] }}
|
||||||
</template>
|
</template>
|
||||||
@@ -533,6 +533,11 @@
|
|||||||
<el-table-column prop="start_point_code2" :label="$t('task.select.Start_point2')" :min-width="flexWidth('start_point_code2',crud.data,$t('task.select.Start_point2'))" />
|
<el-table-column prop="start_point_code2" :label="$t('task.select.Start_point2')" :min-width="flexWidth('start_point_code2',crud.data,$t('task.select.Start_point2'))" />
|
||||||
<el-table-column prop="next_point_code2" :label="$t('task.select.Destination2')" :min-width="flexWidth('next_point_code2',crud.data,$t('task.select.Destination2'))" />
|
<el-table-column prop="next_point_code2" :label="$t('task.select.Destination2')" :min-width="flexWidth('next_point_code2',crud.data,$t('task.select.Destination2'))" />
|
||||||
<el-table-column prop="interaction_json" :label="$t('task.select.Interaction_json')" show-overflow-tooltip="true" width="150px" />
|
<el-table-column prop="interaction_json" :label="$t('task.select.Interaction_json')" show-overflow-tooltip="true" width="150px" />
|
||||||
|
<el-table-column prop="agv_system_type" :label="$t('task.txt_box.AGV_system')" show-overflow-tooltip="true" width="150px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ getAgvSystemLabel(scope.row.agv_system_type) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="put_point_code" :label="$t('TaskRecord.table.Transit_point')" :min-width="flexWidth('put_point_code',crud.data,$t('TaskRecord.table.Transit_point'))" />
|
<el-table-column prop="put_point_code" :label="$t('TaskRecord.table.Transit_point')" :min-width="flexWidth('put_point_code',crud.data,$t('TaskRecord.table.Transit_point'))" />
|
||||||
<el-table-column prop="remark" :label="$t('task.select.Remark')" :min-width="flexWidth('remark',crud.data,$t('task.select.Remark'))" />
|
<el-table-column prop="remark" :label="$t('task.select.Remark')" :min-width="flexWidth('remark',crud.data,$t('task.select.Remark'))" />
|
||||||
<el-table-column prop="create_by" :label="$t('task.select.Creator')" :min-width="flexWidth('create_by',crud.data,$t('task.select.Creator'))" />
|
<el-table-column prop="create_by" :label="$t('task.select.Creator')" :min-width="flexWidth('create_by',crud.data,$t('task.select.Creator'))" />
|
||||||
@@ -771,6 +776,10 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getAgvSystemLabel(value) {
|
||||||
|
const item = this.dict.label.agv_system_type[value]
|
||||||
|
return item
|
||||||
|
},
|
||||||
addNewRow() {
|
addNewRow() {
|
||||||
this.extension.push({
|
this.extension.push({
|
||||||
name: '',
|
name: '',
|
||||||
|
|||||||
@@ -18,6 +18,9 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@@ -128,73 +131,88 @@ public class SapToLmsServiceImpl implements SapToLmsService {
|
|||||||
public JSONObject getReCutInfo(JSONObject json) {
|
public JSONObject getReCutInfo(JSONObject json) {
|
||||||
log.info("getReCutInfo的输入参数为:------------------------" + json.toString());
|
log.info("getReCutInfo的输入参数为:------------------------" + json.toString());
|
||||||
|
|
||||||
JSONObject jsonMst = new JSONObject();
|
|
||||||
|
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
|
|
||||||
String msg = "改切出库单据推送成功!";
|
String msg = "改切出库单据推送成功!";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
JSONArray dtl_ja = json.getJSONArray("ITEM");
|
// 需要插入分切计划的集合
|
||||||
String LGORT = dtl_ja.getJSONObject(0).getString("LGORT");
|
List<JSONObject> needInsetIos = new ArrayList<>();
|
||||||
JSONObject stor_jo = WQLObject.getWQLObject("ST_IVT_BSRealStorAttr").query("ext_id = '" + LGORT + "'").uniqueResult(0);
|
// 子卷集合
|
||||||
if (ObjectUtil.isEmpty(stor_jo)) {
|
List<JSONObject> dtl_ja = json.getJSONArray("ITEM").toJavaList(JSONObject.class);
|
||||||
result.put("RTYPE", "E");
|
// 根据仓库进行分类:一个仓库生成一个单据
|
||||||
result.put("RTMSG", "操作失败!" + "未查询到外部标识为:" + LGORT + "对应的仓库!");
|
Map<String, List<JSONObject>> storList = dtl_ja.stream()
|
||||||
result.put("RTOAL", 1);
|
.collect(Collectors.groupingBy(row -> row.getString("LGORT")));
|
||||||
result.put("RTDAT", null);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
jsonMst.put("stor_id", stor_jo.getString("stor_id"));
|
for(String LGORT: storList.keySet()) {
|
||||||
jsonMst.put("stor_code", stor_jo.getString("stor_code"));
|
// 查询仓库是否存在
|
||||||
jsonMst.put("stor_name", stor_jo.getString("stor_name"));
|
JSONObject stor_jo = WQLObject.getWQLObject("ST_IVT_BSRealStorAttr").query("ext_id = '" + LGORT + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(stor_jo)) {
|
||||||
|
result.put("RTYPE", "E");
|
||||||
|
result.put("RTMSG", "操作失败!" + "未查询到外部标识为:" + LGORT + "对应的仓库!");
|
||||||
|
result.put("RTOAL", 1);
|
||||||
|
result.put("RTDAT", null);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
JSONArray dtls = new JSONArray();
|
// 组织主表信息
|
||||||
for (int i = 0; i < dtl_ja.size(); i++) {
|
JSONObject jsonMst = new JSONObject();
|
||||||
JSONObject jo = dtl_ja.getJSONObject(i);
|
jsonMst.put("stor_id", stor_jo.getString("stor_id"));
|
||||||
String sap_pcsn = jo.getString("CHARG");
|
jsonMst.put("stor_code", stor_jo.getString("stor_code"));
|
||||||
if (StrUtil.isEmpty("sap_pcsn")) {
|
jsonMst.put("stor_name", stor_jo.getString("stor_name"));
|
||||||
throw new BadRequestException("请求参数SAP批次不能为空!");
|
|
||||||
}
|
// 组织明细信息
|
||||||
JSONObject sub_jo = WQLObject.getWQLObject("PDM_BI_SubPackageRelation").query("sap_pcsn = '" + sap_pcsn + "'").uniqueResult(0);
|
JSONArray dtls = new JSONArray();
|
||||||
if (ObjectUtil.isEmpty(sub_jo)) {
|
for (JSONObject jo : storList.get(LGORT)) {
|
||||||
throw new BadRequestException("LMS中不存在SAP批次为【" + sap_pcsn + "】的包装关系");
|
String sap_pcsn = jo.getString("CHARG");
|
||||||
}
|
if (StrUtil.isEmpty("sap_pcsn")) {
|
||||||
String container_name = sub_jo.getString("container_name");
|
throw new BadRequestException("请求参数SAP批次不能为空!");
|
||||||
JSONObject struct_ivt = WQLObject.getWQLObject("st_ivt_structivt").query("pcsn = '" + container_name + "'").uniqueResult(0);
|
}
|
||||||
if (ObjectUtil.isEmpty(struct_ivt)) {
|
JSONObject sub_jo = WQLObject.getWQLObject("PDM_BI_SubPackageRelation").query("sap_pcsn = '" + sap_pcsn + "'").uniqueResult(0);
|
||||||
throw new BadRequestException("SAP批次为【" + sap_pcsn + "】的成品卷不存在或已经出库!");
|
if (ObjectUtil.isEmpty(sub_jo)) {
|
||||||
} else {
|
throw new BadRequestException("LMS中不存在SAP批次为【" + sap_pcsn + "】的包装关系");
|
||||||
if (struct_ivt.getDoubleValue("frozen_qty") > 0) {
|
}
|
||||||
msg = "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 {
|
} else {
|
||||||
JSONObject dtl = new JSONObject();
|
if (struct_ivt.getDoubleValue("frozen_qty") > 0) {
|
||||||
//查询该物料
|
msg = "SAP批次为【" + sap_pcsn + "】的成品卷已经被分配或出库中";
|
||||||
JSONObject mater_jo = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + sub_jo.getString("product_name") + "'").uniqueResult(0);
|
} else {
|
||||||
if (ObjectUtil.isEmpty(mater_jo)) {
|
JSONObject dtl = new JSONObject();
|
||||||
throw new BadRequestException("未查询到物料:" + sub_jo.getString("product_name") + ",信息!");
|
//查询该物料
|
||||||
|
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("sap_pcsn", sap_pcsn);
|
||||||
|
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("package_box_sn", sub_jo.getString("package_box_sn"));
|
||||||
|
dtl.put("qty", sub_jo.getString("net_weight"));
|
||||||
|
dtls.add(dtl);
|
||||||
}
|
}
|
||||||
dtl.put("material_id", mater_jo.getString("material_id"));
|
|
||||||
dtl.put("sap_pcsn", sap_pcsn);
|
|
||||||
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("package_box_sn", sub_jo.getString("package_box_sn"));
|
|
||||||
dtl.put("qty", sub_jo.getString("net_weight"));
|
|
||||||
dtls.add(dtl);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!dtls.isEmpty()) {
|
||||||
|
jsonMst.put("tableData", dtls);
|
||||||
|
needInsetIos.add(jsonMst);
|
||||||
|
} else {
|
||||||
|
throw new BadRequestException("推送失败!SAP推送的子卷明细不符合出库状态!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dtls.isEmpty()) {
|
// 生成单据
|
||||||
jsonMst.put("tableData", dtls);
|
for(JSONObject jsonIos : needInsetIos) {
|
||||||
recutPlanService.insertDtl(jsonMst);
|
recutPlanService.insertDtl(jsonIos);
|
||||||
} else {
|
|
||||||
throw new BadRequestException("推送失败!SAP推送的子卷明细不符合出库状态!");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
result.put("TYPE", "E");
|
result.put("TYPE", "E");
|
||||||
result.put("MESSAGE", "推送失败!" + exception.getMessage());
|
result.put("MESSAGE", "推送失败!" + exception.getMessage());
|
||||||
|
|||||||
Reference in New Issue
Block a user