编辑设备类型和出入库调度
This commit is contained in:
@@ -39,25 +39,29 @@ public class ScreenController extends BaseController {
|
||||
|
||||
// 静态初始化输送机编号数组
|
||||
static {
|
||||
// 1区域输送机编号
|
||||
// 区域输送机编号
|
||||
AREA_SSJ_CODES.put(1, Arrays.asList(
|
||||
"L2007", "L2008", "L2005", "L2006", "L2013"
|
||||
));
|
||||
|
||||
// 2区域输送机编号
|
||||
AREA_SSJ_CODES.put(2, Arrays.asList(
|
||||
"L2003", "L2004", "L2012", "L2001", "L2002"
|
||||
));
|
||||
|
||||
// 3区域输送机编号
|
||||
AREA_SSJ_CODES.put(3, Arrays.asList(
|
||||
"L1001", "L1002", "L1011"
|
||||
));
|
||||
|
||||
// 4区域输送机编号
|
||||
AREA_SSJ_CODES.put(4, Arrays.asList(
|
||||
"L1003", "L1004", "L1012"
|
||||
"L1001", "G1004"
|
||||
));
|
||||
// // 1区域输送机编号
|
||||
// AREA_SSJ_CODES.put(1, Arrays.asList(
|
||||
// "L2007", "L2008", "L2005", "L2006", "L2013"
|
||||
// ));
|
||||
//
|
||||
// // 2区域输送机编号
|
||||
// AREA_SSJ_CODES.put(2, Arrays.asList(
|
||||
// "L2003", "L2004", "L2012", "L2001", "L2002"
|
||||
// ));
|
||||
//
|
||||
// // 3区域输送机编号
|
||||
// AREA_SSJ_CODES.put(3, Arrays.asList(
|
||||
// "L1001", "L1002", "L1011"
|
||||
// ));
|
||||
//
|
||||
// // 4区域输送机编号
|
||||
// AREA_SSJ_CODES.put(4, Arrays.asList(
|
||||
// "L1003", "L1004", "L1012"
|
||||
// ));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,7 +21,7 @@ public class Wcs2WmsController {
|
||||
private IWcsPortService wcsPortService;
|
||||
|
||||
/**
|
||||
* 接收出库任务
|
||||
* 接收wms出库任务
|
||||
*
|
||||
* @param receiveOutJob
|
||||
* @return
|
||||
|
||||
@@ -8,7 +8,20 @@ import lombok.NoArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class JobParam {
|
||||
/**
|
||||
* 作业号
|
||||
*/
|
||||
private String jobId;
|
||||
|
||||
/**
|
||||
* 托盘号
|
||||
*/
|
||||
private String trayCode;
|
||||
|
||||
/**
|
||||
* 任务号
|
||||
*/
|
||||
private String taskNo;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,13 +8,48 @@ import lombok.NoArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ReceiveJob {
|
||||
/**
|
||||
* 任务号
|
||||
*/
|
||||
private String taskNo;
|
||||
|
||||
/**
|
||||
* 货位
|
||||
*/
|
||||
private String cargoSpaceId;
|
||||
|
||||
/**
|
||||
* 出口
|
||||
*/
|
||||
private String exitId;
|
||||
|
||||
/**
|
||||
* 托盘号
|
||||
*/
|
||||
private String trayCode;
|
||||
|
||||
/**
|
||||
* 入口
|
||||
*/
|
||||
private String entranceId;
|
||||
|
||||
/**
|
||||
* 任务类型
|
||||
*/
|
||||
private String inOrOut;
|
||||
|
||||
/**
|
||||
* 作业号
|
||||
*/
|
||||
private String jobId;
|
||||
|
||||
/**
|
||||
* 巷道号
|
||||
*/
|
||||
private String roadwayId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String departmentId;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.ruoyi.api.domain.wcs2wms.exception;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TaskExceptionRequest {
|
||||
|
||||
/**
|
||||
* 任务号
|
||||
*/
|
||||
private String taskNo;
|
||||
|
||||
/**
|
||||
* 异常类型
|
||||
*/
|
||||
private int exceptionType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ruoyi.api.domain.wcs2wms.stockin;
|
||||
|
||||
public class StockinReceive {
|
||||
|
||||
/**
|
||||
* wms下发任务号
|
||||
*/
|
||||
private String taskNo;
|
||||
|
||||
/**
|
||||
* WMS分配的目标库位编号
|
||||
*/
|
||||
private String cargoSpaceId;
|
||||
|
||||
/**
|
||||
* 巷道编号
|
||||
*/
|
||||
private String roadwayId;
|
||||
|
||||
/**
|
||||
* 作业单ID
|
||||
*/
|
||||
private String jobId;
|
||||
|
||||
/**
|
||||
* 入出库标识
|
||||
*/
|
||||
private String inOrOut;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.ruoyi.api.domain.wcs2wms.stockin;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 入库请求参数
|
||||
* (扫码失败、超重、超高时,WCS 仍调用此接口传递异常信息,WMS 记录异常但不返回任务号)
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class StockinRequest {
|
||||
|
||||
/**
|
||||
* 托盘号
|
||||
*/
|
||||
private String trayCode;
|
||||
|
||||
/**
|
||||
* 重量
|
||||
*/
|
||||
private int weight;
|
||||
|
||||
/**
|
||||
* 货物高度
|
||||
*/
|
||||
private int height;
|
||||
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
private String errorInfo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.ruoyi.api.domain.wcs2wms.taskFinish;
|
||||
|
||||
public class TaskFinishRequest {
|
||||
|
||||
/**
|
||||
* 任务号
|
||||
*/
|
||||
private String taskNo;
|
||||
|
||||
/**
|
||||
* 作业单ID
|
||||
*/
|
||||
private String jobId;
|
||||
|
||||
/**
|
||||
* 完成类型枚举值
|
||||
* 1-入库完成 2-出库完成
|
||||
*/
|
||||
private String type;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.ruoyi.api.domain.wcs2wms.taskFinish;
|
||||
|
||||
public class taskFinishReceive {
|
||||
}
|
||||
@@ -11,8 +11,10 @@ import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskRequest
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskResponse;
|
||||
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
||||
import com.ruoyi.api.domain.wcs2wms.exception.TaskExceptionRequest;
|
||||
import com.ruoyi.bas.port.domain.WcsPort;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.exception.job.TaskException;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||
import org.aspectj.weaver.loadtime.Aj;
|
||||
@@ -42,12 +44,12 @@ public interface IApiService
|
||||
*/
|
||||
public AgvQueue createAgvQueue(String code1,String code2,String wmsTrayCode,String taskCode,String wmsTaskType,String traySize,String wmsTaskNo);
|
||||
|
||||
/**
|
||||
* 取消AGV任务
|
||||
*
|
||||
* @param cancelTaskRequest
|
||||
* @return
|
||||
*/
|
||||
/**
|
||||
* 取消AGV任务
|
||||
*
|
||||
* @param cancelTaskRequest
|
||||
* @return
|
||||
*/
|
||||
public CancelTaskResponse cancelTask(CancelTaskRequest cancelTaskRequest);
|
||||
|
||||
/**
|
||||
@@ -115,6 +117,13 @@ public interface IApiService
|
||||
*/
|
||||
AjaxResult reAssign(JobParam jobParam);
|
||||
|
||||
/**
|
||||
* 放货有货 (参数类型TaskExceptionRequest)
|
||||
* @param taskExceptionRequest
|
||||
* @return
|
||||
*/
|
||||
AjaxResult reAssign(TaskExceptionRequest taskExceptionRequest);
|
||||
|
||||
/**
|
||||
* 取货无货,重新分配单据
|
||||
* @param jobParam
|
||||
@@ -122,6 +131,13 @@ public interface IApiService
|
||||
*/
|
||||
AjaxResult reMaterial(JobParam jobParam);
|
||||
|
||||
/**
|
||||
* 取货无货(参数类型TaskExceptionRequest)
|
||||
* @param taskExceptionRequest
|
||||
* @return
|
||||
*/
|
||||
AjaxResult reMaterial(TaskExceptionRequest taskExceptionRequest);
|
||||
|
||||
/**
|
||||
* 入库请求生成作业
|
||||
*/
|
||||
@@ -138,4 +154,9 @@ public interface IApiService
|
||||
AjaxResult deleteAgvTray(AgvQueue agvQueue);
|
||||
|
||||
AjaxResult requestWmsSpace(MydoJob mydoJob);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskRespons
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.PositionCodeData;
|
||||
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
||||
import com.ruoyi.api.domain.wcs2wms.exception.TaskExceptionRequest;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.bas.cargospace.service.IBasCargoSpaceService;
|
||||
import com.ruoyi.bas.port.domain.WcsPort;
|
||||
@@ -210,6 +211,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 取消ctu任务
|
||||
*
|
||||
@@ -236,6 +238,11 @@ public class ApiServiceImpl implements IApiService {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 异常重分(参数类型JobParam)
|
||||
* @param jobParam
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult reAssign(JobParam jobParam) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(RE_ASSIGN_URL, "重新分配货位", JSONUtil.toJsonStr(jobParam));
|
||||
@@ -250,6 +257,30 @@ public class ApiServiceImpl implements IApiService {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 异常重分(参数类型TaskExceptionRequest)
|
||||
* @param taskExceptionRequest
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult reAssign(TaskExceptionRequest taskExceptionRequest) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(WMS_TASK_EXCEPTION, "入库异常-重新分配货位", JSONUtil.toJsonStr(taskExceptionRequest));
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
InterfaceReceive bean = JSONUtil.toBean(requestLog.getResponseBody(), InterfaceReceive.class);
|
||||
MydoJob wmsMydoJob = BeanUtil.toBean(bean.getData(), MydoJob.class);
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByJobId(wmsMydoJob.getJobId());
|
||||
mydoJob.setCargoSpaceId(wmsMydoJob.getCargoSpaceId());
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库异常作废(参数类型jobParam)
|
||||
* @param jobParam
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult reMaterial(JobParam jobParam) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(RE_MATERIAL_URL, "重新分配物料", JSONUtil.toJsonStr(jobParam));
|
||||
@@ -259,6 +290,22 @@ public class ApiServiceImpl implements IApiService {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库异常作废(参数类型TaskExceptionRequest)
|
||||
* @param taskExceptionRequest
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult reMaterial(TaskExceptionRequest taskExceptionRequest) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(WMS_TASK_EXCEPTION, "出库无货异常-任务作废", JSONUtil.toJsonStr(taskExceptionRequest));
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 生成agv队列----临时修改起终点
|
||||
@@ -288,11 +335,11 @@ public class ApiServiceImpl implements IApiService {
|
||||
agvQueue.setTaskType("A22");
|
||||
agvQueue.setCtnrType("1");
|
||||
//rcslite开启托盘自动调整位置后 - 测试一巷道放货区分托盘类型
|
||||
// if (traySize == "2" || traySize == "3") {
|
||||
// agvQueue.setCtnrType("3");
|
||||
// }else{
|
||||
// agvQueue.setCtnrType("1");
|
||||
// }
|
||||
if (traySize == "2" || traySize == "3") {
|
||||
agvQueue.setCtnrType("3");
|
||||
}else{
|
||||
agvQueue.setCtnrType("1");
|
||||
}
|
||||
|
||||
agvQueue.setCtnrCode(traySize);
|
||||
agvQueue.setCtnrNum("0");
|
||||
@@ -308,6 +355,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
return agvQueue;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 取消AGV任务
|
||||
*
|
||||
@@ -321,6 +369,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 继续agv任务
|
||||
*
|
||||
@@ -365,9 +414,15 @@ public class ApiServiceImpl implements IApiService {
|
||||
return genAgvSchedulingTask(genAgvSchedulingTaskRequest);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 请求wms获取入库任务参数
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult createInMydoJob(Map<String, Object> param) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(CREATE_IN_MYDO_JOB_URL, "入库请求生成作业", JSONUtil.toJsonStr(param));
|
||||
RequestLog requestLog = requestLogService.getRequestLog(WMS_STOCKIN_MYDOJOB, "入库请求生成作业", JSONUtil.toJsonStr(param));
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
InterfaceReceive bean = JSONUtil.toBean(requestLog.getResponseBody(), InterfaceReceive.class);
|
||||
return AjaxResult.success(bean.getData());
|
||||
@@ -379,17 +434,23 @@ public class ApiServiceImpl implements IApiService {
|
||||
|
||||
@Override
|
||||
public AjaxResult receiveOutMydoJob(ReceiveJob receiveOutJob) {
|
||||
|
||||
//检查任务是否存在,避免重复生成
|
||||
MydoJob job = new MydoJob();
|
||||
job.setTaskNo(receiveOutJob.getTaskNo());
|
||||
List<MydoJob> tasks = mydoJobService.selectMydoJobList(job);
|
||||
|
||||
if (tasks.size() != 0) {
|
||||
log.info("【请求异常】wms下发出库任务失败,该任务已存在,任务号:{}", receiveOutJob.getTaskNo());
|
||||
return AjaxResult.error("【请求异常】wms下发出库任务失败,该任务已存在,任务号:" + receiveOutJob.getTaskNo());
|
||||
}
|
||||
|
||||
//生成出库作业
|
||||
MydoJob mydoJob = new MydoJob();
|
||||
mydoJob.setJobId(receiveOutJob.getJobId());
|
||||
mydoJob.setTaskNo(receiveOutJob.getTaskNo());
|
||||
mydoJob.setCargoSpaceId(receiveOutJob.getCargoSpaceId());
|
||||
|
||||
if("L2002".equals(receiveOutJob.getExitId()) || "L2008".equals(receiveOutJob.getExitId())
|
||||
|| "L2004".equals(receiveOutJob.getExitId()) || "L2006".equals(receiveOutJob.getExitId())) {
|
||||
mydoJob.setExitId("1");
|
||||
}else{
|
||||
mydoJob.setExitId(receiveOutJob.getExitId());
|
||||
}
|
||||
mydoJob.setExitId("G1004");
|
||||
mydoJob.setInOrOut(receiveOutJob.getInOrOut());
|
||||
mydoJob.setStatus("1");
|
||||
mydoJob.setPriority(Long.valueOf(10));
|
||||
@@ -397,10 +458,11 @@ public class ApiServiceImpl implements IApiService {
|
||||
mydoJob.setRoadwayId(receiveOutJob.getRoadwayId());
|
||||
mydoJob.setCreateTime(DateUtils.getNowDate());
|
||||
mydoJob.setExecutionPhase(TASK_EP_CREATE);
|
||||
mydoJob.setTraySize(receiveOutJob.getDepartmentId());
|
||||
// mydoJob.setTraySize(receiveOutJob.getDepartmentId());
|
||||
int i = mydoJobService.insertMydoJob(mydoJob);
|
||||
if (i > 0) {
|
||||
return AjaxResult.success();
|
||||
return AjaxResult.success(
|
||||
"【请求成功】wms下发出库作业,作业单号:" + receiveOutJob.getJobId() + ",任务号:" + receiveOutJob.getTaskNo() + ",出库货位:" + receiveOutJob.getCargoSpaceId());
|
||||
}else{
|
||||
return AjaxResult.error();
|
||||
}
|
||||
@@ -423,6 +485,12 @@ public class ApiServiceImpl implements IApiService {
|
||||
}
|
||||
}
|
||||
//todo 新增agv站点
|
||||
|
||||
/**
|
||||
* AGV站点映射
|
||||
* @param agvQueue
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult deleteAgvTray(AgvQueue agvQueue) {
|
||||
Map<String, String> paramMap = new HashMap<>();
|
||||
@@ -492,4 +560,5 @@ public class ApiServiceImpl implements IApiService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
* @return requestLog
|
||||
*/
|
||||
@Override
|
||||
public RequestLog getRequestLog(String url, String endPoint,String param) {
|
||||
public RequestLog getRequestLog(String url, String endPoint, String param) {
|
||||
RequestLog requestLog = new RequestLog();
|
||||
Date requestTime = new Date();
|
||||
requestLog.setRequestTime(DateUtil.format(requestTime, "yyyy-MM-dd HH:mm:ss"));
|
||||
|
||||
Reference in New Issue
Block a user