Browse Source

add 手持叫料

master
张江玮 2 years ago
parent
commit
5ffca09127
  1. 2
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/service/impl/MaterialbaseServiceImpl.java
  2. 14
      lms/nladmin-system/src/main/java/org/nl/wms/pda/rest/PdaController.java
  3. 24
      lms/nladmin-system/src/main/java/org/nl/wms/pda/service/PdaService.java
  4. 45
      lms/nladmin-system/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java
  5. 9
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkorderServiceImpl.java
  6. BIN
      lms/nladmin-system/src/main/java/org/nl/wms/wms.xls
  7. 14
      lms/nladmin-system/src/test/java/org/nl/test/PointTest.java
  8. 8
      lms/nladmin-ui/src/views/wms/basedata/material/detail/index.vue
  9. 2
      lms/nladmin-ui/src/views/wms/pdm/workerorder/hl/index.vue

2
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) { public MaterialbaseDto findById(Long material_id) {
WQLObject wo = WQLObject.getWQLObject("md_me_materialbase"); WQLObject wo = WQLObject.getWQLObject("md_me_materialbase");
JSONObject json = wo.query("material_id =" + material_id + "").uniqueResult(0); 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); final MaterialbaseDto obj = json.toJavaObject(MaterialbaseDto.class);
return obj; return obj;
} }

14
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()); pdaService.sendMaterial(point_code, vehicle_code, qty, weight, is_full, param.toJSONString());
return PdaUtils.buildSuccessResultJSON(null); 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);
}
} }

24
lms/nladmin-system/src/main/java/org/nl/wms/pda/service/PdaService.java

