diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/service/impl/MaterialbaseServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/service/impl/MaterialbaseServiceImpl.java
index 8b1f79f..bfb04c8 100644
--- a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/service/impl/MaterialbaseServiceImpl.java
+++ b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/service/impl/MaterialbaseServiceImpl.java
@@ -67,8 +67,6 @@ public class MaterialbaseServiceImpl implements MaterialbaseService {
public MaterialbaseDto findById(Long material_id) {
WQLObject wo = WQLObject.getWQLObject("md_me_materialbase");
JSONObject json = wo.query("material_id =" + material_id + "").uniqueResult(0);
- String unit_name = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id= '" + json.getString("base_unit_id") + "'").uniqueResult(0).getString("unit_name");
- json.put("base_unit_name", unit_name);
final MaterialbaseDto obj = json.toJavaObject(MaterialbaseDto.class);
return obj;
}
diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/rest/PdaController.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/rest/PdaController.java
index fd2f344..f4572eb 100644
--- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/rest/PdaController.java
+++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/rest/PdaController.java
@@ -126,4 +126,18 @@ public class PdaController {
pdaService.sendMaterial(point_code, vehicle_code, qty, weight, is_full, param.toJSONString());
return PdaUtils.buildSuccessResultJSON(null);
}
+
+ @PostMapping("/callMaterial")
+ @Log("叫料")
+ @ApiOperation("叫料")
+ @PdaAnnotation
+ public JSONObject callMaterial(@RequestBody JSONObject param) {
+ String point_code = param.getString("point_code");
+ if (StrUtil.isBlank(point_code)) {
+ throw new BadRequestException("点位编码不能为空!");
+ }
+
+ pdaService.callMaterial(point_code, param.toJSONString());
+ return PdaUtils.buildSuccessResultJSON(null);
+ }
}
diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/service/PdaService.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/service/PdaService.java
index a19cd1e..576d37f 100644
--- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/service/PdaService.java
+++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/service/PdaService.java
@@ -13,6 +13,7 @@ public interface PdaService {
/**
* 查询区域
+ *
* @param func 手持功能
* @return 区域编码 区域名称
*/
@@ -20,7 +21,8 @@ public interface PdaService {
/**
* 查询点位
- * @param func 手持功能
+ *
+ * @param func 手持功能
* @param region_code 区域编码
* @return 点位编码 点位名称
*/
@@ -28,6 +30,7 @@ public interface PdaService {
/**
* 查询设备
+ *
* @param func 手持功能
* @return 设备编码 设备名称
*/
@@ -35,18 +38,27 @@ public interface PdaService {
/**
* 不合格品上报
- * @param device_code 设备编码
+ *
+ * @param device_code 设备编码
* @param unqualified_qty 不合格数量
*/
void report(String device_code, String unqualified_qty);
/**
* 送料
- * @param point_code 点位编码
+ *
+ * @param point_code 点位编码
* @param vehicle_code 载具编码
- * @param qty 数量
- * @param weight 重量
- * @param is_full 是否满垛
+ * @param qty 数量
+ * @param weight 重量
+ * @param is_full 是否满垛
*/
void sendMaterial(String point_code, String vehicle_code, String qty, String weight, String is_full, String request_param);
+
+ /**
+ * 叫料
+ *
+ * @param point_code 点位编码
+ */
+ void callMaterial(String point_code, String request_param);
}
diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java
index 95f5927..8ab4e7c 100644
--- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java
+++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java
@@ -17,6 +17,9 @@ import org.nl.wms.pda.service.PdaService;
import org.nl.wms.sch.manage.ACSSystem;
import org.nl.wms.sch.manage.CreateMode;
import org.nl.wms.sch.manage.Region;
+import org.nl.wms.sch.task.call.material.FJCallMaterialTask;
+import org.nl.wms.sch.task.call.material.YZCallMaterialTask;
+import org.nl.wms.sch.task.send.material.FJSendMaterialTask;
import org.nl.wms.sch.task.send.material.HLSendMaterialTask;
import org.nl.wms.sch.task.send.material.YZSendMaterialTask;
import org.nl.wms.sch.task.util.TaskUtils;
@@ -36,6 +39,12 @@ public class PdaServiceImpl implements PdaService {
private final YZSendMaterialTask yzSendMaterialTask;
+ private final FJSendMaterialTask fjSendMaterialTask;
+
+ private final YZCallMaterialTask yzCallMaterialTask;
+
+ private final FJCallMaterialTask fjCallMaterialTask;
+
@Override
public JSONArray region(String func) {
switch (func) {
@@ -204,6 +213,7 @@ public class PdaServiceImpl implements PdaService {
method_param.put("request_param", request_param);
method_param.put("create_id", SecurityUtils.getCurrentUserId());
method_param.put("create_name", SecurityUtils.getCurrentNickName());
+
switch (region) {
case HL:
hlSendMaterialTask.createTask(method_param);
@@ -211,8 +221,43 @@ public class PdaServiceImpl implements PdaService {
case YZ:
yzSendMaterialTask.createTask(method_param);
break;
+ case FJ:
+ fjSendMaterialTask.createTask(method_param);
default:
throw new BadRequestException("[" + region.label() + "] 不能发起送料任务!");
}
}
+
+ @Override
+ public void callMaterial(String point_code, String request_param) {
+ JSONObject point = WQLObject
+ .getWQLObject("sch_base_point")
+ .query("is_used = '1' AND point_code = '" + point_code + "'")
+ .uniqueResult(0);
+ if (ObjectUtil.isEmpty(point)) {
+ throw new BadRequestException("[" + point_code + "] 已删除或未启用!");
+ }
+
+ JSONObject workorder = TaskUtils.hasWorkOrder(point);
+
+ Region region = Region.get(point.getString("region_code"));
+ JSONObject method_param = new JSONObject();
+ method_param.put("point", point);
+ method_param.put("workorder", workorder);
+ method_param.put("create_mode", CreateMode.SCCJ.value());
+ method_param.put("request_param", request_param);
+ method_param.put("create_id", SecurityUtils.getCurrentUserId());
+ method_param.put("create_name", SecurityUtils.getCurrentNickName());
+
+ switch (region) {
+ case YZ:
+ yzCallMaterialTask.createTask(method_param);
+ break;
+ case FJ:
+ fjCallMaterialTask.createTask(method_param);
+ break;
+ default:
+ throw new BadRequestException("[" + region.label() + "] 不能发起叫料任务!");
+ }
+ }
}
diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkorderServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkorderServiceImpl.java
index c953859..32b3c8b 100644
--- a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkorderServiceImpl.java
+++ b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkorderServiceImpl.java
@@ -414,7 +414,8 @@ public class WorkorderServiceImpl implements WorkordeService {
@Override
@Transactional(rollbackFor = Exception.class)
public void finish(JSONObject param) {
- String workorder_id = param.getString("workorder_id");
+ JSONObject row = param.getJSONObject("row");
+ String workorder_id = row.getString("workorder_id");
WQLObject workorder_table = WQLObject.getWQLObject("pdm_bd_workorder");
JSONObject workorder = workorder_table.query("is_delete = '0' AND workorder_id = " + workorder_id).uniqueResult(0);
if (ObjectUtil.isEmpty(workorder)) {
@@ -423,7 +424,7 @@ public class WorkorderServiceImpl implements WorkordeService {
if (workorder.getIntValue("order_status") < 5) {
workorder.put("order_status", WorkOrderEnum.ORDER_STATUS_FINISH.value());
- String qty = param.getString("qty");
+ String qty = row.getString("qty");
if (StrUtil.isBlank(qty)) {
JSONObject device = WQLObject.getWQLObject("pdm_bi_device").query("device_id = " + workorder.getString("device_id")).uniqueResult(0);
if (Region.HL.value().equals(device.getString("region_code"))) {
@@ -432,11 +433,11 @@ public class WorkorderServiceImpl implements WorkordeService {
throw new BadRequestException("数量不能为空!");
}
workorder.put("real_qty", qty);
- String unqualified_qty = param.getString("unqualified_qty");
+ String unqualified_qty = row.getString("unqualified_qty");
if (StrUtil.isNotBlank(unqualified_qty) && !"0".equals(unqualified_qty)) {
workorder.put("unqualified_qty", unqualified_qty);
}
- String qualified_qty = param.getString("qualified_qty");
+ String qualified_qty = row.getString("qualified_qty");
if (StrUtil.isNotBlank(qualified_qty) && !"0".equals(qualified_qty)) {
workorder.put("qualified_qty", qualified_qty);
} else {
diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/wms.xls b/lms/nladmin-system/src/main/java/org/nl/wms/wms.xls
index 0bfc92b..de3b32e 100644
Binary files a/lms/nladmin-system/src/main/java/org/nl/wms/wms.xls and b/lms/nladmin-system/src/main/java/org/nl/wms/wms.xls differ
diff --git a/lms/nladmin-system/src/test/java/org/nl/test/PointTest.java b/lms/nladmin-system/src/test/java/org/nl/test/PointTest.java
index 895405d..3d46780 100644
--- a/lms/nladmin-system/src/test/java/org/nl/test/PointTest.java
+++ b/lms/nladmin-system/src/test/java/org/nl/test/PointTest.java
@@ -22,14 +22,14 @@ public class PointTest {
JSONObject point = new JSONObject();
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
String now = DateUtil.now();
- for (int i = 0; i < 48; i++) {
+ for (int i = 1; i < 10; i++) {
point.put("point_id", IdUtil.getSnowflake(1L, 1L).nextId());
- point.put("point_code", "KLHW" + String.format("%02d", i + 1));
- point.put("point_name", "困料货位" + (i + 1));
- point.put("region_id", "1643186988158947328");
- point.put("region_code", "KLHJ");
- point.put("region_name", "困料货架");
- point.put("point_type", "1");
+ point.put("point_code", "YJ" + String.format("%02d", i + 1) + "SL01");
+ point.put("point_name", "压机" + (i + 1) + "上料位");
+ point.put("region_id", "1643438714497667072");
+ point.put("region_code", "YZ");
+ point.put("region_name", "压制区");
+ point.put("point_type", "2");
point.put("lock_type", "1");
point.put("create_id", 1);
point.put("create_name", "管理员");
diff --git a/lms/nladmin-ui/src/views/wms/basedata/material/detail/index.vue b/lms/nladmin-ui/src/views/wms/basedata/material/detail/index.vue
index b3caa30..d7eb51a 100644
--- a/lms/nladmin-ui/src/views/wms/basedata/material/detail/index.vue
+++ b/lms/nladmin-ui/src/views/wms/basedata/material/detail/index.vue
@@ -26,19 +26,19 @@