diff --git a/acs2/nladmin-ui/src/i18n/langs/history/en.js b/acs2/nladmin-ui/src/i18n/langs/history/en.js
index d57bafa2f..2f08fbfef 100644
--- a/acs2/nladmin-ui/src/i18n/langs/history/en.js
+++ b/acs2/nladmin-ui/src/i18n/langs/history/en.js
@@ -11,6 +11,7 @@ export default {
'Endpoint_two': 'Endpoint Two',
'Material': 'Material',
'Quantity': 'Quantity',
+ 'agv_action_type': 'The type of AGV secondary distribution',
'Numbering': 'Numbering',
'Value': 'Value',
'Input_task_instruction_number': 'Enter Task Number Or Instruction Number',
diff --git a/acs2/nladmin-ui/src/i18n/langs/history/in.js b/acs2/nladmin-ui/src/i18n/langs/history/in.js
index b0a5ab1d6..a9b7792c9 100644
--- a/acs2/nladmin-ui/src/i18n/langs/history/in.js
+++ b/acs2/nladmin-ui/src/i18n/langs/history/in.js
@@ -10,7 +10,8 @@ export default {
'Transit_point': 'Titik transit',
'Endpoint_two': 'Titik Akhir Dua',
'Material': 'Bahan',
- 'Quantity': 'Jumlah',
+ 'Quantity': 'Jenis distribusi sekunder AGV',
+ 'agv_action_type': 'agv二次分配类型',
'Numbering': 'Nomor',
'Value': 'Nilai',
'Input_task_instruction_number': 'Masukkan Nomor Tugas Atau Nomor Instruksi',
diff --git a/acs2/nladmin-ui/src/i18n/langs/history/zh.js b/acs2/nladmin-ui/src/i18n/langs/history/zh.js
index e332c0678..77555fd2a 100644
--- a/acs2/nladmin-ui/src/i18n/langs/history/zh.js
+++ b/acs2/nladmin-ui/src/i18n/langs/history/zh.js
@@ -11,6 +11,7 @@ export default {
'Endpoint_two': '终点2',
'Material': '物料',
'Quantity': '数量',
+ 'agv_action_type': 'agv二次分配类型',
'Numbering': '编号',
'Value': '值',
'Input_task_instruction_number': '输入任务号或指令号',
diff --git a/acs2/nladmin-ui/src/views/acs/history/taskRecord/index.vue b/acs2/nladmin-ui/src/views/acs/history/taskRecord/index.vue
index 7fd33e69e..a68b83bbd 100644
--- a/acs2/nladmin-ui/src/views/acs/history/taskRecord/index.vue
+++ b/acs2/nladmin-ui/src/views/acs/history/taskRecord/index.vue
@@ -275,9 +275,9 @@
@selection-change="crud.selectionChangeHandler"
>
-
+
-
+
{{ dict.label.task_type[scope.row.task_type] }}
@@ -290,9 +290,9 @@
{{ $t('task.select.Cancel') }}
-
-
-
+
+
+
@@ -301,6 +301,8 @@
+
+
@@ -330,7 +332,6 @@ const defaultForm = {
start_point_code: null,
start_device_code: null,
next_point_code: null,
- start_point_code: null,
remark: null,
material: null,
route_plan_code: 'normal',
diff --git a/acs2/nladmin-ui/src/views/acs/history/taskTreeRecord/index.vue b/acs2/nladmin-ui/src/views/acs/history/taskTreeRecord/index.vue
index dd9a20f3f..d61fd7870 100644
--- a/acs2/nladmin-ui/src/views/acs/history/taskTreeRecord/index.vue
+++ b/acs2/nladmin-ui/src/views/acs/history/taskTreeRecord/index.vue
@@ -123,7 +123,7 @@
-
+
{{ dict.label.task_type[scope.row.task_type] }}
@@ -142,11 +142,22 @@
+
+
+
+ {{ $t('task.txt_box.ORDINARY') }}
+ {{ $t('task.txt_box.IN_STOCK') }}
+ {{ $t('task.txt_box.OUT_STOCK') }}
+ {{ $t('task.txt_box.IN_OUT_STOCK') }}
+
+
+
+
diff --git a/acs2/nladmin-ui/src/views/acs/task/index.vue b/acs2/nladmin-ui/src/views/acs/task/index.vue
index 28fe6037d..aba366f09 100644
--- a/acs2/nladmin-ui/src/views/acs/task/index.vue
+++ b/acs2/nladmin-ui/src/views/acs/task/index.vue
@@ -505,7 +505,7 @@
-
+
{{ dict.label.task_type[scope.row.task_type] }}
@@ -533,6 +533,11 @@
+
+
+ {{ getAgvSystemLabel(scope.row.agv_system_type) }}
+
+
@@ -771,6 +776,10 @@ export default {
})
},
methods: {
+ getAgvSystemLabel(value) {
+ const item = this.dict.label.agv_system_type[value]
+ return item
+ },
addNewRow() {
this.extension.push({
name: '',
diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/ext/sap/service/impl/SapToLmsServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/ext/sap/service/impl/SapToLmsServiceImpl.java
index b96fd7548..6284d6813 100644
--- a/lms/nladmin-system/src/main/java/org/nl/wms/ext/sap/service/impl/SapToLmsServiceImpl.java
+++ b/lms/nladmin-system/src/main/java/org/nl/wms/ext/sap/service/impl/SapToLmsServiceImpl.java
@@ -18,6 +18,9 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
@Service
@RequiredArgsConstructor
@@ -128,73 +131,88 @@ public class SapToLmsServiceImpl implements SapToLmsService {
public JSONObject getReCutInfo(JSONObject json) {
log.info("getReCutInfo的输入参数为:------------------------" + json.toString());
- JSONObject jsonMst = new JSONObject();
-
JSONObject result = new JSONObject();
-
String msg = "改切出库单据推送成功!";
+
try {
- 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");
- result.put("RTMSG", "操作失败!" + "未查询到外部标识为:" + LGORT + "对应的仓库!");
- result.put("RTOAL", 1);
- result.put("RTDAT", null);
- return result;
- }
+ // 需要插入分切计划的集合
+ List needInsetIos = new ArrayList<>();
+ // 子卷集合
+ List dtl_ja = json.getJSONArray("ITEM").toJavaList(JSONObject.class);
+ // 根据仓库进行分类:一个仓库生成一个单据
+ Map> storList = dtl_ja.stream()
+ .collect(Collectors.groupingBy(row -> row.getString("LGORT")));
- 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"));
+ for(String LGORT: storList.keySet()) {
+ // 查询仓库是否存在
+ 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 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 + "】的成品卷已经被分配或出库中";
+ // 组织主表信息
+ JSONObject jsonMst = new JSONObject();
+ 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"));
+
+ // 组织明细信息
+ JSONArray dtls = new JSONArray();
+ for (JSONObject jo : storList.get(LGORT)) {
+ 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 {
- 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") + ",信息!");
+ 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("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);
- recutPlanService.insertDtl(jsonMst);
- } else {
- throw new BadRequestException("推送失败!SAP推送的子卷明细不符合出库状态!");
+ // 生成单据
+ for(JSONObject jsonIos : needInsetIos) {
+ recutPlanService.insertDtl(jsonIos);
}
+
} catch (Exception exception) {
result.put("TYPE", "E");
result.put("MESSAGE", "推送失败!" + exception.getMessage());