李永德 2 years ago
parent
commit
c34e0c36af
  1. 12
      lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java
  2. 2
      lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java
  3. 64
      lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  4. 60
      lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/wql/ACS_TO_WMS.wql
  5. 2
      lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/dto/WorkorderDto.java
  6. 22
      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/manage/AbstractAcsTask.java
  8. 2
      lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/TaskStatus.java
  9. 13
      lms/nladmin-system/src/main/java/org/nl/wms/sch/service/impl/TaskServiceImpl.java
  10. 162
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/empty/GTKCallEmptyTask.java
  11. 19
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/empty/wql/CALL_EMPTY_TASK.wql
  12. 4
      lms/nladmin-system/src/main/java/org/nl/wms/sch/wql/QSCH_TASK_01.wql
  13. 14
      lms/nladmin-system/src/test/java/org/nl/test/TempTest.java
  14. 18
      lms/nladmin-ui/src/views/login.vue
  15. 3
      lms/nladmin-ui/src/views/wms/sch/point/index.vue
  16. 32
      lms/nladmin-ui/src/views/wms/sch/task/index.vue

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

@ -136,18 +136,10 @@ public class AcsToWmsController {
} }
@PostMapping("/getVehicleInfo") @PostMapping("/getVehicleInfo")
@Log("根据载具编码获取托盘信息") @Log("根据载具编码获盘信息")
@ApiOperation("根据载具编码获取托盘信息") @ApiOperation("根据载具编码获盘信息")
@SaIgnore @SaIgnore
public ResponseEntity<Object> getVehicleInfo(@RequestBody JSONObject whereJson) { public ResponseEntity<Object> getVehicleInfo(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(acsToWmsService.getVehicleInfo(whereJson), HttpStatus.OK); return new ResponseEntity<>(acsToWmsService.getVehicleInfo(whereJson), HttpStatus.OK);
} }
@PostMapping("/updateFoldPoint")
@Log("更新叠盘位点位状态")
@ApiOperation("更新叠盘位点位状态")
@SaIgnore
public ResponseEntity<Object> updateFoldPoint(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(acsToWmsService.updateFoldPoint(whereJson), HttpStatus.OK);
}
} }

2
lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java

@ -106,6 +106,4 @@ public interface AcsToWmsService {
JSONObject feedbackVehicleType(JSONObject param); JSONObject feedbackVehicleType(JSONObject param);
JSONObject getVehicleInfo(JSONObject whereJson); JSONObject getVehicleInfo(JSONObject whereJson);
JSONObject updateFoldPoint(JSONObject param);
} }

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

