Browse Source

fix: 修复测试手持过程中存在的问题

master
yanps 2 months ago
parent
commit
452fd41d16
  1. 39
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java
  2. 1
      acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/plc_to_agv/PlcToAgvDeviceDriver.java
  3. 7
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/common/enums/region/RegionEnum.java
  4. 17
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/controller/FabController.java
  5. 8
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dao/mapper/FabRequestMapper.java
  6. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dto/SendMaterVo.java
  7. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/impl/FabServiceImpl.java
  8. 11
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/impl/HandheldServiceImpl.java
  9. 25
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java
  10. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/ConnectorUtil.java
  11. 12
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/connector/CNTTask.java
  12. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/connector/FTGTask.java
  13. 12
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSMTTask.java
  14. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSNTTask.java
  15. 1
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingTwoCNTTask.java
  16. 4
      lms/nladmin-ui/src/views/wms/sch/task/index.vue

39
acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java

@ -46,6 +46,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
/**
* NDC单工位AGV
@ -180,9 +181,9 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
PlcToAgvDeviceDriver plcToAgvDeviceDriver = (PlcToAgvDeviceDriver) device.getDeviceDriver();
Map<String, Object> extraValue = plcToAgvDeviceDriver.getExtraValue();
if (plcToAgvDeviceDriver.getAGVEnable() != 0) {
/*if (device_code.contains("_01")) {
if (device_code.contains("_01")) {
if (plcToAgvDeviceDriver.getAGVSetOutUpperAllowed() == 1) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
data = feedBackStatus(data, index, 1, inst, task, 2, false);
}
} else if (device_code.contains("_02")) {
Object plc_to_agv = extraValue.get("upper_lower_levels");
@ -193,8 +194,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
data = feedBackStatus(data, index, 1, inst, task, 2, false);
}
}
} else */
if (ObjectUtil.isNotEmpty(extraValue.get("upper_lower_levels"))) {
} else if (ObjectUtil.isNotEmpty(extraValue.get("upper_lower_levels"))) {
Object plc_to_agv = extraValue.get("upper_lower_levels");
if ("1".equals(plc_to_agv)) {
plcToAgvDeviceDriver.writing("AGVSetOutReqUpper", "1");
@ -257,7 +257,8 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
}
if (device.getDeviceDriver() instanceof PlcToAgvDeviceDriver) {
PlcToAgvDeviceDriver plcToAgvDeviceDriver = (PlcToAgvDeviceDriver) device.getDeviceDriver();
/*if (device_code.contains("_01")) {
if (device_code.contains("_01")) {
CompletableFuture.runAsync(() -> {
try {
List list = new ArrayList<>();
Map map = new HashMap();
@ -276,10 +277,12 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
} catch (Exception e) {
log.info("下发AGVInOP信号:{}失败", "0");
}
});
data = feedBackStatus(data, index, 2, inst, task, 2, false);
} else if (device_code.contains("_02")) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
} else {*/
data = feedBackStatus(data, index, 2, inst, task, 2, false);
} else {
CompletableFuture.runAsync(() -> {
try {
List list = new ArrayList<>();
Map map = new HashMap();
@ -298,8 +301,9 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
} catch (Exception e) {
log.info("下发AGVInOP信号:{}失败", "0");
}
});
data = feedBackStatus(data, index, 2, inst, task, 2, false);
/*}*/
}
} else if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
try {
data = feedBackStatus(data, index, 2, inst, task, 1, false);
@ -341,7 +345,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
PlcToAgvDeviceDriver plcToAgvDeviceDriver = (PlcToAgvDeviceDriver) device.getDeviceDriver();
if (plcToAgvDeviceDriver.getAGVEnable() != 0) {
Map<String, Object> extraValue = plcToAgvDeviceDriver.getExtraValue();
/*if (device_code.contains("_01")) {
if (device_code.contains("_01")) {
Object plc_to_agv = extraValue.get("upper_lower_levels");
if (ObjectUtil.isNotNull(plc_to_agv) && "1".equals(plc_to_agv)) {
plcToAgvDeviceDriver.writing("AGVSetInReqUpper", "1");
@ -352,10 +356,9 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
}
} else if (device_code.contains("_02")) {
if (plcToAgvDeviceDriver.getAGVSetInUpperAllowed() == 1) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
data = feedBackStatus(data, index, 3, inst, task, 2, false);
}
} else */
if (ObjectUtil.isNotEmpty(extraValue.get("upper_lower_levels"))) {
} else if (ObjectUtil.isNotEmpty(extraValue.get("upper_lower_levels"))) {
Object plc_to_agv = extraValue.get("upper_lower_levels");
if ("1".equals(plc_to_agv)) {
plcToAgvDeviceDriver.writing("AGVSetInReqUpper", "1");
@ -424,9 +427,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
transportOrder = "";
if (device.getDeviceDriver() instanceof PlcToAgvDeviceDriver) {
PlcToAgvDeviceDriver plcToAgvDeviceDriver = (PlcToAgvDeviceDriver) device.getDeviceDriver();
/*if (device_code.contains("_01")) {
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0, 0, 0, 0, 0);
if (device_code.contains("_01")) {
data = feedBackStatus(data, index, 4, inst, task, 2, false);
} else if (device_code.contains("_02")) {
CompletableFuture.runAsync(() -> {
try {
List list = new ArrayList<>();
Map map = new HashMap();
@ -445,8 +449,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
} catch (Exception e) {
log.info("下发AGVInOP信号:{}失败", "0");
}
});
data = feedBackStatus(data, index, 4, inst, task, 2, false);
} else {*/
} else {
CompletableFuture.runAsync(() -> {
try {
List list = new ArrayList<>();
Map map = new HashMap();
@ -465,8 +471,9 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
} catch (Exception e) {
log.info("下发AGVInOP信号:{}失败", "0");
}
});
data = feedBackStatus(data, index, 4, inst, task, 2, false);
/* }*/
}
} else if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
try {
StandardOrdinarySiteDeviceDriver standar = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();

1
acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/plc_to_agv/PlcToAgvDeviceDriver.java

@ -110,7 +110,6 @@ public class PlcToAgvDeviceDriver extends AbstractOpcDeviceDriver implements Dev
AGVSetOutReqUpper = this.itemProtocol.getAGVSetOutReqUpper();
AGVSetOutReqLower = this.itemProtocol.getAGVSetOutReqLower();
heartbeat = this.itemProtocol.getHeartbeat();
if (heartbeat == 1) {
writing("heartbeat", writing_heartbeat);
}

7
lms/nladmin-system/nlsso-server/src/main/java/org/nl/common/enums/region/RegionEnum.java

@ -9,10 +9,13 @@ public enum RegionEnum {
STAMPING_AND_BLANKING("Amada 80T冲床(手动加工)","111-06"),
TRUBEND_SHELVES_3_1_1("TruBend 7036货架03-01-01","111-07"),
TRUBEND_5170("TruBend 5170(手动加工)","111-08"),
TruBend_cell_7000("折弯","111-09"),
LAG_ROBOT_BEANDING_CELL("手动加工","111-10"),
ZDFJ("分拣工序","111-08"),
DDLK("堆叠笼框工序","111-20"),
NBJG("内部加工区","111-10"),
WXJG("外协加工区","111-12"),
NBJG("内部加工区","NBJGZCQ"),
WXJG("外协加工区","WXJGZCQ"),
ZDZWQ("自动折弯区","ZDZWQ"),
;
private final String region_name;

17
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/controller/FabController.java

@ -14,6 +14,7 @@ import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.base.TableDataInfo;
import org.nl.common.enums.VehicleTypeEnum;
import org.nl.common.enums.region.RegionEnum;
import org.nl.common.exception.BadRequestException;
import org.nl.common.logging.annotation.Log;
import org.nl.config.MapOf;
@ -53,7 +54,6 @@ public class FabController {
private WmsToConnectorService wmsToConnectorService;
/**
* 设备工序列表
*
@ -204,11 +204,11 @@ public class FabController {
@Log("工序下料")
@PostMapping("/sendMater")
public ResponseEntity<TableDataInfo> sendMater(@RequestBody SendMaterVo materInfo) {
if (StrUtil.isNotEmpty(materInfo.getRegion_code())) {
/*if (StrUtil.isNotEmpty(materInfo.getRegion_code())) {
JSONObject toJSON = (JSONObject) JSON.toJSON(materInfo);
fabService.createAgvTask(toJSON, "smt");
return new ResponseEntity(TableDataInfo.build(), HttpStatus.OK);
} else {
} else {*/
JSONObject toJSON = (JSONObject) JSON.toJSON(materInfo);
//TODO:待确定
List<SendVehicleVo> mater = materInfo.getMater();
@ -246,10 +246,17 @@ public class FabController {
});
toJSON.put("material_info", materiales);
toJSON.put("vehicle_code", schBasePoint.getVehicle_code());
if ("1".equals(materInfo.getPoint_code())) {
toJSON.put("region_code", StrUtil.isNotEmpty(mater.get(0).getRegion_code()) ? mater.get(0).getRegion_code() : schBasePoint.getRegion_code());
} else if ("2".equals(materInfo.getPoint_code())) {
toJSON.put("region_code", RegionEnum.NBJG.getRegion_code());
} else if ("3".equals(materInfo.getPoint_code())) {
toJSON.put("region_code", RegionEnum.WXJG.getRegion_code());
}
fabService.createAgvTask(toJSON, "smt");
return new ResponseEntity(TableDataInfo.build(), HttpStatus.OK);
}
/* }*/
}
//TODO: 根据物料查主盘信息; 当前工序查所有物料 ->
@ -283,7 +290,7 @@ public class FabController {
keys.add(item);
});
List<JSONObject> jsonObjectList = new ArrayList<>();
list.stream().forEach(item -> {
keys.stream().forEach(item -> {
JSONObject jsonObject = new JSONObject();
jsonObject.put("order_code", item);
jsonObjectList.add(jsonObject);

8
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dao/mapper/FabRequestMapper.java

@ -14,17 +14,17 @@ import java.util.Map;
public interface FabRequestMapper {
@DS("sqlserver")
List<Map> sqlServerConnectionDemo();
/*@DS("sqlserver")
List<Map> sqlServerConnectionDemo();*/
/**
* 根据工序查看FAb的订单列表
* @param regionCode
* @return
*/
@DS("sqlserver")
/*@DS("sqlserver")
List<FabConsumptionDo> getMWorkOrderInfos(@Param("regionCode") String regionCode);
@DS("sqlserver")
List<OrderMater> selectCraftByOrderCode(List<String> orders);
List<OrderMater> selectCraftByOrderCode(List<String> orders);*/
}

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/dto/SendMaterVo.java

@ -51,4 +51,6 @@ public class SendMaterVo {
List<SendVehicleVo> mater;
public String point_code;
}

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/impl/FabServiceImpl.java

@ -74,7 +74,7 @@ public class FabServiceImpl {
// for (SchBaseVehiclematerialgroup schBaseVehiclematerialgroup : list) {
//
// }
List<OrderMater> orderMaters = fabRequestMapper.selectCraftByOrderCode(orders);
// List<OrderMater> orderMaters = fabRequestMapper.selectCraftByOrderCode(orders);
}
}

11
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/handheld/service/impl/HandheldServiceImpl.java

@ -124,14 +124,14 @@ public class HandheldServiceImpl implements HandheldService {
if (vehicle.contains(",")) {
vehicle_list = vehicle.split(",");
}
if(CollUtil.isEmpty(Arrays.asList(vehicle_list))){
if (CollUtil.isEmpty(Arrays.asList(vehicle_list))) {
MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.selectByVehicleCode(vehicle);
if (ObjectUtil.isEmpty(mdBaseVehicle)) throw new BadRequestException("载具不存在!");
if (!mdBaseVehicle.getVehicle_type().equals(VehicleTypeEnum.RACKS_S04.getVehicleCode())
&& !mdBaseVehicle.getVehicle_type().equals(VehicleTypeEnum.RACKS_S06.getVehicleCode())){
&& !mdBaseVehicle.getVehicle_type().equals(VehicleTypeEnum.RACKS_S06.getVehicleCode())) {
throw new BadRequestException("托盘类型不匹配,,生成搬运任务失败!");
}
}else {
} else {
String[] finalVehicle_list = vehicle_list;
MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.selectByVehicleCode(vehicle_list[0]);
if (ObjectUtil.isEmpty(mdBaseVehicle)) throw new BadRequestException("载具不存在!");
@ -231,7 +231,7 @@ public class HandheldServiceImpl implements HandheldService {
jsonArray.add(map);
});
json.put("vehicle_code", vehicle_code);
json.put("region_code", region_code);
json.put("region_code", schBasePoint.getRegion_code());
json.put("materials", jsonArray);
JSONObject json1 = wmsToConnectorService.applyRegionAndDueDate(json);
if (ObjectUtil.isNotEmpty(json1) && json1.getInteger("status") == 200) {
@ -248,10 +248,10 @@ public class HandheldServiceImpl implements HandheldService {
});
});
region_code = JSONObject.parseObject(StrUtil.toString(date.get(0))).getString("region_code");
jo.put("region_code", region_code);
} else if (ObjectUtil.isNotEmpty(json1)) {
throw new BadRequestException(json1.getString("msg"));
}
jo.put("region_code", region_code);
} else {
jo.put("region_code", region_code);
}
@ -259,7 +259,6 @@ public class HandheldServiceImpl implements HandheldService {
jo.put("config_code", "BLANKINGTask");
jo.put("create_mode", GeneralDefinition.AUTO_CREATION);
jo.put("vehicle_code", vehicle_code);
jo.put("region_code", region_code);
jo.put("ext_data", param);
iSchBasePointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code, device_code)

25
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java

@ -390,6 +390,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
.eq(SchBasePoint::getIs_lock, false)
.eq(SchBasePoint::getIs_used, true)
.eq(SchBasePoint::getPoint_status, pointStatus)
.eq(SchBasePoint::getPoint_type, "1")
.eq(StrUtil.isNotBlank(vehicle_type),SchBasePoint::getCan_vehicle_type, vehicle_type)
.isNull(seq == 2, SchBasePoint::getVehicles)
.isNull(seq == 1, SchBasePoint::getVehicle_code)
@ -421,10 +422,18 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
.orderByDesc(SchBasePoint::getIn_order_seq));
if (CollUtil.isNotEmpty(schBasePoints) && schBasePoints.size() > 0) {
SchBasePoint schBasePoint = schBasePoints.get(0);
Gson gson = new Gson();
/*Gson gson = new Gson();
Type setType = new TypeToken<List<String>>() {
}.getType();
List<String> msg = gson.fromJson(schBasePoint.getVehicles(), setType);
}.getType();*/
List<String> msg = new ArrayList<>();
String vehicles = schBasePoint.getVehicles();
boolean contains = vehicles.contains(",");
if(contains){
String[] split = vehicles.split(",");
msg = Arrays.asList(split);
}else{
msg.add(vehicles);
}
Integer vehicle_qty = schBasePoint.getVehicle_qty();
if (vehicle_qty != msg.size()) throw new BadRequestException("载具数量与载具编码数量不一致!");
String s = msg.get(msg.size() - 1);
@ -438,7 +447,13 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
.set(SchBasePoint::getPoint_status, GoodsEnum.OUT_OF_STOCK.getValue())
.set(SchBasePoint::getVehicles, null));
}
SchBasePoint schBasePoint1 = selectByPointCode(schBasePoint.getPoint_code() + "_" + (vehicle_qty - 1));
SchBasePoint schBasePoint1 = null;
if(vehicle_qty == 1){
schBasePoint1 = selectByPointCode(schBasePoint.getPoint_code());
}else{
schBasePoint1 = selectByPointCode(schBasePoint.getPoint_code() + "_" + (vehicle_qty - 1));
}
if(ObjectUtil.isEmpty(schBasePoint1)) throw new BadRequestException("该货位不存在!");
schBasePoint1.setVehicle_code(s);
return schBasePoint1;
}
@ -508,7 +523,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
//查询满足条件的站点
List<SchBasePoint> schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getIs_lock, false).
isNotNull(SchBasePoint::getVehicle_code)
.eq(SchBasePoint::getRegion_code, region_code)
.eq(StrUtil.isNotEmpty(region_code),SchBasePoint::getRegion_code, region_code)
.eq(SchBasePoint::getPoint_status, GoodsEnum.EMPTY_PALLETS.getValue())
.in(SchBasePoint::getCan_vehicle_type, vehicleType)
.eq(SchBasePoint::getIs_used, true));