@ -13,6 +13,7 @@ public interface PdaService {
/** /**
* 查询区域 * 查询区域
*
* @param func 手持功能 * @param func 手持功能
* @return 区域编码 区域名称 * @return 区域编码 区域名称
*/ */
@ -20,7 +21,8 @@ public interface PdaService {
/** /**
* 查询点位 * 查询点位
* @param func 手持功能 *
* @param func 手持功能
* @param region_code 区域编码 * @param region_code 区域编码
* @return 点位编码 点位名称 * @return 点位编码 点位名称
*/ */
@ -28,6 +30,7 @@ public interface PdaService {
/** /**
* 查询设备 * 查询设备
*
* @param func 手持功能 * @param func 手持功能
* @return 设备编码 设备名称 * @return 设备编码 设备名称
*/ */
@ -35,18 +38,27 @@ public interface PdaService {
/** /**
* 不合格品上报 * 不合格品上报
* @param device_code 设备编码 *
* @param device_code 设备编码
* @param unqualified_qty 不合格数量 * @param unqualified_qty 不合格数量
*/ */
void report(String device_code, String unqualified_qty); void report(String device_code, String unqualified_qty);
/** /**
* 送料 * 送料
* @param point_code 点位编码 *
* @param point_code 点位编码
* @param vehicle_code 载具编码 * @param vehicle_code 载具编码
* @param qty 数量 * @param qty 数量
* @param weight 重量 * @param weight 重量
* @param is_full 是否满垛 * @param is_full 是否满垛
*/ */
void sendMaterial(String point_code, String vehicle_code, String qty, String weight, String is_full, String request_param); 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);
} }

45
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.ACSSystem;
import org.nl.wms.sch.manage.CreateMode; import org.nl.wms.sch.manage.CreateMode;
import org.nl.wms.sch.manage.Region; 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.HLSendMaterialTask;
import org.nl.wms.sch.task.send.material.YZSendMaterialTask; import org.nl.wms.sch.task.send.material.YZSendMaterialTask;
import org.nl.wms.sch.task.util.TaskUtils; import org.nl.wms.sch.task.util.TaskUtils;
@ -36,6 +39,12 @@ public class PdaServiceImpl implements PdaService {
private final YZSendMaterialTask yzSendMaterialTask; private final YZSendMaterialTask yzSendMaterialTask;
private final FJSendMaterialTask fjSendMaterialTask;
private final YZCallMaterialTask yzCallMaterialTask;
private final FJCallMaterialTask fjCallMaterialTask;
@Override @Override
public JSONArray region(String func) { public JSONArray region(String func) {
switch (func) { switch (func) {
@ -204,6 +213,7 @@ public class PdaServiceImpl implements PdaService {
method_param.put("request_param", request_param); method_param.put("request_param", request_param);
method_param.put("create_id", SecurityUtils.getCurrentUserId()); method_param.put("create_id", SecurityUtils.getCurrentUserId());
method_param.put("create_name", SecurityUtils.getCurrentNickName()); method_param.put("create_name", SecurityUtils.getCurrentNickName());
switch (region) { switch (region) {
case HL: case HL:
hlSendMaterialTask.createTask(method_param); hlSendMaterialTask.createTask(method_param);
@ -211,8 +221,43 @@ public class PdaServiceImpl implements PdaService {
case YZ: case YZ:
yzSendMaterialTask.createTask(method_param); yzSendMaterialTask.createTask(method_param);
break; break;
case FJ:
fjSendMaterialTask.createTask(method_param);
default: default:
throw new BadRequestException("[" + region.label() + "] 不能发起送料任务!"); 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() + "] 不能发起叫料任务!");
}
}
} }

9
lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkorderServiceImpl.java

@ -414,7 +414,8 @@ public class WorkorderServiceImpl implements WorkordeService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void finish(JSONObject param) { 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"); WQLObject workorder_table = WQLObject.getWQLObject("pdm_bd_workorder");
JSONObject workorder = workorder_table.query("is_delete = '0' AND workorder_id = " + workorder_id).uniqueResult(0); JSONObject workorder = workorder_table.query("is_delete = '0' AND workorder_id = " + workorder_id).uniqueResult(0);
if (ObjectUtil.isEmpty(workorder)) { if (ObjectUtil.isEmpty(workorder)) {
@ -423,7 +424,7 @@ public class WorkorderServiceImpl implements WorkordeService {
if (workorder.getIntValue("order_status") < 5) { if (workorder.getIntValue("order_status") < 5) {
workorder.put("order_status", WorkOrderEnum.ORDER_STATUS_FINISH.value()); workorder.put("order_status", WorkOrderEnum.ORDER_STATUS_FINISH.value());
String qty = param.getString("qty"); String qty = row.getString("qty");
if (StrUtil.isBlank(qty)) { if (StrUtil.isBlank(qty)) {
JSONObject device = WQLObject.getWQLObject("pdm_bi_device").query("device_id = " + workorder.getString("device_id")).uniqueResult(0); 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"))) { if (Region.HL.value().equals(device.getString("region_code"))) {
@ -432,11 +433,11 @@ public class WorkorderServiceImpl implements WorkordeService {
throw new BadRequestException("数量不能为空!"); throw new BadRequestException("数量不能为空!");
} }
workorder.put("real_qty", qty); 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)) { if (StrUtil.isNotBlank(unqualified_qty) && !"0".equals(unqualified_qty)) {
workorder.put("unqualified_qty", 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)) { if (StrUtil.isNotBlank(qualified_qty) && !"0".equals(qualified_qty)) {
workorder.put("qualified_qty", qualified_qty); workorder.put("qualified_qty", qualified_qty);
} else { } else {

BIN
lms/nladmin-system/src/main/java/org/nl/wms/wms.xls

Binary file not shown.

14
lms/nladmin-system/src/test/java/org/nl/test/PointTest.java

@ -22,14 +22,14 @@ public class PointTest {
JSONObject point = new JSONObject(); JSONObject point = new JSONObject();
WQLObject point_table = WQLObject.getWQLObject("sch_base_point"); WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
String now = DateUtil.now(); 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_id", IdUtil.getSnowflake(1L, 1L).nextId());
point.put("point_code", "KLHW" + String.format("%02d", i + 1)); point.put("point_code", "YJ" + String.format("%02d", i + 1) + "SL01");
point.put("point_name", "困料货位" + (i + 1)); point.put("point_name", "压机" + (i + 1) + "上料位");
point.put("region_id", "1643186988158947328"); point.put("region_id", "1643438714497667072");
point.put("region_code", "KLHJ"); point.put("region_code", "YZ");
point.put("region_name", "困料货架"); point.put("region_name", "压制区");
point.put("point_type", "1"); point.put("point_type", "2");
point.put("lock_type", "1"); point.put("lock_type", "1");
point.put("create_id", 1); point.put("create_id", 1);
point.put("create_name", "管理员"); point.put("create_name", "管理员");

8
lms/nladmin-ui/src/views/wms/basedata/material/detail/index.vue

@ -26,19 +26,19 @@
<el-input v-model="form.material_brick_type" placeholder="物料砖类型" style="width: 300px;" /> <el-input v-model="form.material_brick_type" placeholder="物料砖类型" style="width: 300px;" />
</el-form-item> </el-form-item>
<el-form-item label="BOM编码" prop="bom_code"> <el-form-item label="BOM编码" prop="bom_code">
<el-input v-model="form.bom_code" placeholder="BOM编码" style="width: 300px;" /> <el-input v-model="form.bom_code" :disabled="crud.status.edit" placeholder="BOM编码" style="width: 300px;" />
</el-form-item> </el-form-item>
<el-form-item label="订单编码" prop="order_code"> <el-form-item label="订单编码" prop="order_code">
<el-input v-model="form.order_code" placeholder="订单编码" style="width: 300px;" /> <el-input v-model="form.order_code" :disabled="crud.status.edit" placeholder="订单编码" style="width: 300px;" />
</el-form-item> </el-form-item>
<el-form-item label="客户编码" prop="customer_code"> <el-form-item label="客户编码" prop="customer_code">
<el-input v-model="form.customer_code" placeholder="客户编码" style="width: 300px;" /> <el-input v-model="form.customer_code" :disabled="crud.status.edit" placeholder="客户编码" style="width: 300px;" />
</el-form-item> </el-form-item>
<el-form-item label="牌号" prop="product_grade"> <el-form-item label="牌号" prop="product_grade">
<el-input v-model="form.product_grade" placeholder="牌" style="width: 300px;" /> <el-input v-model="form.product_grade" placeholder="牌" style="width: 300px;" />
</el-form-item> </el-form-item>
<el-form-item label="砖型" prop="brick_type"> <el-form-item label="砖型" prop="brick_type">
<el-input v-model="form.brick_type" placeholder="砖型" style="width: 300px;" /> <el-input v-model="form.brick_type" :disabled="crud.status.edit" placeholder="砖型" style="width: 300px;" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">

2
lms/nladmin-ui/src/views/wms/pdm/workerorder/hl/index.vue

@ -128,7 +128,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="计划数量/重量" prop="plan_qty"> <el-form-item label="计划重量" prop="plan_qty">
<el-input v-model="form.plan_qty" :disabled="crud.status.edit" type="number" style="width: 300px" /> <el-input v-model="form.plan_qty" :disabled="crud.status.edit" type="number" style="width: 300px" />
</el-form-item> </el-form-item>
</el-col> </el-col>

Loading…
Cancel
Save