@ -11,6 +11,7 @@ import lombok.RequiredArgsConstructor;
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;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject; import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder; import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.wms.basedata.eum.TrueOrFalse; import org.nl.wms.basedata.eum.TrueOrFalse;
@ -19,6 +20,7 @@ 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.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.GTKCallEmptyTask;
import org.nl.wms.sch.task.call.empty.HLCallEmptyTask; import org.nl.wms.sch.task.call.empty.HLCallEmptyTask;
import org.nl.wms.sch.task.call.empty.YZCallEmptyTask; import org.nl.wms.sch.task.call.empty.YZCallEmptyTask;
import org.nl.wms.sch.task.call.material.FJCallMaterialTask; import org.nl.wms.sch.task.call.material.FJCallMaterialTask;
@ -58,6 +60,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
private final FJSendEmptyTask fjSendEmptyTask; private final FJSendEmptyTask fjSendEmptyTask;
private final GTKCallEmptyTask gtkCallEmptyTask;
/** /**
* task_id任务标识 * task_id任务标识
* task_code任务编码 * task_code任务编码
@ -284,21 +288,27 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
break; break;
case "4": case "4":
// 叫空 // 叫空
switch (region) {
case HL:
String device_code = point.getString("device_code"); String device_code = point.getString("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'")
.uniqueResult(0); .uniqueResult(0);
method_param.put("workorder", work_order); method_param.put("workorder", work_order);
switch (region) {
case HL:
task_code = hlCallEmptyTask.createTask(method_param); task_code = hlCallEmptyTask.createTask(method_param);
break; break;
case YZ: case YZ:
device_code = point.getString("device_code");
work_order = WQLObject
.getWQLObject("pdm_bd_workorder")
.query("is_delete = '0' AND device_code = '" + device_code + "' AND order_status = '3'")
.uniqueResult(0);
method_param.put("workorder", work_order);
task_code = yzCallEmptyTask.createTask(method_param); task_code = yzCallEmptyTask.createTask(method_param);
break; break;
case GTK: case GTK:
task_code = gtkCallEmptyTask.createTask(method_param);
break; break;
default: default:
throw new BadRequestException("[" + region.label() + "] 不能发起叫空任务!"); throw new BadRequestException("[" + region.label() + "] 不能发起叫空任务!");
@ -368,7 +378,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
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", TrueOrFalse.TRUE.value()); vd_update.put("is_delete", TrueOrFalse.TRUE.value());
vd_table.update(vd_update, "vehicle_type = '" + vehicle_type + "' AND vehicle_code = '" + vehicle_code + "'"); TaskUtils.addACSUpdateColum(vd_update);
vd_table.update(vd_update, "is_delete = '0' AND vehicle_type = '" + vehicle_type + "' AND vehicle_code = '" + vehicle_code + "'");
JSONObject vd = new JSONObject(); JSONObject vd = new JSONObject();
vd.put("vd_id", IdUtil.getSnowflake(1, 1).nextId()); vd.put("vd_id", IdUtil.getSnowflake(1, 1).nextId());
@ -729,11 +740,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
if (StrUtil.isBlank(point_code)) { if (StrUtil.isBlank(point_code)) {
throw new BadRequestException("点位不能为空!"); throw new BadRequestException("点位不能为空!");
} }
String vehicle_code = whereJson.getString("vehicle_code");
vehicle_code = TaskUtils.formatVehicleCode(vehicle_code);
if ("0000".equals(vehicle_code)) {
throw new BadRequestException("载具编码不能为空!");
}
JSONObject point = WQLObject JSONObject point = WQLObject
.getWQLObject("sch_base_point") .getWQLObject("sch_base_point")
.query("is_used = '1' AND point_code = '" + point_code + "'") .query("is_used = '1' AND point_code = '" + point_code + "'")
@ -764,22 +770,17 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
throw new BadRequestException("未知载具类型!"); throw new BadRequestException("未知载具类型!");
} }
String vehicle_code = point.getString("vehicle_code");
JSONObject data = null; JSONObject data = null;
if (!"0000".equals(vehicle_code)) { if (!"0000".equals(vehicle_code)) {
data = WQLObject data = WQL
.getWQLObject("st_ivt_vehicle_detail") .getWO("ACS_TO_WMS")
.query("is_delete = '0' AND vehicle_type = '" + vehicle_type + "' AND vehicle_code = '" + vehicle_code + "'") .addParam("flag", "1")
.addParam("vehicle_type", vehicle_type)
.addParam("vehicle_code", vehicle_code)
.process()
.uniqueResult(0); .uniqueResult(0);
} }
if (ObjectUtil.isNotEmpty(data)) {
assert data != null;
JSONObject material = WQLObject.getWQLObject("md_me_materialbase").query("material_id = " + data.getString("material_id")).uniqueResult(0);
data.put("product_code", material.getString("product_code"));
data.put("AlongSide", material.getString("a"));
data.put("BshortSide", material.getString("b"));
data.put("Htrapezoidal", material.getString("h"));
data.put("Wthickness", material.getString("w"));
}
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
result.put("status", HttpStatus.OK.value()); result.put("status", HttpStatus.OK.value());
@ -787,25 +788,4 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
result.put("data", data); result.put("data", data);
return result; return result;
} }
@Override
public JSONObject updateFoldPoint(JSONObject param) {
String point_code = param.getString("device_code");
if (StrUtil.isBlank(point_code)) {
throw new BadRequestException("点位不能为空!");
}
String point_status = param.getString("point_status");
if (StrUtil.isBlank(point_status)) {
throw new BadRequestException("点位状态不能为空!");
}
JSONObject point_update = new JSONObject();
point_update.put("point_status", point_status);
WQLObject.getWQLObject("sch_base_point").update(point_update, "point_code = '" + point_code + "'");
JSONObject result = new JSONObject();
result.put("status", HttpStatus.OK.value());
result.put("message", "更新点位状态成功!");
return result;
}
} }

60
lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/wql/ACS_TO_WMS.wql

@ -0,0 +1,60 @@
[交易说明]
交易名: 工单分页查询
所属模块:
功能简述:
版权所有:
表引用:
版本经历:
[数据库]
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
[IO定义]
#################################################
## 表字段对应输入参数
#################################################
输入.flag TYPEAS s_string
输入.vehicle_type TYPEAS s_string
输入.vehicle_code TYPEAS s_string
[临时表]
--这边列出来的临时表就会在运行期动态创建
[临时变量]
--所有中间过程变量均可在此处定义
[业务过程]
##########################################
# 1、输入输出检查 #
##########################################
##########################################
# 2、主过程前处理 #
##########################################
##########################################
# 3、业务主过程 #
##########################################
IF 输入.flag = "1"
QUERY
SELECT
vd.*,
material.product_code,
material.a AS AlongSide,
material.b AS BshortSide,
material.h AS Htrapezoidal,
material.w AS Wthickness
FROM
st_ivt_vehicle_detail vd
JOIN md_me_materialbase material ON vd.material_id = material.material_id
WHERE
vd.is_delete = '0'
AND vd.vehicle_type = 输入.vehicle_type
AND vd.vehicle_code = 输入.vehicle_code
ENDSELECT
ENDQUERY
ENDIF

2
lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/dto/WorkorderDto.java

@ -108,4 +108,6 @@ public class WorkorderDto implements Serializable {
private String is_pri; private String is_pri;
private String ext_code; private String ext_code;
private String region_code;
} }

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

@ -73,7 +73,7 @@ public class WorkorderServiceImpl implements WorkordeService {
if (StrUtil.isNotEmpty(material)) { if (StrUtil.isNotEmpty(material)) {
map.put("material", "%" + material + "%"); map.put("material", "%" + material + "%");
} }
JSONObject jsonObject = WQL.getWO("MPS_PRODUCEDURE001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "ShiftOrder.update_time desc"); JSONObject jsonObject = WQL.getWO("MPS_PRODUCEDURE001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "ShiftOrder.order_status ASC, ShiftOrder.create_time DESC");
return jsonObject; return jsonObject;
} }
@ -115,14 +115,12 @@ public class WorkorderServiceImpl implements WorkordeService {
work_order.put("planproducestart_date", dto.getPlanproducestart_date()); work_order.put("planproducestart_date", dto.getPlanproducestart_date());
work_order.put("planproduceend_date", dto.getPlanproduceend_date()); work_order.put("planproduceend_date", dto.getPlanproduceend_date());
work_order.put("material_id", dto.getMaterial_id()); work_order.put("material_id", dto.getMaterial_id());
Long device_id = dto.getDevice_id(); String region_code = dto.getRegion_code();
JSONObject device = WQLObject.getWQLObject("pdm_bi_device").query("device = " + device_id).uniqueResult(0);
String device_region_code = device.getString("region_code");
String vehicle_type = dto.getVehicle_type(); String vehicle_type = dto.getVehicle_type();
if (!Region.FJ.value().equals(device_region_code)) { if (!Region.FJ.value().equals(region_code)) {
if (Region.YZ.value().equals(device_region_code)) { if (Region.YZ.value().equals(region_code)) {
vehicle_type = VehicleType.STEEL_TRAY.value(); vehicle_type = VehicleType.STEEL_TRAY.value();
} else if (Region.HL.value().equals(device_region_code)) { } else if (Region.HL.value().equals(region_code)) {
vehicle_type = VehicleType.CUP.value(); vehicle_type = VehicleType.CUP.value();
} }
} }
@ -140,9 +138,6 @@ public class WorkorderServiceImpl implements WorkordeService {
work_order.put("create_id", user_id); work_order.put("create_id", user_id);
work_order.put("create_name", nick_name); work_order.put("create_name", nick_name);
work_order.put("create_time", now); work_order.put("create_time", now);
work_order.put("update_optid", user_id);
work_order.put("update_optname", nick_name);
work_order.put("update_time", now);
WQLObject.getWQLObject("pdm_bd_workorder").insert(work_order); WQLObject.getWQLObject("pdm_bd_workorder").insert(work_order);
} }
@ -219,11 +214,12 @@ public class WorkorderServiceImpl implements WorkordeService {
throw new BadRequestException(String.valueOf(result.get("message"))); throw new BadRequestException(String.valueOf(result.get("message")));
} }
JSONObject order_status = new JSONObject(); JSONObject order_update = new JSONObject();
order_status.put("order_status", WorkOrderEnum.ORDER_STATUS_DELIVERED.value()); order_update.put("order_status", WorkOrderEnum.ORDER_STATUS_DELIVERED.value());
TaskUtils.addCurrentUpdateColum(order_update);
WQLObject WQLObject
.getWQLObject("pdm_bd_workorder") .getWQLObject("pdm_bd_workorder")
.update(order_status, "workorder_id = " + workorder_id); .update(order_update, "workorder_id = " + workorder_id);
} }
@Override @Override

3
lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/AbstractAcsTask.java

@ -173,7 +173,7 @@ public abstract class AbstractAcsTask {
.build(); .build();
JSONArray tasks = new JSONArray() {{ JSONArray tasks = new JSONArray() {{
add(acs_task); add(JSONObject.parseObject(JSON.toJSONString(acs_task)));
}}; }};
JSONObject result = AcsUtil.notifyAcs("api/wms/task", tasks); JSONObject result = AcsUtil.notifyAcs("api/wms/task", tasks);
@ -258,6 +258,7 @@ public abstract class AbstractAcsTask {
point1.put("vehicle_type", ""); point1.put("vehicle_type", "");
point1.put("vehicle_code", ""); point1.put("vehicle_code", "");
point1.put("point_status", PointStatus.EMPTY.value()); point1.put("point_status", PointStatus.EMPTY.value());
TaskUtils.addACSUpdateColum(point1);
point_table.update(point1); point_table.update(point1);
} }
} }

2
lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/TaskStatus.java

@ -7,7 +7,7 @@ public enum TaskStatus {
CREATED("生成", "1"), CREATED("生成", "1"),
SURE_START("确定起点", "2"), SURE_START("确定起点", "2"),
SURE_END("确定终点", "3"), SURE_END("确定终点", "3"),
START_AND_END("起点终点确认", "4"), START_AND_END("确认起点终点", "4"),
ISSUE("下发", "5"), ISSUE("下发", "5"),
EXECUTING("执行中", "6"), EXECUTING("执行中", "6"),
FINISHED("完成", "7"), FINISHED("完成", "7"),

13
lms/nladmin-system/src/main/java/org/nl/wms/sch/service/impl/TaskServiceImpl.java

@ -19,14 +19,11 @@ import org.nl.wms.basedata.service.ClassstandardService;
import org.nl.wms.basedata.service.dto.ClassstandardDto; import org.nl.wms.basedata.service.dto.ClassstandardDto;
import org.nl.wms.sch.manage.AbstractAcsTask; import org.nl.wms.sch.manage.AbstractAcsTask;
import org.nl.wms.sch.manage.TaskStatus; import org.nl.wms.sch.manage.TaskStatus;
import org.nl.wms.sch.service.PointService;
import org.nl.wms.sch.service.RegionService;
import org.nl.wms.sch.service.TaskService; import org.nl.wms.sch.service.TaskService;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -41,8 +38,6 @@ import java.util.Map;
public class TaskServiceImpl implements TaskService { public class TaskServiceImpl implements TaskService {
private final ClassstandardService classstandardService; private final ClassstandardService classstandardService;
private final RegionService regionService;
private final PointService pointService;
@Override @Override
public Map<String, Object> queryAll(Map form, Pageable page) { public Map<String, Object> queryAll(Map form, Pageable page) {
@ -90,15 +85,17 @@ public class TaskServiceImpl implements TaskService {
if (StrUtil.isNotEmpty(whereJson.getString("point_code"))) { if (StrUtil.isNotEmpty(whereJson.getString("point_code"))) {
map.put("point_code", "%" + whereJson.getString("point_code") + "%"); map.put("point_code", "%" + whereJson.getString("point_code") + "%");
} }
return WQL.getWO("QSCH_TASK_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "task.update_time desc"); return WQL.getWO("QSCH_TASK_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "task.create_time desc");
} }
@Transactional(rollbackFor = Exception.class)
@Override @Override
public void operation(Map<String, Object> map) { public void operation(Map<String, Object> map) {
String task_id = MapUtil.getStr(map, "task_id"); String task_id = MapUtil.getStr(map, "task_id");
String method_name = MapUtil.getStr(map, "method_name"); String method_name = MapUtil.getStr(map, "method_name");
JSONObject taskObj = WQLObject.getWQLObject("sch_base_task").query("task_id = '" + task_id + "'").uniqueResult(0); JSONObject taskObj = WQLObject.getWQLObject("sch_base_task").query("task_id = '" + task_id + "'").uniqueResult(0);
if (taskObj.getString("task_status").equals(TaskStatus.FINISHED.value())) throw new BadRequestException("任务已完成!"); if (taskObj.getString("task_status").equals(TaskStatus.FINISHED.value()))
throw new BadRequestException("任务已完成!");
// 任务处理类 // 任务处理类
String processing_class = taskObj.getString("handle_class"); String processing_class = taskObj.getString("handle_class");
String message = ""; String message = "";

162
lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/empty/GTKCallEmptyTask.java

@ -0,0 +1,162 @@
package org.nl.wms.sch.task.call.empty;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.wms.basedata.eum.VehicleType;
import org.nl.wms.sch.manage.*;
import org.nl.wms.sch.task.util.TaskUtils;
import org.springframework.stereotype.Component;
/**
* @author zhangjiangwei
* @date 2023/04/21 09:15
*/
@RequiredArgsConstructor
@Component
public class GTKCallEmptyTask extends AbstractAcsTask {
@Override
public void updateTaskStatus(JSONObject task, String status) {
if (TaskStatus.EXECUTING.value().equals(status)) {
task.put("task_status", TaskStatus.EXECUTING.value());
TaskUtils.addACSUpdateColum(task);
WQLObject.getWQLObject("sch_base_task").update(task);
} else if (TaskStatus.FINISHED.value().equals(status)) {
this.finishTask(task, OperationType.AUTO);
} else if (TaskStatus.CANCELLED.value().equals(status)) {
this.cancelTask(task, OperationType.AUTO);
}
}
@Override
public String createTask(JSONObject form) {
JSONObject point = form.getJSONObject("point");
JSONObject task = TaskUtils.buildTask(
"钢托库叫空",
TaskType.CALL_EMPTY.value(),
TaskStatus.SURE_END.value(),
null,
point.getString("point_code"),
null,
VehicleType.STEEL_TRAY.value(),
null,
"1",
GTKCallEmptyTask.class.getName(),
form.getString("create_mode"),
form.getString("request_param"),
form.getString("create_id"),
form.getString("create_name")
);
WQLObject.getWQLObject("sch_base_task").insert(task);
point.put("lock_type", LockType.TASK_LOCKED.value());
point.put("task_code", task.getString("task_code"));
TaskUtils.addFormUpdateColum(point, form);
WQLObject.getWQLObject("sch_base_point").update(point);
return task.getString("task_code");
}
@Override
public void findStartPoint() {
WQLObject task_table = WQLObject.getWQLObject("sch_base_task");
JSONArray tasks = task_table
.query("is_delete = '0' AND task_status = '" + TaskStatus.SURE_END.value() + "' AND handle_class = '" + GTKCallEmptyTask.class.getName() + "'", "priority DESC, create_time ASC")
.getResultJSONArray(0);
for (int i = 0; i < tasks.size(); i++) {
JSONObject task = tasks.getJSONObject(i);
JSONObject point = WQL
.getWO("CALL_EMPTY_TASK")
.addParam("flag", "3")
.process()
.uniqueResult(0);
if (ObjectUtil.isNotEmpty(point)) {
task.put("task_status", TaskStatus.START_AND_END.value());
task.put("point_code1", point.getString("point_code"));
task.put("vehicle_code", TaskUtils.formatVehicleCode(point.getString("vehicle_code")));
task.put("remark", "");
TaskUtils.addAutoUpdateColum(task);
task_table.update(task);
}
}
}
@Override
public void forceFinish(String task_id) {
JSONObject task = WQLObject.getWQLObject("sch_base_task").query("task_id = " + task_id).uniqueResult(0);
if (ObjectUtil.isEmpty(task)) {
throw new BadRequestException("未找到任务!");
}
this.finishTask(task, OperationType.MANUAL);
}
@Override
public void cancel(String task_id) {
JSONObject task = WQLObject.getWQLObject("sch_base_task").query("task_id = " + task_id).uniqueResult(0);
if (ObjectUtil.isEmpty(task)) {
throw new BadRequestException("未找到任务!");
}
this.cancelTask(task, OperationType.MANUAL);
}
public void cancelTask(JSONObject task, OperationType operation_type) {
if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) {
task.put("task_status", TaskStatus.CANCELLED.value());
if (operation_type == OperationType.AUTO) {
TaskUtils.addACSUpdateColum(task);
} else if (operation_type == OperationType.MANUAL) {
TaskUtils.addCurrentUpdateColum(task);
}
WQLObject.getWQLObject("sch_base_task").update(task);
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
JSONObject point2 = new JSONObject();
point2.put("lock_type", LockType.UNLOCKED.value());
point2.put("task_code", "");
if (operation_type == OperationType.AUTO) {
TaskUtils.addACSUpdateColum(point2);
} else if (operation_type == OperationType.MANUAL) {
TaskUtils.addCurrentUpdateColum(point2);
}
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'");
}
}
public void finishTask(JSONObject task, OperationType operation_type) {
if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) {
task.put("task_status", TaskStatus.FINISHED.value());
if (operation_type == OperationType.AUTO) {
TaskUtils.addACSUpdateColum(task);
} else if (operation_type == OperationType.MANUAL) {
TaskUtils.addCurrentUpdateColum(task);
}
WQLObject.getWQLObject("sch_base_task").update(task);
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
JSONObject point2 = new JSONObject();
point2.put("lock_type", LockType.UNLOCKED.value());
point2.put("task_code", "");
if (operation_type == OperationType.AUTO) {
TaskUtils.addACSUpdateColum(point2);
} else if (operation_type == OperationType.MANUAL) {
TaskUtils.addCurrentUpdateColum(point2);
}
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'");
}
}
@Override
public void pickUpComplete(JSONObject task) {
}
}