4
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/ConnectorUtil.java

@ -90,7 +90,7 @@ public class ConnectorUtil {
return AcsResponse.requestRefuse("未连接Connector!");
}
String url = connectorUrl + api;
log.info("向connector申请物料下道工序和交期时间:{},接口路径:{}", JSON.toJSONString(object),url);
log.info("反馈connector到达取货点的请求参数参数为:{},url:{}", JSON.toJSONString(object),url);
AcsResponse resultForAcs;
try {
String resultMsg = HttpRequest.post(url)
@ -182,7 +182,7 @@ public class ConnectorUtil {
.body(JSON.toJSONString(object))
.execute().body();
result = JSONObject.parseObject(resultMsg);
log.info("反馈connector到达取货点的响应参数为:{}", result);
log.info("向connector申请物料下道工序和交期时间的响应参数:{}", result);
} catch (Exception e) {
String msg = e.getMessage();
//网络不通

12
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/connector/CNTTask.java

@ -60,16 +60,16 @@ public class CNTTask extends AbstractTask {
Integer suffix2 = getNumericSuffix(s2.getPoint_code1());
return suffix1.compareTo(suffix2);
};
tasks.stream().sorted(numericSuffixComparator).collect(Collectors.toList());
for (SchBaseTask task : tasks) {
List<SchBaseTask> collect = tasks.stream().sorted(numericSuffixComparator).collect(Collectors.toList());
for (SchBaseTask task : collect) {
TaskUtils.setUpdateByAcs(task);
// 找起点
SchBasePoint schBasePoint = null;
if (TaskType.CARRY_TASK.getValue().equals(task.getTask_type())) {
schBasePoint = schBasePointService.selectByRegionCode(RegionEnum.TRUBEND_SHELVES_3_1_1.getRegion_code(), task.getVehicle_code(),"1");
} else if (TaskType.REASSIGN_TASK.getValue().equals(task.getTask_type())) {
schBasePoint = schBasePointService.selectByReassign(RegionEnum.TRUBEND_SHELVES_3_1_1.getRegion_code(), task.getVehicle_code());
}
schBasePoint = schBasePointService.selectByRegionCode(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(), task.getVehicle_code(),"1");
}/* else if (TaskType.REASSIGN_TASK.getValue().equals(task.getTask_type())) {
schBasePoint = schBasePointService.selectByReassign(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(), task.getVehicle_code());
}*/
if (ObjectUtil.isEmpty(schBasePoint)) {
task.setRemark("未找到所需点位!");
taskService.updateById(task);

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/connector/FTGTask.java

@ -58,7 +58,7 @@ public class FTGTask extends AbstractTask {
String requestParam = task.getRequest_param();
JSONObject jsonObject = JSONObject.parseObject(requestParam);
// 查找空载具点位
SchBasePoint schBasePoint = schBasePointService.selectEmpVehicleByRegionCode(RegionEnum.TRUBEND_SHELVES_3_1_1.getRegion_code(),task.getVehicle_type());
SchBasePoint schBasePoint = schBasePointService.selectEmpVehicleByRegionCode(null,task.getVehicle_type());
if (ObjectUtil.isEmpty(schBasePoint)) {
task.setRemark("未找到所需点位!");
taskService.updateById(task);

12
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSMTTask.java

@ -2,6 +2,7 @@ package org.nl.wms.sch.task_manage.task.tasks.sorting;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -68,8 +69,12 @@ public class SortingSMTTask extends AbstractTask {
// 找起点
String requestParam = task.getRequest_param();
JSONObject jsonObject = JSONObject.parseObject(requestParam);
JSONArray pallet_detail = jsonObject.getJSONArray("pallet_detail");
JSONObject jsonObject1 = JSONObject.parseObject(StrUtil.toString(pallet_detail.get(0)));
String regionCode = StrUtil.isEmpty(jsonObject1.getString("NextOperation")) ?
RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code() : jsonObject1.getString("NextOperation");
// 根据对接位查找对应的载具类型
SchBasePoint schBasePoint = schBasePointService.selectByRegionCode(RegionEnum.ZDFJ.getRegion_code(),task.getVehicle_code(),"1");
SchBasePoint schBasePoint = schBasePointService.selectByRegionCode(regionCode, task.getVehicle_code(), "1");
if (ObjectUtil.isEmpty(schBasePoint)) {
task.setRemark("未找到所需点位!");
taskService.updateById(task);
@ -81,9 +86,8 @@ public class SortingSMTTask extends AbstractTask {
jsonObject.put("vehicle_type", schBasePoint.getCan_vehicle_type());
schBaseVehiclematerialgroupService.remove(Wrappers.lambdaQuery(SchBaseVehiclematerialgroup.class)
.eq(SchBaseVehiclematerialgroup::getVehicle_code, task.getVehicle_code()));
JSONArray pallet_detail = jsonObject.getJSONArray("pallet_detail");
for (Object o : pallet_detail) {
JSONObject jO = (JSONObject)JSONObject.toJSON(o);
JSONObject jO = (JSONObject) JSONObject.toJSON(o);
String workorder = jO.getString("ProductionOrder");
String ProductID = jO.getString("ProductID");
Integer qty = jO.getInteger("Currentqty");
@ -114,7 +118,7 @@ public class SortingSMTTask extends AbstractTask {
}
}
private Long getTime(String dateString){
private Long getTime(String dateString) {
String pattern = "yyyy-MM-dd HH:mm:ss";
java.util.Date date = DateUtil.parse(dateString, pattern);
long timestamp = date.getTime();

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSNTTask.java

@ -69,7 +69,7 @@ public class SortingSNTTask extends AbstractTask {
String requestParam = task.getRequest_param();
JSONObject jsonObject = JSONObject.parseObject(requestParam);
// 根据对接位查找对应的载具类型
SchBasePoint schBasePoint = schBasePointService.selectByRegionCode(RegionEnum.ZDFJ.getRegion_code(),task.getVehicle_code(),"0");
SchBasePoint schBasePoint = schBasePointService.selectByRegionCode(RegionEnum.LAG_ROBOT_BEANDING_CELL.getRegion_code(),task.getVehicle_code(),"0");
if(ObjectUtil.isEmpty(schBasePoint)) continue;
jsonObject.put("vehicle_type", schBasePoint.getCan_vehicle_type());
if (ObjectUtil.isEmpty(schBasePoint)) {

1
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingTwoCNTTask.java

@ -73,6 +73,7 @@ public class SortingTwoCNTTask extends AbstractTask {
task.setTask_status(TaskStatus.CREATED.getCode());
task.setPoint_code1(basePoint.getPoint_code());
task.setVehicle_code(basePoint.getVehicle_code());
task.setRemark(" ");
taskService.update(task);
schBasePointService.update(Wrappers.lambdaUpdate(SchBasePoint.class)
.eq(SchBasePoint::getPoint_code,basePoint.getPoint_code())

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

@ -227,12 +227,12 @@
:disabled="scope.row.task_status==='5' || scope.row.task_status==='6'"
@click="doOperate(scope.row, 'a')"
>完成</el-button>
<el-button
<!-- <el-button
type="text"
icon="el-icon-error"
:disabled="scope.row.task_status==='5' || scope.row.task_status==='6'"
@click="doOperate(scope.row, 's')"
>任务调度</el-button>
>任务调度</el-button> -->
</template>
</el-table-column>
</el-table>

Loading…
Cancel
Save