Browse Source

add 手持送空

master
张江玮 2 years ago
parent
commit
aefd73c951
  1. 17
      lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java
  2. 91
      lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  3. 4
      lms/nladmin-system/src/main/java/org/nl/wms/pda/rest/PdaController.java
  4. 28
      lms/nladmin-system/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java
  5. 2
      lms/nladmin-system/src/main/java/org/nl/wms/pda/wql/PDA.wql
  6. 15
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkorderServiceImpl.java
  7. 3
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/empty/YZSendEmptyTask.java
  8. 11
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/HLSendMaterialTask.java
  9. 15
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/wql/SEND_MATERIAL_TASK.wql
  10. 29
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/util/TaskUtils.java
  11. 8
      lms/nladmin-ui/src/views/wms/basedata/bom/index.vue
  12. 10
      lms/nladmin-ui/src/views/wms/basedata/material/index.vue
  13. 2
      lms/nladmin-ui/src/views/wms/pdm/workerorder/hl/index.vue
  14. 4
      lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue
  15. 8
      lms/nladmin-ui/src/views/wms/sch/point/index.vue

17
lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java

@ -61,12 +61,11 @@ public class AcsToWmsController {
@ApiOperation("申请任务") @ApiOperation("申请任务")
@SaIgnore @SaIgnore
public ResponseEntity<Object> apply(@RequestBody JSONObject whereJson) { public ResponseEntity<Object> apply(@RequestBody JSONObject whereJson) {
String point_code = whereJson.getString("device_code"); String type = whereJson.getString("type");
if (StrUtil.isBlank(point_code)) { if (StrUtil.isBlank(type)) {
throw new BadRequestException("点位不能为空!"); throw new BadRequestException("任务类型不能为空!");
} }
RLock lock = SpringContextHolder.getBean(RedissonClient.class).getFairLock(type);
RLock lock = SpringContextHolder.getBean(RedissonClient.class).getFairLock(point_code);
boolean try_lock = false; boolean try_lock = false;
try { try {
try_lock = lock.tryLock(5, TimeUnit.SECONDS); try_lock = lock.tryLock(5, TimeUnit.SECONDS);
@ -92,12 +91,12 @@ public class AcsToWmsController {
@ApiOperation("ACS机械手给WMS发送任务") @ApiOperation("ACS机械手给WMS发送任务")
@SaIgnore @SaIgnore
public ResponseEntity<Object> manipulatorApply(@RequestBody JSONObject whereJson) { public ResponseEntity<Object> manipulatorApply(@RequestBody JSONObject whereJson) {
String point_code = whereJson.getString("device_code"); String type = whereJson.getString("type");
if (StrUtil.isBlank(point_code)) { if (StrUtil.isBlank(type)) {
throw new BadRequestException("点位不能为空!"); throw new BadRequestException("任务类型不能为空!");
} }
RLock lock = SpringContextHolder.getBean(RedissonClient.class).getFairLock(point_code); RLock lock = SpringContextHolder.getBean(RedissonClient.class).getFairLock(type);
boolean try_lock = false; boolean try_lock = false;
try { try {
try_lock = lock.tryLock(5, TimeUnit.SECONDS); try_lock = lock.tryLock(5, TimeUnit.SECONDS);

91
lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java

@ -8,7 +8,6 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.system.util.CodeUtil; import org.nl.modules.system.util.CodeUtil;
@ -19,6 +18,7 @@ import org.nl.wms.basedata.eum.StandStatus;
import org.nl.wms.basedata.eum.TrueOrFalse; import org.nl.wms.basedata.eum.TrueOrFalse;
import org.nl.wms.basedata.eum.VehicleType; import org.nl.wms.basedata.eum.VehicleType;
import org.nl.wms.basedata.service.dto.VehicleDto; import org.nl.wms.basedata.service.dto.VehicleDto;
import org.nl.wms.common.PickType;
import org.nl.wms.ext.acs.service.AcsToWmsService; import org.nl.wms.ext.acs.service.AcsToWmsService;
import org.nl.wms.sch.manage.*; import org.nl.wms.sch.manage.*;
import org.nl.wms.sch.task.call.empty.FJCallEmptyTask; import org.nl.wms.sch.task.call.empty.FJCallEmptyTask;
@ -37,16 +37,12 @@ import org.nl.wms.sch.task.send.material.YZSendMaterialTask;
import org.nl.wms.sch.task.to.pack.BTHCToPackageTask; import org.nl.wms.sch.task.to.pack.BTHCToPackageTask;
import org.nl.wms.sch.task.to.pack.FJToPackageTask; import org.nl.wms.sch.task.to.pack.FJToPackageTask;
import org.nl.wms.sch.task.util.TaskUtils; import org.nl.wms.sch.task.util.TaskUtils;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit;
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@ -83,11 +79,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
private final SZCallMaterialTask szCallMaterialTask; private final SZCallMaterialTask szCallMaterialTask;
@Autowired
private RedissonClient redissonClient;
@Autowired
private AcsToWmsService acsToWmsService;
/** /**
* task_id任务标识 * task_id任务标识
* task_code任务编码 * task_code任务编码
@ -209,34 +200,14 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
} }
@Override
@SneakyThrows
public JSONObject apply(JSONObject jsonObject) {
String type = (String) jsonObject.get("type");
RLock lock = redissonClient.getLock("acs_to_wms:" + type);
boolean tryLock = lock.tryLock(5, TimeUnit.SECONDS);
try {
if (tryLock) {
return acsToWmsService.transApply(jsonObject);
}
} finally {
if (tryLock) {
lock.unlock();
}
}
return null;
}
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public JSONObject transApply(JSONObject param) { public JSONObject apply(JSONObject param) {
String point_code = param.getString("device_code"); String point_code = param.getString("device_code");
String type = param.getString("type"); if (StrUtil.isBlank(point_code)) {
if (StrUtil.isBlank(type)) { throw new BadRequestException("点位不能为空!");
throw new BadRequestException("任务类型不能为空!");
} }
String type = param.getString("type");
String task_code; String task_code;
JSONObject point = param.getJSONObject("point"); JSONObject point = param.getJSONObject("point");
if (ObjectUtil.isEmpty(point)) { if (ObjectUtil.isEmpty(point)) {
@ -262,7 +233,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
method_param.put("request_param", request_param); method_param.put("request_param", request_param);
method_param.put("create_id", ACSSystem.id); method_param.put("create_id", ACSSystem.id);
method_param.put("create_name", ACSSystem.nick_name); method_param.put("create_name", ACSSystem.nick_name);
switch (type) { switch (type) {
case "1": case "1":
// 送料 // 送料
@ -279,10 +249,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
if (StrUtil.isBlank(weight)) { if (StrUtil.isBlank(weight)) {
throw new BadRequestException("重量不能为空!"); throw new BadRequestException("重量不能为空!");
} }
String is_full = param.getString("is_full"); workorder.put("real_qty", workorder.getIntValue("real_qty") + Integer.parseInt(weight));
if (StrUtil.isBlank(is_full)) { TaskUtils.addACSUpdateColum(workorder);
throw new BadRequestException("是否满垛不能为空!"); WQLObject.getWQLObject("pdm_bd_workorder").update(workorder);
}
WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail"); WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail");
JSONObject vd_update = new JSONObject(); JSONObject vd_update = new JSONObject();
vd_update.put("is_delete", "1"); vd_update.put("is_delete", "1");
@ -298,7 +268,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
vd.put("vehicle_code", vehicle_code); vd.put("vehicle_code", vehicle_code);
vd.put("material_id", workorder.getString("material_id")); vd.put("material_id", workorder.getString("material_id"));
vd.put("weight", weight); vd.put("weight", weight);
vd.put("is_full", is_full);
vd.put("workorder_id", workorder.getString("workorder_id")); vd.put("workorder_id", workorder.getString("workorder_id"));
vd.put("point_code", point_code); vd.put("point_code", point_code);
vd.put("create_id", ACSSystem.id); vd.put("create_id", ACSSystem.id);
@ -450,7 +419,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
case FJ: case FJ:
method_param.put("workorder", param.getJSONObject("workorder")); method_param.put("workorder", param.getJSONObject("workorder"));
method_param.put("vd", param.getJSONObject("vd")); method_param.put("vd", param.getJSONObject("vd"));
task_code = yzSendMaterialTask.createTask(method_param); task_code = fjToPackageTask.createTask(method_param);
break; break;
case BTHC: case BTHC:
TaskUtils.isNotEmptyPoint(point); TaskUtils.isNotEmptyPoint(point);
@ -729,7 +698,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
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());
if (!"0".equals(qty)) {
workorder.put("real_qty", qty); workorder.put("real_qty", qty);
}
String unqualified_qty = jsonObject.getString("unqualified_qty"); String unqualified_qty = jsonObject.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);
@ -738,7 +709,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
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 {
workorder.put("qualified_qty", Integer.parseInt(qty) - workorder.getIntValue("unqualified_qty")); workorder.put("qualified_qty", workorder.getIntValue("real_qty") - workorder.getIntValue("unqualified_qty"));
} }
workorder.put("realproduceend_date", DateUtil.now()); workorder.put("realproduceend_date", DateUtil.now());
@ -832,7 +803,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
JSONObject data = null; JSONObject data = null;
if (!"0000".equals(vehicle_code)) { if (!"0000".equals(vehicle_code)) {
data = WQLObject.getWQLObject("st_ivt_vehicle_detail") data = WQLObject
.getWQLObject("st_ivt_vehicle_detail")
.query("is_delete = '0' AND vehicle_type = '" + vehicle_type + "' AND vehicle_code = '" + vehicle_code + "'") .query("is_delete = '0' AND vehicle_type = '" + vehicle_type + "' AND vehicle_code = '" + vehicle_code + "'")
.uniqueResult(0); .uniqueResult(0);
} }
@ -870,7 +842,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
} else { } else {
update.put("vehicle_type", String.valueOf(Integer.parseInt(vehicle_type) + 2)); update.put("vehicle_type", String.valueOf(Integer.parseInt(vehicle_type) + 2));
} }
WQLObject.getWQLObject("sch_base_point").update(update, "point_code = '" + point_code + "'"); WQLObject
.getWQLObject("sch_base_point")
.update(update, "point_code = '" + point_code + "'");
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
result.put("status", HttpStatus.OK.value()); result.put("status", HttpStatus.OK.value());
@ -917,7 +892,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
String vehicle_code = point.getString("vehicle_code"); String vehicle_code = point.getString("vehicle_code");
JSONObject data = null; JSONObject data = null;
if (StrUtil.isNotBlank(vehicle_code) && !"0000".equals(vehicle_code)) { if (StrUtil.isNotBlank(vehicle_code) && !"0000".equals(vehicle_code)) {
data = WQL.getWO("ACS_TO_WMS") data = WQL
.getWO("ACS_TO_WMS")
.addParam("flag", "1") .addParam("flag", "1")
.addParam("vehicle_type", vehicle_type) .addParam("vehicle_type", vehicle_type)
.addParam("vehicle_code", vehicle_code) .addParam("vehicle_code", vehicle_code)
@ -940,13 +916,21 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
} }
boolean to_package = false; boolean to_package = false;
JSONObject workorder = WQL.getWO("ACS_TO_WMS")
.addParam("flag", "2") WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail");
.addParam("vehicle_code", vehicle_code) JSONObject vd = vd_table
.process() .query("is_delete = '0' AND vehicle_type = '2' AND vehicle_code = '" + vehicle_code + "'")
.uniqueResult(0); .uniqueResult(0);
if (ObjectUtil.isNotEmpty(workorder)) { if (ObjectUtil.isNotEmpty(vd)) {
to_package = TrueOrFalse.trueOrFalse("is_pri"); vd.put("is_fire", "1");
vd.put("is_in_kiln", "0");
vd_table.update(vd);
JSONObject pn = TaskUtils.buildPN(PickType.GZ, vd.getLongValue("qty"), null);
WQLObject.getWQLObject("das_produce_number").insert(pn);
JSONObject workorder = WQLObject.getWQLObject("pdm_bd_workorder").query("workorder_id = " + vd.getString("workorder_id")).uniqueResult(0);
to_package = TrueOrFalse.trueOrFalse(workorder.getString("is_pri"));
} }
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
@ -955,4 +939,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
result.put("data", to_package); result.put("data", to_package);
return result; return result;
} }
@Override
public JSONObject transApply(JSONObject param) {
return null;
}
} }

4
lms/nladmin-system/src/main/java/org/nl/wms/pda/rest/PdaController.java

@ -150,8 +150,8 @@ public class PdaController {
if (StrUtil.isBlank(point_code)) { if (StrUtil.isBlank(point_code)) {
throw new BadRequestException("点位编码不能为空!"); throw new BadRequestException("点位编码不能为空!");
} }
String vehicle_code = param.getString("vehicle_code"); String vehicle_code = TaskUtils.formatVehicleCode(param.getString("vehicle_code"));
if (StrUtil.isBlank(vehicle_code)) { if ("0000".equals(vehicle_code)) {
throw new BadRequestException("载具编码不能为空!"); throw new BadRequestException("载具编码不能为空!");
} }

28
lms/nladmin-system/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java

@ -194,12 +194,17 @@ public class PdaServiceImpl implements PdaService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public void report(String device_code, String unqualified_qty) { public void report(String device_code, String unqualified_qty) {
JSONObject device = WQLObject.getWQLObject("pdm_bi_device").query("is_used = '1' AND is_delete = '0' AND device_code = '" + device_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(device)) {
throw new BadRequestException("设备不存在或未启用!");
}
WQLObject workorder_table = WQLObject.getWQLObject("pdm_bd_workorder"); WQLObject workorder_table = WQLObject.getWQLObject("pdm_bd_workorder");
JSONObject work_order = workorder_table JSONObject work_order = workorder_table
.query("is_delete = '0' AND device_code = '" + device_code + "' AND order_status = '3'") .query("is_delete = '0' AND device_code = '" + device_code + "' AND order_status = '3'")
.uniqueResult(0); .uniqueResult(0);
if (ObjectUtil.isEmpty(work_order)) { if (ObjectUtil.isEmpty(work_order)) {
throw new BadRequestException("设备 [" + device_code + "] 未开始生产!"); throw new BadRequestException("设备 [" + device.getString("device_name") + "] 未开始生产!");
} }
int current_qty = work_order.getIntValue("unqualified_qty"); int current_qty = work_order.getIntValue("unqualified_qty");
@ -217,8 +222,8 @@ public class PdaServiceImpl implements PdaService {
if (ObjectUtil.isEmpty(point)) { if (ObjectUtil.isEmpty(point)) {
throw new BadRequestException("[" + point_code + "] 已删除或未启用!"); throw new BadRequestException("[" + point_code + "] 已删除或未启用!");
} }
TaskUtils.isLocked(point); TaskUtils.pointNameIsLocked(point);
JSONObject workorder = TaskUtils.hasWorkOrder(point); JSONObject workorder = TaskUtils.pointNameHasWorkOrder(point);
String vehicle_type = workorder.getString("vehicle_type"); String vehicle_type = workorder.getString("vehicle_type");
WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail"); WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail");
JSONObject vd_update = new JSONObject(); JSONObject vd_update = new JSONObject();
@ -291,8 +296,9 @@ public class PdaServiceImpl implements PdaService {
if (ObjectUtil.isEmpty(point)) { if (ObjectUtil.isEmpty(point)) {
throw new BadRequestException("[" + point_code + "] 已删除或未启用!"); throw new BadRequestException("[" + point_code + "] 已删除或未启用!");
} }
TaskUtils.pointNameIsLocked(point);
JSONObject workorder = TaskUtils.hasWorkOrder(point); JSONObject workorder = TaskUtils.pointNameHasWorkOrder(point);
Region region = Region.get(point.getString("region_code")); Region region = Region.get(point.getString("region_code"));
JSONObject method_param = new JSONObject(); JSONObject method_param = new JSONObject();
@ -325,6 +331,7 @@ public class PdaServiceImpl implements PdaService {
if (ObjectUtil.isEmpty(point)) { if (ObjectUtil.isEmpty(point)) {
throw new BadRequestException("[" + point_code + "] 已删除或未启用!"); throw new BadRequestException("[" + point_code + "] 已删除或未启用!");
} }
TaskUtils.pointNameIsLocked(point);
JSONObject workorder = WQLObject JSONObject workorder = WQLObject
.getWQLObject("pdm_bd_workorder") .getWQLObject("pdm_bd_workorder")
@ -342,6 +349,13 @@ public class PdaServiceImpl implements PdaService {
switch (region) { switch (region) {
case KLHJ: case KLHJ:
JSONObject vd_update = new JSONObject();
vd_update.put("is_delete", TrueOrFalse.TRUE.value());
TaskUtils.addACSUpdateColum(vd_update);
WQLObject
.getWQLObject("st_ivt_vehicle_detail")
.update(vd_update, "vehicle_type = '1' AND vehicle_code = '" + vehicle_code + "'");
WQLObject point_table = WQLObject.getWQLObject("sch_base_point"); WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
point.put("vehicle_type", VehicleType.CUP.value()); point.put("vehicle_type", VehicleType.CUP.value());
point.put("vehicle_code", vehicle_code); point.put("vehicle_code", vehicle_code);
@ -358,6 +372,12 @@ public class PdaServiceImpl implements PdaService {
yzSendEmptyTask.createTask(method_param); yzSendEmptyTask.createTask(method_param);
break; break;
case FJ: case FJ:
vd_update = new JSONObject();
vd_update.put("is_delete", TrueOrFalse.TRUE.value());
TaskUtils.addACSUpdateColum(vd_update);
WQLObject
.getWQLObject("st_ivt_vehicle_detail")
.update(vd_update, "vehicle_type = '2' AND vehicle_code = '" + vehicle_code + "'");
method_param.put("vehicle_code", vehicle_code); method_param.put("vehicle_code", vehicle_code);
fjSendEmptyTask.createTask(method_param); fjSendEmptyTask.createTask(method_param);
break; break;

2
lms/nladmin-system/src/main/java/org/nl/wms/pda/wql/PDA.wql

@ -79,6 +79,8 @@
device_name device_name
FROM FROM
pdm_bi_device pdm_bi_device
WHERE
is_workorder = '1'
ORDER BY ORDER BY
device_code ASC device_code ASC
ENDSELECT ENDSELECT

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

@ -203,10 +203,10 @@ public class WorkorderServiceImpl implements WorkordeService {
JSONObject workorder = WQLObject JSONObject workorder = WQLObject
.getWQLObject("pdm_bd_workorder") .getWQLObject("pdm_bd_workorder")
.query("is_delete = '0' AND device_id = '" + submit_obj.getString("device_id") + "' AND order_status = '3' AND workorder_id <> " + workorder_id) .query("is_delete = '0' AND device_id = '" + submit_obj.getString("device_id") + "' AND order_status IN ('2', '3') AND workorder_id <> " + workorder_id)
.uniqueResult(0); .uniqueResult(0);
if (ObjectUtil.isNotEmpty(workorder)) { if (ObjectUtil.isNotEmpty(workorder)) {
throw new BadRequestException("该设备正在执行其它工单!"); throw new BadRequestException("该设备已下发其它工单!");
} }
JSONArray request = new JSONArray(); JSONArray request = new JSONArray();
@ -425,14 +425,9 @@ 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 = row.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);
if (Region.HL.value().equals(device.getString("region_code"))) {
throw new BadRequestException("重量不能为空!");
}
throw new BadRequestException("数量不能为空!");
}
workorder.put("real_qty", qty); workorder.put("real_qty", qty);
}
String unqualified_qty = row.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);
@ -441,7 +436,7 @@ public class WorkorderServiceImpl implements WorkordeService {
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 {
workorder.put("qualified_qty", Integer.parseInt(qty) - workorder.getIntValue("unqualified_qty")); workorder.put("qualified_qty", workorder.getIntValue("real_qty") - workorder.getIntValue("unqualified_qty"));
} }
workorder.put("realproduceend_date", DateUtil.now()); workorder.put("realproduceend_date", DateUtil.now());

3
lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/empty/YZSendEmptyTask.java

@ -45,6 +45,9 @@ public class YZSendEmptyTask extends AbstractAcsTask {
if (ObjectUtil.isNotEmpty(work_order)) { if (ObjectUtil.isNotEmpty(work_order)) {
priority = TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? 50 : 1; priority = TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? 50 : 1;
} }
if (Region.KLHJ.value().equals(point.getString("region_code"))) {
priority++;
}
JSONObject task = TaskUtils.buildTask( JSONObject task = TaskUtils.buildTask(
"压制区送空", "压制区送空",

11
lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/HLSendMaterialTask.java

@ -46,7 +46,7 @@ public class HLSendMaterialTask extends AbstractAcsTask {
int priority = TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? 50 : 1; int priority = TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? 50 : 1;
JSONObject vd = form.getJSONObject("vd"); JSONObject vd = form.getJSONObject("vd");
JSONObject pn = TaskUtils.buildPN(PickType.YL, vd.getLongValue("qty"), vd.getLongValue("workorder_id")); JSONObject pn = TaskUtils.buildPN(PickType.YL, vd.getLongValue("weight"), vd.getLongValue("workorder_id"));
WQLObject.getWQLObject("das_produce_number").insert(pn); WQLObject.getWQLObject("das_produce_number").insert(pn);
JSONObject task = TaskUtils.buildTask( JSONObject task = TaskUtils.buildTask(
@ -189,6 +189,15 @@ public class HLSendMaterialTask extends AbstractAcsTask {
} }
WQLObject.getWQLObject("das_produce_number").delete("data_id = " + task.getLongValue("table_fk_id")); WQLObject.getWQLObject("das_produce_number").delete("data_id = " + task.getLongValue("table_fk_id"));
JSONObject workorder = WQL.getWO("SEND_MATERIAL_TASK").addParam("flag", "6").addParam("vd_id", task.getString("vd_id")).process().uniqueResult(0);
workorder.put("real_qty", workorder.getIntValue("real_qty") - workorder.getIntValue("weight"));
if (operation_type == OperationType.AUTO) {
TaskUtils.addACSUpdateColum(workorder);
} else if (operation_type == OperationType.MANUAL) {
TaskUtils.addCurrentUpdateColum(workorder);
}
WQLObject.getWQLObject("pdm_bd_workorder").update(workorder);
} }
} }

15
lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/wql/SEND_MATERIAL_TASK.wql

@ -17,6 +17,7 @@
输入.is_full TYPEAS s_string 输入.is_full TYPEAS s_string
输入.vehicle_type TYPEAS s_string 输入.vehicle_type TYPEAS s_string
输入.material_id TYPEAS s_string 输入.material_id TYPEAS s_string
输入.vd_id TYPEAS s_string
[临时表] [临时表]
--这边列出来的临时表就会在运行期动态创建 --这边列出来的临时表就会在运行期动态创建
@ -136,3 +137,17 @@
ENDSELECT ENDSELECT
ENDQUERY ENDQUERY
ENDIF ENDIF
IF 输入.flag = "6"
QUERY
SELECT
workorder.*,
vd.weight
FROM
pdm_bd_workorder workorder
LEFT JOIN st_ivt_vehicle_detail vd ON workorder.workorder_id = vd.workorder_id
WHERE
vd.vd_id = 输入.vd_id
ENDSELECT
ENDQUERY
ENDIF

29
lms/nladmin-system/src/main/java/org/nl/wms/sch/task/util/TaskUtils.java

@ -42,8 +42,19 @@ public class TaskUtils {
} }
} }
public static void pointNameIsLocked(JSONObject point) {
String lock_type = point.getString("lock_type");
if (!LockType.UNLOCKED.value().equals(lock_type)) {
throw new BadRequestException("[" + point.getString("point_name") + "] 已被" + LockType.get(lock_type).label() + "!");
}
}
public static JSONObject hasWorkOrder(JSONObject point) { public static JSONObject hasWorkOrder(JSONObject point) {
String device_code = point.getString("device_code"); String device_code = point.getString("device_code");
JSONObject device = WQLObject.getWQLObject("pdm_bi_device").query("is_used = '1' AND is_delete = '0' AND device_code = '" + device_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(device)) {
throw new BadRequestException("[" + device_code + "] 不存在或未启用!");
}
JSONObject work_order = WQLObject JSONObject work_order = WQLObject
.getWQLObject("pdm_bd_workorder") .getWQLObject("pdm_bd_workorder")
.query("is_delete = '0' AND device_code = '" + device_code + "' AND order_status = '3'") .query("is_delete = '0' AND device_code = '" + device_code + "' AND order_status = '3'")
@ -54,6 +65,22 @@ public class TaskUtils {
return work_order; return work_order;
} }
public static JSONObject pointNameHasWorkOrder(JSONObject point) {
String device_code = point.getString("device_code");
JSONObject device = WQLObject.getWQLObject("pdm_bi_device").query("is_used = '1' AND is_delete = '0' AND device_code = '" + device_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(device)) {
throw new BadRequestException("[" + device_code + "] 不存在或未启用!");
}
JSONObject work_order = WQLObject
.getWQLObject("pdm_bd_workorder")
.query("is_delete = '0' AND device_code = '" + device_code + "' AND order_status = '3'")
.uniqueResult(0);
if (ObjectUtil.isEmpty(work_order)) {
throw new BadRequestException("[" + point.getString("point_name") + "] 所属设备 [" + device.getString("device_name") + "] 未开始生产!");
}
return work_order;
}
public static JSONObject buildTask( public static JSONObject buildTask(
String task_name, String task_name,
String task_type, String task_type,
@ -134,7 +161,7 @@ public class TaskUtils {
row.put("update_time", DateUtil.now()); row.put("update_time", DateUtil.now());
} }
public static JSONObject buildPN(PickType pickType, long real_qty, long workorder_id) { public static JSONObject buildPN(PickType pickType, long real_qty, Long workorder_id) {
JSONObject pn = new JSONObject(); JSONObject pn = new JSONObject();
pn.put("data_id", IdUtil.getSnowflake(1L, 1L).nextId()); pn.put("data_id", IdUtil.getSnowflake(1L, 1L).nextId());
pn.put("pick_type", pickType.value()); pn.put("pick_type", pickType.value());

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

@ -41,15 +41,15 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="静置时间" prop="standing_time"> <el-form-item label="困料时间" prop="standing_time">
<el-input v-model="form.standing_time" type="number" style="width: 300px" /> <el-input v-model="form.standing_time" type="number" style="width: 300px"><i slot="suffix" style="font-style:normal;margin-right: 10px;">分钟</i></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="阈值时间" prop="threshold_time"> <el-form-item label="超时时间" prop="threshold_time">
<el-input v-model="form.threshold_time" type="number" style="width: 300px" /> <el-input v-model="form.threshold_time" type="number" style="width: 300px"><i slot="suffix" style="font-style:normal;margin-right: 10px;">分钟</i></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>

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

@ -42,7 +42,7 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="单重" prop="weight"> <el-form-item label="单重" prop="weight">
<el-input v-model="form.weight" type="number" style="width: 300px" /> <el-input v-model="form.weight" type="number" style="width: 300px"><i slot="suffix" style="font-style:normal;margin-right: 10px;">千克</i></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -56,28 +56,28 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="长边长度" prop="a"> <el-form-item label="长边长度" prop="a">
<el-input v-model="form.a" type="number" style="width: 300px" /> <el-input v-model="form.a" type="number" style="width: 300px"><i slot="suffix" style="font-style:normal;margin-right: 10px;">毫米</i></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="短边长度" prop="b"> <el-form-item label="短边长度" prop="b">
<el-input v-model="form.b" type="number" style="width: 300px" /> <el-input v-model="form.b" type="number" style="width: 300px"><i slot="suffix" style="font-style:normal;margin-right: 10px;">毫米</i></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="梯形高度" prop="h"> <el-form-item label="梯形高度" prop="h">
<el-input v-model="form.h" type="number" style="width: 300px" /> <el-input v-model="form.h" type="number" style="width: 300px"><i slot="suffix" style="font-style:normal;margin-right: 10px;">毫米</i></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="砖块厚度" prop="w"> <el-form-item label="砖块厚度" prop="w">
<el-input v-model="form.w" type="number" style="width: 300px" /> <el-input v-model="form.w" type="number" style="width: 300px"><i slot="suffix" style="font-style:normal;margin-right: 10px;">毫米</i></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>

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

@ -129,7 +129,7 @@
<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"><i slot="suffix" style="font-style:normal;margin-right: 10px;">千克</i></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>

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

@ -129,7 +129,7 @@
<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"><i slot="suffix" style="font-style:normal;margin-right: 10px;"></i></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -197,7 +197,7 @@
{{ dict.label.vehicle_type[scope.row.vehicle_type] }} {{ dict.label.vehicle_type[scope.row.vehicle_type] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="plan_qty" label="计划数量/重量" :min-width="flexWidth('plan_qty',crud.data,'计划数量/重量')" /> <el-table-column prop="plan_qty" label="计划数量" :min-width="flexWidth('plan_qty',crud.data,'计划数量')" />
<el-table-column prop="is_urgent" label="是否加急" :min-width="flexWidth('is_urgent',crud.data,'是否加急')"> <el-table-column prop="is_urgent" label="是否加急" :min-width="flexWidth('is_urgent',crud.data,'是否加急')">
<template slot-scope="scope"> <template slot-scope="scope">
{{ dict.label.true_or_false[scope.row.is_urgent] }} {{ dict.label.true_or_false[scope.row.is_urgent] }}

8
lms/nladmin-ui/src/views/wms/sch/point/index.vue

@ -24,8 +24,8 @@
clearable clearable
filterable filterable
placeholder="所属区域" placeholder="所属区域"
@clear="pointTypesList = null" @clear="pointTypesList = null; query.point_type = null"
@change="getPointStatusAndTypeList(query.region_id, 1)" @change="getPointStatusAndTypeList(query.region_id, 1); query.point_type = null"
> >
<el-option <el-option
v-for="item in regionList" v-for="item in regionList"
@ -146,8 +146,8 @@
placeholder="请选择" placeholder="请选择"
style="width: 300px" style="width: 300px"
filterable filterable
@change="getPointStatusAndTypeList(form.region_id, 2)" @change="getPointStatusAndTypeList(form.region_id, 2); form.point_type = null"
@clear="pointTypesDialogList = null" @clear="pointTypesDialogList = null; form.point_type = null"
> >
<el-option <el-option
v-for="item in regionList" v-for="item in regionList"

Loading…
Cancel
Save