19
lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/empty/wql/CALL_EMPTY_TASK.wql

@ -73,3 +73,22 @@
ENDSELECT ENDSELECT
ENDQUERY ENDQUERY
ENDIF ENDIF
IF 输入.flag = "3"
QUERY
SELECT
*
FROM
sch_base_point point
LEFT JOIN sch_base_task task ON point.point_code = task.point_code1
AND task.task_status <> '7'
AND task_status <> '8'
WHERE
point.is_used = '1'
AND point.lock_type = '1'
AND point.region_code = 'GTK'
AND point.point_type = '1'
AND task.task_id IS NULL
ENDSELECT
ENDQUERY
ENDIF

4
lms/nladmin-system/src/main/java/org/nl/wms/sch/wql/QSCH_TASK_01.wql

@ -56,12 +56,14 @@
point1.region_name AS point1_region_name, point1.region_name AS point1_region_name,
point2.point_name AS point2_name, point2.point_name AS point2_name,
point2.region_name AS point2_region_name, point2.region_name AS point2_region_name,
material.material_code material.material_code,
dd.label AS task_status_name
FROM FROM
sch_base_task task sch_base_task task
LEFT JOIN sch_base_point point1 ON task.point_code1 = point1.point_code LEFT JOIN sch_base_point point1 ON task.point_code1 = point1.point_code
LEFT JOIN sch_base_point point2 ON task.point_code2 = point2.point_code LEFT JOIN sch_base_point point2 ON task.point_code2 = point2.point_code
LEFT JOIN md_me_materialbase material ON task.material_id = material.material_id LEFT JOIN md_me_materialbase material ON task.material_id = material.material_id
LEFT JOIN sys_dict_detail dd ON dd.name = 'task_status' AND task.task_status = dd.value
WHERE WHERE
task.is_delete = '0' task.is_delete = '0'
OPTION 输入.unFinish <> "" OPTION 输入.unFinish <> ""

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

@ -2,9 +2,11 @@ package org.nl.test;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject; import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.wms.sch.manage.LockType; import org.nl.wms.sch.manage.LockType;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
@ -22,9 +24,13 @@ public class TempTest {
@Test @Test
public void test01() { public void test01() {
Set<String> materialbase = WQLObject.getWQLObject("md_me_materialbase").query().uniqueResult(0).keySet(); JSONObject data = WQL
for (String s : materialbase) { .getWO("ACS_TO_WMS")
System.out.println(s); .addParam("flag", "1")
} .addParam("vehicle_type", "2")
.addParam("vehicle_code", "5555")
.process()
.uniqueResult(0);
System.out.println(data);
} }
} }

18
lms/nladmin-ui/src/views/login.vue

@ -98,9 +98,9 @@ export default {
}) })
}, },
getCookie() { getCookie() {
const username = Cookies.get('username') const username = Cookies.get('lms-username')
let password = Cookies.get('password') let password = Cookies.get('lms-password')
const rememberMe = Cookies.get('rememberMe') const rememberMe = Cookies.get('lms-rememberMe')
// cookie // cookie
this.cookiePass = password === undefined ? '' : password this.cookiePass = password === undefined ? '' : password
password = password === undefined ? this.loginForm.password : password password = password === undefined ? this.loginForm.password : password
@ -124,13 +124,13 @@ export default {
if (valid) { if (valid) {
this.loading = true this.loading = true
if (user.rememberMe) { if (user.rememberMe) {
Cookies.set('username', user.username, { expires: Config.passCookieExpires }) Cookies.set('lms-username', user.username, { expires: Config.passCookieExpires })
Cookies.set('password', this.loginForm.password, { expires: Config.passCookieExpires }) Cookies.set('lms-password', this.loginForm.password, { expires: Config.passCookieExpires })
Cookies.set('rememberMe', user.rememberMe, { expires: Config.passCookieExpires }) Cookies.set('lms-rememberMe', user.rememberMe, { expires: Config.passCookieExpires })
} else { } else {
Cookies.remove('username') Cookies.remove('lms-username')
Cookies.remove('password') Cookies.remove('lms-password')
Cookies.remove('rememberMe') Cookies.remove('lms-rememberMe')
} }
this.$store.dispatch('Login', user).then(() => { this.$store.dispatch('Login', user).then(() => {
this.loading = false this.loading = false

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

@ -370,6 +370,9 @@ export default {
title: '点位', title: '点位',
url: 'api/point', url: 'api/point',
idField: 'point_id', idField: 'point_id',
query: {
is_used: '1'
},
optShow: { optShow: {
add: true, add: true,
edit: false, edit: false,

32
lms/nladmin-ui/src/views/wms/sch/task/index.vue

@ -28,12 +28,12 @@
@keyup.enter.native="crud.toQuery" @keyup.enter.native="crud.toQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="起点终点"> <el-form-item label="起点/终点">
<el-input <el-input
v-model="query.point_code" v-model="query.point_code"
clearable clearable
style="width: 180px" style="width: 180px"
placeholder="起点终点" placeholder="起点/终点"
@keyup.enter.native="crud.toQuery" @keyup.enter.native="crud.toQuery"
/> />
</el-form-item> </el-form-item>
@ -84,35 +84,37 @@
<el-table-column type="selection" width="50" /> <el-table-column type="selection" width="50" />
<el-table-column v-if="false" prop="task_id" label="任务标识" min-width="150" show-overflow-tooltip /> <el-table-column v-if="false" prop="task_id" label="任务标识" min-width="150" show-overflow-tooltip />
<el-table-column v-if="false" prop="material_id" label="物料标识" min-width="150" show-overflow-tooltip /> <el-table-column v-if="false" prop="material_id" label="物料标识" min-width="150" show-overflow-tooltip />
<el-table-column prop="task_code" label="任务编码" min-width="100" show-overflow-tooltip /> <el-table-column prop="task_code" label="任务编码" :min-width="flexWidth('task_code',crud.data,'任务编码')" />
<el-table-column v-if="false" prop="task_type" label="任务类型" /> <el-table-column v-if="false" prop="task_type" label="任务类型" />
<el-table-column v-if="false" prop="acs_task_type" label="acs任务类型" min-width="120" show-overflow-tooltip > <el-table-column v-if="false" prop="acs_task_type" label="acs任务类型" min-width="120" show-overflow-tooltip >
<template slot-scope="scope"> <template slot-scope="scope">
{{ dict.label.acs_task_type[scope.row.acs_task_type] }} {{ dict.label.acs_task_type[scope.row.acs_task_type] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="task_name" label="任务名称" min-width="120" show-overflow-tooltip /> <el-table-column prop="task_name" label="任务类型" :min-width="flexWidth('task_name',crud.data,'任务类型')" />
<el-table-column v-if="false" prop="task_type_name" label="任务类型" min-width="120" show-overflow-tooltip /> <el-table-column v-if="false" prop="task_type_name" label="任务类型" min-width="120" show-overflow-tooltip />
<el-table-column v-if="false" prop="task_status" label="任务状态" /> <el-table-column v-if="false" prop="task_status" label="任务状态" />
<el-table-column prop="task_status_name" label="任务状态" width="95px" :formatter="formatTaskStatusName" /> <el-table-column prop="task_status_name" label="任务状态" :min-width="flexWidth('task_status_name',crud.data,'任务状态')" />
<el-table-column prop="point1_name" label="起点" width="150" /> <el-table-column prop="point1_name" label="起点" :min-width="flexWidth('point1_name',crud.data,'起点')" />
<el-table-column prop="point1_region_name" label="起点区域" width="80" /> <el-table-column prop="point1_region_name" label="起点区域" :min-width="flexWidth('point1_region_name',crud.data,'起点区域')" />
<el-table-column prop="point2_name" label="终点" min-width="150" show-overflow-tooltip /> <el-table-column prop="point2_name" label="终点" :min-width="flexWidth('point2_name',crud.data,'终点')" />
<el-table-column prop="point2_region_name" label="终点区域" min-width="80" show-overflow-tooltip /> <el-table-column prop="point2_region_name" label="终点区域" :min-width="flexWidth('point2_region_name',crud.data,'终点区域')" />
<el-table-column prop="vehicle_type" label="载具类型" min-width="80" show-overflow-tooltip > <el-table-column prop="vehicle_type" label="载具类型" :min-width="flexWidth('vehicle_type',crud.data,'载具类型')">
<template slot-scope="scope"> <template slot-scope="scope">
{{ 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="vehicle_code" label="载具编码" min-width="100" show-overflow-tooltip /> <el-table-column prop="vehicle_code" label="载具编码" :min-width="flexWidth('vehicle_code',crud.data,'载具编码')" />
<el-table-column prop="material_code" label="物料编码" min-width="260" show-overflow-tooltip /> <el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
<!--<el-table-column prop="point_code3" label="点位3" min-width="100" show-overflow-tooltip /> <!--<el-table-column prop="point_code3" label="点位3" min-width="100" show-overflow-tooltip />
<el-table-column prop="point3_region_name" label="区域3" min-width="120" show-overflow-tooltip />--> <el-table-column prop="point3_region_name" label="区域3" min-width="120" show-overflow-tooltip />-->
<!--<el-table-column prop="point_code3" label="点位3" width="85" /> <!--<el-table-column prop="point_code3" label="点位3" width="85" />
<el-table-column prop="point_code4" label="点位4" width="85" />--> <el-table-column prop="point_code4" label="点位4" width="85" />-->
<el-table-column prop="remark" label="备注" width="120" show-overflow-tooltip /> <el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" show-overflow-tooltip />
<el-table-column prop="create_time" label="创建时间" width="135" /> <el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')" />
<el-table-column prop="update_time" label="修改时间" width="135" /> <el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" />
<el-table-column prop="update_optname" label="修改人" :min-width="flexWidth('update_optname',crud.data,'修改人')" />
<el-table-column prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')" />
<el-table-column <el-table-column
v-permission="['admin','instruction:edit','instruction:del']" v-permission="['admin','instruction:edit','instruction:del']"
fixed="right" fixed="right"

Loading…
Cancel
Save