堆垛机调度初始化
This commit is contained in:
@@ -2,13 +2,9 @@ package com.ruoyi.api.controller;
|
||||
|
||||
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackRequest;
|
||||
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackResponse;
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskRequest;
|
||||
import com.ruoyi.api.domain.wcs2wms.MydoJob;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.device.agv.domain.AgvQueue;
|
||||
import com.ruoyi.device.agv.service.IAgvQueueService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -39,17 +35,6 @@ public class AgvController extends BaseController {
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* agv搬运作业
|
||||
* @param genAgvSchedulingTaskRequest
|
||||
* @return
|
||||
@PostMapping("/receiveAgvMoveJob")
|
||||
public AjaxResult receiveAgvMoveJob(@RequestBody GenAgvSchedulingTaskRequest genAgvSchedulingTaskRequest) {
|
||||
return apiService.receiveAgvMoveJob(genAgvSchedulingTaskRequest);
|
||||
}*/
|
||||
|
||||
|
||||
/**
|
||||
* agv搬运作业
|
||||
* @param param{
|
||||
|
||||
@@ -10,10 +10,10 @@ import com.ruoyi.api.domain.agv.continueTask.ContinueTaskResponse;
|
||||
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.MydoJob;
|
||||
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.device.agv.domain.AgvQueue;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -146,4 +146,18 @@ public interface IApiService
|
||||
* @return
|
||||
*/
|
||||
AjaxResult cancelMydoJob(JobParam jobParam);
|
||||
|
||||
/**
|
||||
* 放货有货,重新分配货位
|
||||
* @param jobParam
|
||||
* @return
|
||||
*/
|
||||
AjaxResult reAssignMydoJob(JobParam jobParam);
|
||||
|
||||
/**
|
||||
* 取货无货,重新分配单据
|
||||
* @param jobParam
|
||||
* @return
|
||||
*/
|
||||
AjaxResult reAssignMydoJob2(JobParam jobParam);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskRequest
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskResponse;
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.PositionCodeData;
|
||||
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||
import com.ruoyi.api.domain.wcs2wms.MydoJob;
|
||||
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.bas.fluent.domain.BasFluentFrame;
|
||||
@@ -26,14 +25,14 @@ import com.ruoyi.bas.fluent.service.IBasFluentFrameService;
|
||||
import com.ruoyi.bas.port.domain.WcsPort;
|
||||
import com.ruoyi.bas.port.service.IWcsPortService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.device.agv.domain.AgvQueue;
|
||||
import com.ruoyi.device.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcRead;
|
||||
import com.ruoyi.schedule.plcRead.ssj.domain.SendData;
|
||||
import com.ruoyi.schedule.plcRead.util.Tools;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -230,150 +229,12 @@ public class ApiServiceImpl implements IApiService {
|
||||
* @param request
|
||||
*/
|
||||
private void agvCallbackInfo(AgvCallbackRequest request) {
|
||||
String taskCode = request.getTaskCode();
|
||||
|
||||
AgvQueue agvQueue = agvQueueService.selectAgvQueueByTaskCode(taskCode);
|
||||
//通知wms agv搬运阶段完成
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
if (ObjUtil.isNotNull(agvQueue)) {
|
||||
switch (request.getMethod()) {
|
||||
case "start":
|
||||
//任务开始
|
||||
agvQueue.setStatus("2");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
log.info("【AGV任务开始】任务号:{}", taskCode);
|
||||
//通知wms
|
||||
param.put("taskNo", agvQueue.getWmsTaskNo());
|
||||
param.put("wmsType", agvQueue.getWmsTaskType());
|
||||
sendOutMydoJobStatus(param);
|
||||
break;
|
||||
case "outbin":
|
||||
//走出储位
|
||||
agvQueue.setStatus("3");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
log.info("【AGV走出储位】任务号:{}", taskCode);
|
||||
break;
|
||||
case "end":
|
||||
//任务结束
|
||||
agvQueue.setStatus("4");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
|
||||
|
||||
param.put("wmsType", agvQueue.getWmsTaskType());
|
||||
|
||||
if ("1".equals(agvQueue.getWmsTaskType())) {
|
||||
param.put("taskNo", agvQueue.getWmsTaskNo());
|
||||
param.put("trayCode", agvQueue.getWmsTraycode());
|
||||
//入库任务 暂无特殊逻辑
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JOB_FINISH_URL, "agv任务完成", JSONUtil.toJsonStr(param));
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
agvQueue.setFinishTime(DateUtil.formatDateTime(new Date()));
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
//插入历史
|
||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||
//删除队列
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||
log.info("【AGV入库任务结束】任务号:{}", taskCode);
|
||||
|
||||
}
|
||||
} else if ("2".equals(agvQueue.getWmsTaskType())) {
|
||||
if (agvQueue.getPositionCode2().startsWith("fluent")){
|
||||
//流利架出库 同步电子标签
|
||||
Map<String, Object> fluentPickParam = new HashMap<>();
|
||||
fluentPickParam.put("taskNo", agvQueue.getWmsTaskNo());
|
||||
fluentPickParam.put("wmsType", "2");
|
||||
fluentPickParam.put("pickSsj", agvQueue.getPositionCode2());
|
||||
RequestLog requestLog = finishMydoJob(JOB_FINISH_URL, "流利架任务到达拣选口", fluentPickParam);
|
||||
agvQueue.setFinishTime(DateUtil.formatDateTime(new Date()));
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
//插入历史
|
||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||
//删除队列
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||
log.info("【AGV出库任务结束】任务号:{}", taskCode);
|
||||
}else {
|
||||
//输送机出库 PLC写入任务号
|
||||
//通知wms 任务结束
|
||||
param.put("taskNo", agvQueue.getWmsTaskNo());
|
||||
param.put("trayCode", agvQueue.getWmsTraycode());
|
||||
//写入对应的plc 任务号
|
||||
DeviceSsj deviceSsj = PlcRead.deviceMap.get(agvQueue.getPositionCode2());
|
||||
if (ObjUtil.isNotNull(deviceSsj)) {
|
||||
SendData rwh = new SendData(Tools.DINT, agvQueue.getWmsTaskNo());
|
||||
byte[] bytes = Tools.sendData(rwh);
|
||||
//写入信息 取货完成
|
||||
int i = PlcRead.WriteToSSJ(deviceSsj.getPlcDbWriteAddress(), bytes);
|
||||
if (i == 1) {
|
||||
agvQueue.setFinishTime(DateUtil.formatDateTime(new Date()));
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
//插入历史
|
||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||
//删除队列
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||
log.info("【AGV出库任务结束】任务号:{}", taskCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ("3".equals(agvQueue.getWmsTaskType())) {
|
||||
param.put("positionCode1", agvQueue.getPositionCode1());
|
||||
param.put("positionCode2", agvQueue.getPositionCode2());
|
||||
param.put("containerCode", agvQueue.getWmsTraycode());
|
||||
|
||||
//绑定点位和料架
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JOB_FINISH_URL, "agv任务完成", JSONUtil.toJsonStr(param));
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
//插入历史
|
||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||
//删除队列
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||
//修改点位状态
|
||||
WcsPort wcsPort = wcsPortService.selectWcsPortByPortCode(agvQueue.getPositionCode2());
|
||||
wcsPort.setStatus("1");
|
||||
wcsPortService.updateWcsPort(wcsPort);
|
||||
log.info("【AGV任务结束】任务号:{}", taskCode);
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "cancel":
|
||||
//任务单取消
|
||||
agvQueue.setStatus("5");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
//插入历史
|
||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||
//删除队列
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||
log.info("【AGV任务单取消】任务号:{}", taskCode);
|
||||
break;
|
||||
case "apply":
|
||||
//CTU料箱取放申请
|
||||
//请求放货
|
||||
if ("0".equals(agvQueue.getRequest())) {
|
||||
agvQueue.setRequest("1");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
}
|
||||
log.info("【AGV料箱取放申请】任务号:{}", taskCode);
|
||||
break;
|
||||
case "takeCompleted":
|
||||
//ctu取货完成
|
||||
HashMap<String, Object> takeCompletedParam = new HashMap<>();
|
||||
takeCompletedParam.put("portCode",agvQueue.getPositionCode1());
|
||||
takeCompletedParam.put("wmsType",agvQueue.getWmsTaskType());
|
||||
takeCompleted(takeCompletedParam);
|
||||
if ("3".equals(agvQueue.getWmsTaskType())){
|
||||
//修改点位状态
|
||||
WcsPort wcsPort = wcsPortService.selectWcsPortByPortCode(agvQueue.getPositionCode1());
|
||||
wcsPort.setStatus("0");
|
||||
wcsPortService.updateWcsPort(wcsPort);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
log.info("未知方法");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 推送AGV任务
|
||||
* @param receiveOutJob
|
||||
@@ -451,6 +312,16 @@ public class ApiServiceImpl implements IApiService {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult reAssignMydoJob(JobParam jobParam) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult reAssignMydoJob2(JobParam jobParam) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成agv队列
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.device.ddj.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.device.ddj.domain.MsgDdj;
|
||||
import com.ruoyi.device.ddj.service.IMsgDdjService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 堆垛机状态表Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/device/ddj")
|
||||
public class MsgDdjController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMsgDdjService msgDdjService;
|
||||
|
||||
/**
|
||||
* 查询堆垛机状态表列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:ddj:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MsgDdj msgDdj)
|
||||
{
|
||||
startPage();
|
||||
List<MsgDdj> list = msgDdjService.selectMsgDdjList(msgDdj);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出堆垛机状态表列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:ddj:export')")
|
||||
@Log(title = "堆垛机状态表", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MsgDdj msgDdj)
|
||||
{
|
||||
List<MsgDdj> list = msgDdjService.selectMsgDdjList(msgDdj);
|
||||
ExcelUtil<MsgDdj> util = new ExcelUtil<MsgDdj>(MsgDdj.class);
|
||||
util.exportExcel(response, list, "堆垛机状态表数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取堆垛机状态表详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:ddj:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(msgDdjService.selectMsgDdjById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增堆垛机状态表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:ddj:add')")
|
||||
@Log(title = "堆垛机状态表", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MsgDdj msgDdj)
|
||||
{
|
||||
return toAjax(msgDdjService.insertMsgDdj(msgDdj));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改堆垛机状态表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:ddj:edit')")
|
||||
@Log(title = "堆垛机状态表", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MsgDdj msgDdj)
|
||||
{
|
||||
return toAjax(msgDdjService.updateMsgDdj(msgDdj));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除堆垛机状态表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('device:ddj:remove')")
|
||||
@Log(title = "堆垛机状态表", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(msgDdjService.deleteMsgDdjByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.ruoyi.device.ddj.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 堆垛机状态表对象 msg_ddj
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
public class MsgDdj extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private Long id;
|
||||
|
||||
/** 堆垛机名称 */
|
||||
@Excel(name = "堆垛机名称")
|
||||
private String name;
|
||||
|
||||
/** 任务号 */
|
||||
@Excel(name = "任务号")
|
||||
private Long rwh;
|
||||
|
||||
/** 阶段标志 */
|
||||
@Excel(name = "阶段标志")
|
||||
private Long jdbz;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
private Long sbzt;
|
||||
|
||||
/** 操作方式 */
|
||||
@Excel(name = "操作方式")
|
||||
private Long czfs;
|
||||
|
||||
/** 允许下发 */
|
||||
@Excel(name = "允许下发")
|
||||
private Long yxxf;
|
||||
|
||||
/** 原排 */
|
||||
@Excel(name = "原排")
|
||||
private Long yp;
|
||||
|
||||
/** 原列 */
|
||||
@Excel(name = "原列")
|
||||
private Long yl;
|
||||
|
||||
/** 原层 */
|
||||
@Excel(name = "原层")
|
||||
private Long yc;
|
||||
|
||||
/** 目标排 */
|
||||
@Excel(name = "目标排")
|
||||
private Long mbp;
|
||||
|
||||
/** 目标列 */
|
||||
@Excel(name = "目标列")
|
||||
private Long mbl;
|
||||
|
||||
/** 目标层 */
|
||||
@Excel(name = "目标层")
|
||||
private Long mbc;
|
||||
|
||||
/** 心跳信号 */
|
||||
@Excel(name = "心跳信号")
|
||||
private Long xtxh;
|
||||
|
||||
/** 当前巷道 */
|
||||
@Excel(name = "当前巷道")
|
||||
private Long dqxd;
|
||||
|
||||
/** 货叉状态 */
|
||||
@Excel(name = "货叉状态")
|
||||
private Long hczt;
|
||||
|
||||
/** 备用字段1 */
|
||||
@Excel(name = "备用字段1")
|
||||
private Long spare1;
|
||||
|
||||
/** 备用字段2 */
|
||||
@Excel(name = "备用字段2")
|
||||
private Long spare2;
|
||||
|
||||
/** 备用字段3 */
|
||||
@Excel(name = "备用字段3")
|
||||
private Long spare3;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.device.ddj.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.device.ddj.domain.MsgDdj;
|
||||
|
||||
/**
|
||||
* 堆垛机状态表Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
public interface MsgDdjMapper
|
||||
{
|
||||
/**
|
||||
* 查询堆垛机状态表
|
||||
*
|
||||
* @param id 堆垛机状态表主键
|
||||
* @return 堆垛机状态表
|
||||
*/
|
||||
public MsgDdj selectMsgDdjById(Long id);
|
||||
|
||||
/**
|
||||
* 查询堆垛机状态表列表
|
||||
*
|
||||
* @param msgDdj 堆垛机状态表
|
||||
* @return 堆垛机状态表集合
|
||||
*/
|
||||
public List<MsgDdj> selectMsgDdjList(MsgDdj msgDdj);
|
||||
|
||||
/**
|
||||
* 新增堆垛机状态表
|
||||
*
|
||||
* @param msgDdj 堆垛机状态表
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMsgDdj(MsgDdj msgDdj);
|
||||
|
||||
/**
|
||||
* 修改堆垛机状态表
|
||||
*
|
||||
* @param msgDdj 堆垛机状态表
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMsgDdj(MsgDdj msgDdj);
|
||||
|
||||
/**
|
||||
* 删除堆垛机状态表
|
||||
*
|
||||
* @param id 堆垛机状态表主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMsgDdjById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除堆垛机状态表
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMsgDdjByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.device.ddj.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.device.ddj.domain.MsgDdj;
|
||||
|
||||
/**
|
||||
* 堆垛机状态表Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
public interface IMsgDdjService
|
||||
{
|
||||
/**
|
||||
* 查询堆垛机状态表
|
||||
*
|
||||
* @param id 堆垛机状态表主键
|
||||
* @return 堆垛机状态表
|
||||
*/
|
||||
public MsgDdj selectMsgDdjById(Long id);
|
||||
|
||||
/**
|
||||
* 查询堆垛机状态表列表
|
||||
*
|
||||
* @param msgDdj 堆垛机状态表
|
||||
* @return 堆垛机状态表集合
|
||||
*/
|
||||
public List<MsgDdj> selectMsgDdjList(MsgDdj msgDdj);
|
||||
|
||||
/**
|
||||
* 新增堆垛机状态表
|
||||
*
|
||||
* @param msgDdj 堆垛机状态表
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMsgDdj(MsgDdj msgDdj);
|
||||
|
||||
/**
|
||||
* 修改堆垛机状态表
|
||||
*
|
||||
* @param msgDdj 堆垛机状态表
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMsgDdj(MsgDdj msgDdj);
|
||||
|
||||
/**
|
||||
* 批量删除堆垛机状态表
|
||||
*
|
||||
* @param ids 需要删除的堆垛机状态表主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMsgDdjByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除堆垛机状态表信息
|
||||
*
|
||||
* @param id 堆垛机状态表主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMsgDdjById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.ruoyi.device.ddj.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.device.ddj.mapper.MsgDdjMapper;
|
||||
import com.ruoyi.device.ddj.domain.MsgDdj;
|
||||
import com.ruoyi.device.ddj.service.IMsgDdjService;
|
||||
|
||||
/**
|
||||
* 堆垛机状态表Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
@Service
|
||||
public class MsgDdjServiceImpl implements IMsgDdjService
|
||||
{
|
||||
@Autowired
|
||||
private MsgDdjMapper msgDdjMapper;
|
||||
|
||||
/**
|
||||
* 查询堆垛机状态表
|
||||
*
|
||||
* @param id 堆垛机状态表主键
|
||||
* @return 堆垛机状态表
|
||||
*/
|
||||
@Override
|
||||
public MsgDdj selectMsgDdjById(Long id)
|
||||
{
|
||||
return msgDdjMapper.selectMsgDdjById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询堆垛机状态表列表
|
||||
*
|
||||
* @param msgDdj 堆垛机状态表
|
||||
* @return 堆垛机状态表
|
||||
*/
|
||||
@Override
|
||||
public List<MsgDdj> selectMsgDdjList(MsgDdj msgDdj)
|
||||
{
|
||||
return msgDdjMapper.selectMsgDdjList(msgDdj);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增堆垛机状态表
|
||||
*
|
||||
* @param msgDdj 堆垛机状态表
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMsgDdj(MsgDdj msgDdj)
|
||||
{
|
||||
return msgDdjMapper.insertMsgDdj(msgDdj);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改堆垛机状态表
|
||||
*
|
||||
* @param msgDdj 堆垛机状态表
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMsgDdj(MsgDdj msgDdj)
|
||||
{
|
||||
return msgDdjMapper.updateMsgDdj(msgDdj);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除堆垛机状态表
|
||||
*
|
||||
* @param ids 需要删除的堆垛机状态表主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMsgDdjByIds(Long[] ids)
|
||||
{
|
||||
return msgDdjMapper.deleteMsgDdjByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除堆垛机状态表信息
|
||||
*
|
||||
* @param id 堆垛机状态表主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMsgDdjById(Long id)
|
||||
{
|
||||
return msgDdjMapper.deleteMsgDdjById(id);
|
||||
}
|
||||
}
|
||||
@@ -72,5 +72,8 @@ public class DeviceSsj extends BaseEntity
|
||||
@Excel(name = "任务号")
|
||||
private int taskNo;
|
||||
|
||||
@Excel(name = "异常")
|
||||
private int exception;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,22 +8,20 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.device.DeviceCar.service.IDeviceCarService;
|
||||
import com.ruoyi.device.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.device.agv.service.IAgvQueueFinishService;
|
||||
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.queue.agv.service.IAgvQueueFinishService;
|
||||
import com.ruoyi.device.ssj.service.IDeviceSsjService;
|
||||
import com.ruoyi.device.DeviceCar.domain.DeviceCar;
|
||||
import com.ruoyi.device.agv.domain.AgvQueue;
|
||||
import com.ruoyi.device.agv.domain.AgvQueueFinish;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueueFinish;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
|
||||
/**
|
||||
* 首页数据Controller
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-01-08
|
||||
*/
|
||||
@@ -33,13 +31,13 @@ public class IndexController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDeviceCarService deviceCarService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IAgvQueueService agvQueueService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IAgvQueueFinishService agvQueueFinishService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IDeviceSsjService deviceSsjService;
|
||||
|
||||
@@ -52,12 +50,12 @@ public class IndexController extends BaseController
|
||||
try {
|
||||
DeviceCar deviceCar = new DeviceCar();
|
||||
List<DeviceCar> deviceList = deviceCarService.selectDeviceCarList(deviceCar);
|
||||
|
||||
|
||||
Map<String, Object> stats = new HashMap<>();
|
||||
int agvCount = 0;
|
||||
int ctuCount = 0;
|
||||
int ssjCount = 0;
|
||||
|
||||
|
||||
for (DeviceCar device : deviceList) {
|
||||
String type = device.getType();
|
||||
if ("1".equals(type)) {
|
||||
@@ -68,12 +66,12 @@ public class IndexController extends BaseController
|
||||
ssjCount++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
stats.put("agvCount", agvCount);
|
||||
stats.put("ctuCount", ctuCount);
|
||||
stats.put("ssjCount", ssjCount);
|
||||
stats.put("totalCount", deviceList.size());
|
||||
|
||||
|
||||
return AjaxResult.success(stats);
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("获取设备统计数据失败");
|
||||
@@ -89,10 +87,10 @@ public class IndexController extends BaseController
|
||||
try {
|
||||
AgvQueue agvQueue = new AgvQueue();
|
||||
List<AgvQueue> queueList = agvQueueService.selectAgvQueueList(agvQueue);
|
||||
|
||||
|
||||
int pendingCount = 0;
|
||||
int runningCount = 0;
|
||||
|
||||
|
||||
for (AgvQueue queue : queueList) {
|
||||
String status = queue.getStatus();
|
||||
if ("0".equals(status)||"1".equals(status)) {
|
||||
@@ -101,18 +99,18 @@ public class IndexController extends BaseController
|
||||
runningCount++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 获取今日完成任务数
|
||||
AgvQueueFinish finishQuery = new AgvQueueFinish();
|
||||
List<AgvQueueFinish> finishList = agvQueueFinishService.selectAgvQueueFinishList(finishQuery);
|
||||
int finishedCount = finishList.size();
|
||||
|
||||
|
||||
Map<String, Object> stats = new HashMap<>();
|
||||
stats.put("pendingCount", pendingCount);
|
||||
stats.put("runningCount", runningCount);
|
||||
stats.put("finishedCount", finishedCount);
|
||||
stats.put("totalCount", pendingCount + runningCount + finishedCount);
|
||||
|
||||
|
||||
return AjaxResult.success(stats);
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("获取任务统计数据失败");
|
||||
@@ -128,7 +126,7 @@ public class IndexController extends BaseController
|
||||
try {
|
||||
AgvQueue agvQueue = new AgvQueue();
|
||||
List<AgvQueue> taskList = agvQueueService.selectAgvQueueList(agvQueue);
|
||||
|
||||
|
||||
return AjaxResult.success(taskList);
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("获取当前任务队列失败");
|
||||
@@ -143,11 +141,11 @@ public class IndexController extends BaseController
|
||||
{
|
||||
try {
|
||||
List<Map<String, Object>> runningDevices = new ArrayList<>();
|
||||
|
||||
|
||||
// 查询运行中的AGV和CTU设备
|
||||
DeviceCar deviceCar = new DeviceCar();
|
||||
List<DeviceCar> deviceList = deviceCarService.selectDeviceCarList(deviceCar);
|
||||
|
||||
|
||||
for (DeviceCar device : deviceList) {
|
||||
String taskNo = device.getTaskNo();
|
||||
// 判断是否为运行中设备:taskNo不为空且不为0
|
||||
@@ -160,11 +158,11 @@ public class IndexController extends BaseController
|
||||
runningDevices.add(deviceInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 查询运行中的SSJ设备
|
||||
DeviceSsj deviceSsj = new DeviceSsj();
|
||||
List<DeviceSsj> ssjList = deviceSsjService.selectDeviceSsjList(deviceSsj);
|
||||
|
||||
|
||||
for (DeviceSsj ssj : ssjList) {
|
||||
int taskNo = ssj.getTaskNo();
|
||||
// 判断是否为运行中设备:taskNo不为0
|
||||
@@ -177,7 +175,7 @@ public class IndexController extends BaseController
|
||||
runningDevices.add(deviceInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return AjaxResult.success(runningDevices);
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("获取运行中设备列表失败");
|
||||
@@ -193,12 +191,12 @@ public class IndexController extends BaseController
|
||||
try {
|
||||
AgvQueue agvQueue = new AgvQueue();
|
||||
List<AgvQueue> queueList = agvQueueService.selectAgvQueueList(agvQueue);
|
||||
|
||||
|
||||
AgvQueueFinish finishQuery = new AgvQueueFinish();
|
||||
List<AgvQueueFinish> finishList = agvQueueFinishService.selectAgvQueueFinishList(finishQuery);
|
||||
|
||||
|
||||
Map<String, Integer> taskTypeCount = new HashMap<>();
|
||||
|
||||
|
||||
// 统计队列中的任务类型
|
||||
for (AgvQueue queue : queueList) {
|
||||
String wmsTaskType = queue.getWmsTaskType();
|
||||
@@ -206,7 +204,7 @@ public class IndexController extends BaseController
|
||||
taskTypeCount.put(wmsTaskType, taskTypeCount.getOrDefault(wmsTaskType, 0) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 统计完成任务的类型
|
||||
for (AgvQueueFinish finish : finishList) {
|
||||
String wmsTaskType = finish.getWmsTaskType();
|
||||
@@ -214,7 +212,7 @@ public class IndexController extends BaseController
|
||||
taskTypeCount.put(wmsTaskType, taskTypeCount.getOrDefault(wmsTaskType, 0) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
List<Map<String, Object>> chartData = new ArrayList<>();
|
||||
for (Map.Entry<String, Integer> entry : taskTypeCount.entrySet()) {
|
||||
Map<String, Object> item = new HashMap<>();
|
||||
@@ -222,7 +220,7 @@ public class IndexController extends BaseController
|
||||
item.put("value", entry.getValue());
|
||||
chartData.add(item);
|
||||
}
|
||||
|
||||
|
||||
return AjaxResult.success(chartData);
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("获取任务类型分布数据失败");
|
||||
@@ -240,51 +238,51 @@ public class IndexController extends BaseController
|
||||
statusCount.put("AGV", new HashMap<>());
|
||||
statusCount.put("CTU", new HashMap<>());
|
||||
statusCount.put("SSJ", new HashMap<>());
|
||||
|
||||
|
||||
// 查询DeviceCar数据(AGV和CTU)
|
||||
DeviceCar deviceCar = new DeviceCar();
|
||||
List<DeviceCar> deviceList = deviceCarService.selectDeviceCarList(deviceCar);
|
||||
|
||||
|
||||
for (DeviceCar device : deviceList) {
|
||||
String type = device.getType();
|
||||
String taskNo = device.getTaskNo();
|
||||
String deviceType = "";
|
||||
String status = "其他";
|
||||
|
||||
|
||||
if ("1".equals(type)) {
|
||||
deviceType = "AGV";
|
||||
} else if ("2".equals(type)) {
|
||||
deviceType = "CTU";
|
||||
}
|
||||
|
||||
|
||||
// 根据taskNo判断状态:不等于空或0时为运行状态
|
||||
if (taskNo != null && !taskNo.trim().isEmpty() && !"0".equals(taskNo.trim())) {
|
||||
status = "运行";
|
||||
}
|
||||
|
||||
|
||||
if (!deviceType.isEmpty()) {
|
||||
Map<String, Integer> typeStatusCount = statusCount.get(deviceType);
|
||||
typeStatusCount.put(status, typeStatusCount.getOrDefault(status, 0) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 查询DeviceSsj数据(SSJ)
|
||||
DeviceSsj deviceSsj = new DeviceSsj();
|
||||
List<DeviceSsj> ssjList = deviceSsjService.selectDeviceSsjList(deviceSsj);
|
||||
|
||||
|
||||
for (DeviceSsj ssj : ssjList) {
|
||||
int taskNo = ssj.getTaskNo();
|
||||
String status = "其他";
|
||||
|
||||
|
||||
// 根据taskNo判断状态:不等于空或0时为运行状态
|
||||
if (taskNo != 0) {
|
||||
status = "运行";
|
||||
}
|
||||
|
||||
|
||||
Map<String, Integer> typeStatusCount = statusCount.get("SSJ");
|
||||
typeStatusCount.put(status, typeStatusCount.getOrDefault(status, 0) + 1);
|
||||
}
|
||||
|
||||
|
||||
return AjaxResult.success(statusCount);
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("获取设备状态分布数据失败");
|
||||
@@ -299,34 +297,34 @@ public class IndexController extends BaseController
|
||||
{
|
||||
try {
|
||||
Map<String, Object> dashboardData = new HashMap<>();
|
||||
|
||||
|
||||
// 获取设备统计
|
||||
AjaxResult deviceStatsResult = getDeviceStats();
|
||||
if (deviceStatsResult.get("code").equals(200)) {
|
||||
dashboardData.put("deviceStats", deviceStatsResult.get("data"));
|
||||
}
|
||||
|
||||
|
||||
// 获取任务统计
|
||||
AjaxResult taskStatsResult = getTaskStats();
|
||||
if (taskStatsResult.get("code").equals(200)) {
|
||||
dashboardData.put("taskStats", taskStatsResult.get("data"));
|
||||
}
|
||||
|
||||
|
||||
// 获取当前任务
|
||||
AjaxResult currentTasksResult = getCurrentTasks();
|
||||
if (currentTasksResult.get("code").equals(200)) {
|
||||
dashboardData.put("currentTasks", currentTasksResult.get("data"));
|
||||
}
|
||||
|
||||
|
||||
// 获取设备列表
|
||||
AjaxResult deviceListResult = getDeviceList();
|
||||
if (deviceListResult.get("code").equals(200)) {
|
||||
dashboardData.put("deviceList", deviceListResult.get("data"));
|
||||
}
|
||||
|
||||
|
||||
return AjaxResult.success(dashboardData);
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("获取首页数据失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.job.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.job.service.IMydoJobService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 作业信息Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/job/mydoJob")
|
||||
public class MydoJobController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMydoJobService mydoJobService;
|
||||
|
||||
/**
|
||||
* 查询作业信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MydoJob mydoJob)
|
||||
{
|
||||
startPage();
|
||||
List<MydoJob> list = mydoJobService.selectMydoJobList(mydoJob);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出作业信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:export')")
|
||||
@Log(title = "作业信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MydoJob mydoJob)
|
||||
{
|
||||
List<MydoJob> list = mydoJobService.selectMydoJobList(mydoJob);
|
||||
ExcelUtil<MydoJob> util = new ExcelUtil<MydoJob>(MydoJob.class);
|
||||
util.exportExcel(response, list, "作业信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取作业信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:query')")
|
||||
@GetMapping(value = "/{jobId}")
|
||||
public AjaxResult getInfo(@PathVariable("jobId") String jobId)
|
||||
{
|
||||
return success(mydoJobService.selectMydoJobByJobId(jobId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增作业信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:add')")
|
||||
@Log(title = "作业信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MydoJob mydoJob)
|
||||
{
|
||||
return toAjax(mydoJobService.insertMydoJob(mydoJob));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改作业信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:edit')")
|
||||
@Log(title = "作业信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MydoJob mydoJob)
|
||||
{
|
||||
return toAjax(mydoJobService.updateMydoJob(mydoJob));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除作业信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:remove')")
|
||||
@Log(title = "作业信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{jobIds}")
|
||||
public AjaxResult remove(@PathVariable String[] jobIds)
|
||||
{
|
||||
return toAjax(mydoJobService.deleteMydoJobByJobIds(jobIds));
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.ruoyi.api.domain.wcs2wms;
|
||||
package com.ruoyi.job.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -10,10 +10,10 @@ import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 任务表对象 mydo_job
|
||||
* 作业信息对象 mydo_job_wcs
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-23
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@@ -24,43 +24,16 @@ public class MydoJob extends BaseEntity
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 任务ID */
|
||||
@Excel(name = "任务ID")
|
||||
private String jobId;
|
||||
|
||||
/** 任务状态 */
|
||||
@Excel(name = "任务状态",dictType = "mydo_job_status")
|
||||
@Excel(name = "任务状态")
|
||||
private String status;
|
||||
|
||||
/** 上线类型 */
|
||||
@Excel(name = "上线类型",dictType = "on_line_type")
|
||||
private String onLineType;
|
||||
|
||||
/** 任务号 */
|
||||
@Excel(name = "任务号")
|
||||
private String taskNo;
|
||||
|
||||
/** 供应商ID */
|
||||
@Excel(name = "供应商ID")
|
||||
private String supplierId;
|
||||
@Excel(name = "供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
/** 客户ID */
|
||||
@Excel(name = "客户ID")
|
||||
private String customerId;
|
||||
@Excel(name = "客户名称")
|
||||
private String customerName;
|
||||
|
||||
/** 部门ID */
|
||||
@Excel(name = "部门ID")
|
||||
private String departmentId;
|
||||
@Excel(name = "部门")
|
||||
private String departmentName;
|
||||
|
||||
/** 托盘码 */
|
||||
@Excel(name = "托盘码")
|
||||
private String trayCode;
|
||||
|
||||
/** 巷道ID */
|
||||
@Excel(name = "巷道ID")
|
||||
private String roadwayId;
|
||||
@@ -68,8 +41,6 @@ public class MydoJob extends BaseEntity
|
||||
/** 货位ID */
|
||||
@Excel(name = "货位ID")
|
||||
private String cargoSpaceId;
|
||||
@Excel(name = "货位名称")
|
||||
private String cargoSpaceName;
|
||||
|
||||
/** 目标巷道ID */
|
||||
@Excel(name = "目标巷道ID")
|
||||
@@ -78,31 +49,19 @@ public class MydoJob extends BaseEntity
|
||||
/** 目标货位ID */
|
||||
@Excel(name = "目标货位ID")
|
||||
private String targetCargoSpaceId;
|
||||
@Excel(name = "目标货位名称")
|
||||
private String targetCargoSpaceName;
|
||||
|
||||
/** 产线ID */
|
||||
@Excel(name = "产线ID")
|
||||
private String lineId;
|
||||
|
||||
/** 车间ID */
|
||||
@Excel(name = "车间ID")
|
||||
private String workshopId;
|
||||
|
||||
/** 优先级 */
|
||||
@Excel(name = "优先级")
|
||||
private Long priority;
|
||||
|
||||
/** 执行阶段 */
|
||||
@Excel(name = "执行阶段",dictType = "execution_phase_type")
|
||||
@Excel(name = "执行阶段")
|
||||
private String executionPhase;
|
||||
|
||||
/** 任务类型 */
|
||||
@Excel(name = "任务类型",dictType = "in_or_out_type")
|
||||
@Excel(name = "任务类型")
|
||||
private String inOrOut;
|
||||
|
||||
|
||||
|
||||
/** 开始时间 */
|
||||
@Excel(name = "开始时间")
|
||||
private String startTime;
|
||||
@@ -119,21 +78,13 @@ public class MydoJob extends BaseEntity
|
||||
@Excel(name = "出口ID")
|
||||
private String exitId;
|
||||
|
||||
/** 班组ID */
|
||||
@Excel(name = "班组ID")
|
||||
private String classId;
|
||||
|
||||
/** 仓库ID */
|
||||
@Excel(name = "仓库ID")
|
||||
private String warehouseId;
|
||||
@Excel(name = "仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
/** 重分标记 */
|
||||
@Excel(name = "重分标记")
|
||||
/** 重分标志 */
|
||||
@Excel(name = "重分标志")
|
||||
private String faultFlag;
|
||||
|
||||
private String inOut;
|
||||
|
||||
|
||||
private String trayCode;
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.ruoyi.job.mapper;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
|
||||
/**
|
||||
* 作业信息Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
public interface MydoJobMapper
|
||||
{
|
||||
/**
|
||||
* 查询作业信息
|
||||
*
|
||||
* @param jobId 作业信息主键
|
||||
* @return 作业信息
|
||||
*/
|
||||
public MydoJob selectMydoJobByJobId(String jobId);
|
||||
|
||||
/**
|
||||
* 查询作业信息列表
|
||||
*
|
||||
* @param mydoJob 作业信息
|
||||
* @return 作业信息集合
|
||||
*/
|
||||
public List<MydoJob> selectMydoJobList(MydoJob mydoJob);
|
||||
|
||||
/**
|
||||
* 新增作业信息
|
||||
*
|
||||
* @param mydoJob 作业信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMydoJob(MydoJob mydoJob);
|
||||
|
||||
/**
|
||||
* 修改作业信息
|
||||
*
|
||||
* @param mydoJob 作业信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMydoJob(MydoJob mydoJob);
|
||||
|
||||
/**
|
||||
* 删除作业信息
|
||||
*
|
||||
* @param jobId 作业信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMydoJobByJobId(String jobId);
|
||||
|
||||
/**
|
||||
* 批量删除作业信息
|
||||
*
|
||||
* @param jobIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMydoJobByJobIds(String[] jobIds);
|
||||
|
||||
void ddjTaskFinish(HashMap<String, Object> map);
|
||||
|
||||
void InvalidMydoJob(HashMap<String, Object> map);
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.ruoyi.job.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
|
||||
/**
|
||||
* 作业信息Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
public interface IMydoJobService
|
||||
{
|
||||
/**
|
||||
* 查询作业信息
|
||||
*
|
||||
* @param jobId 作业信息主键
|
||||
* @return 作业信息
|
||||
*/
|
||||
public MydoJob selectMydoJobByJobId(String jobId);
|
||||
|
||||
/**
|
||||
* 查询作业信息列表
|
||||
*
|
||||
* @param mydoJob 作业信息
|
||||
* @return 作业信息集合
|
||||
*/
|
||||
public List<MydoJob> selectMydoJobList(MydoJob mydoJob);
|
||||
|
||||
/**
|
||||
* 新增作业信息
|
||||
*
|
||||
* @param mydoJob 作业信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMydoJob(MydoJob mydoJob);
|
||||
|
||||
/**
|
||||
* 修改作业信息
|
||||
*
|
||||
* @param mydoJob 作业信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMydoJob(MydoJob mydoJob);
|
||||
|
||||
/**
|
||||
* 批量删除作业信息
|
||||
*
|
||||
* @param jobIds 需要删除的作业信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMydoJobByJobIds(String[] jobIds);
|
||||
|
||||
/**
|
||||
* 删除作业信息信息
|
||||
*
|
||||
* @param jobId 作业信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMydoJobByJobId(String jobId);
|
||||
|
||||
MydoJob selectMydoJobByTaskNo(Long rwh);
|
||||
|
||||
boolean ddjTaskFinish(Long rwh, Long id);
|
||||
|
||||
boolean InvalidMydoJob(Long rwh, Long id);
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
package com.ruoyi.job.service.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.job.mapper.MydoJobMapper;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.job.service.IMydoJobService;
|
||||
|
||||
/**
|
||||
* 作业信息Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
@Service
|
||||
public class MydoJobServiceImpl implements IMydoJobService
|
||||
{
|
||||
@Autowired
|
||||
private MydoJobMapper mydoJobMapper;
|
||||
|
||||
/**
|
||||
* 查询作业信息
|
||||
*
|
||||
* @param jobId 作业信息主键
|
||||
* @return 作业信息
|
||||
*/
|
||||
@Override
|
||||
public MydoJob selectMydoJobByJobId(String jobId)
|
||||
{
|
||||
return mydoJobMapper.selectMydoJobByJobId(jobId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询作业信息列表
|
||||
*
|
||||
* @param mydoJob 作业信息
|
||||
* @return 作业信息
|
||||
*/
|
||||
@Override
|
||||
public List<MydoJob> selectMydoJobList(MydoJob mydoJob)
|
||||
{
|
||||
return mydoJobMapper.selectMydoJobList(mydoJob);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增作业信息
|
||||
*
|
||||
* @param mydoJob 作业信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMydoJob(MydoJob mydoJob)
|
||||
{
|
||||
mydoJob.setCreateTime(DateUtils.getNowDate());
|
||||
return mydoJobMapper.insertMydoJob(mydoJob);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改作业信息
|
||||
*
|
||||
* @param mydoJob 作业信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMydoJob(MydoJob mydoJob)
|
||||
{
|
||||
return mydoJobMapper.updateMydoJob(mydoJob);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除作业信息
|
||||
*
|
||||
* @param jobIds 需要删除的作业信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMydoJobByJobIds(String[] jobIds)
|
||||
{
|
||||
return mydoJobMapper.deleteMydoJobByJobIds(jobIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除作业信息信息
|
||||
*
|
||||
* @param jobId 作业信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMydoJobByJobId(String jobId)
|
||||
{
|
||||
return mydoJobMapper.deleteMydoJobByJobId(jobId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MydoJob selectMydoJobByTaskNo(Long rwh) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean ddjTaskFinish(Long rwh, Long id) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_rwh", rwh);
|
||||
map.put("v_ddj_id", id);
|
||||
mydoJobMapper.ddjTaskFinish(map);
|
||||
if (Convert.toInt(map.get("v_result"))==10){
|
||||
return true;
|
||||
}else {
|
||||
throw new RuntimeException(map.get("v_result").toString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean InvalidMydoJob(Long rwh, Long id) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_rwh", rwh);
|
||||
map.put("v_ddj_id", id);
|
||||
mydoJobMapper.InvalidMydoJob(map);
|
||||
if (Convert.toInt(map.get("v_result"))==10){
|
||||
return true;
|
||||
}else {
|
||||
throw new RuntimeException(map.get("v_result").toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.ruoyi.device.agv.controller;
|
||||
package com.ruoyi.queue.agv.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -16,8 +16,8 @@ import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.device.agv.domain.AgvQueue;
|
||||
import com.ruoyi.device.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.ruoyi.device.agv.controller;
|
||||
package com.ruoyi.queue.agv.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -16,8 +16,8 @@ import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.device.agv.domain.AgvQueueFinish;
|
||||
import com.ruoyi.device.agv.service.IAgvQueueFinishService;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueueFinish;
|
||||
import com.ruoyi.queue.agv.service.IAgvQueueFinishService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.ruoyi.device.agv.domain;
|
||||
package com.ruoyi.queue.agv.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.ruoyi.device.agv.domain;
|
||||
package com.ruoyi.queue.agv.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.ruoyi.device.agv.mapper;
|
||||
package com.ruoyi.queue.agv.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.device.agv.domain.AgvQueueFinish;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueueFinish;
|
||||
|
||||
/**
|
||||
* agv历史队列Mapper接口
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.ruoyi.device.agv.mapper;
|
||||
package com.ruoyi.queue.agv.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.device.agv.domain.AgvQueue;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||
|
||||
/**
|
||||
* AGV任务队列Mapper接口
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.ruoyi.device.agv.service;
|
||||
package com.ruoyi.queue.agv.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.device.agv.domain.AgvQueueFinish;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueueFinish;
|
||||
|
||||
/**
|
||||
* agv历史队列Service接口
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.ruoyi.device.agv.service;
|
||||
package com.ruoyi.queue.agv.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.device.agv.domain.AgvQueue;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||
|
||||
/**
|
||||
* AGV任务队列Service接口
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.ruoyi.device.agv.service.impl;
|
||||
package com.ruoyi.queue.agv.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.device.agv.mapper.AgvQueueFinishMapper;
|
||||
import com.ruoyi.device.agv.domain.AgvQueueFinish;
|
||||
import com.ruoyi.device.agv.service.IAgvQueueFinishService;
|
||||
import com.ruoyi.queue.agv.mapper.AgvQueueFinishMapper;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueueFinish;
|
||||
import com.ruoyi.queue.agv.service.IAgvQueueFinishService;
|
||||
|
||||
/**
|
||||
* agv历史队列Service业务层处理
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.ruoyi.device.agv.service.impl;
|
||||
package com.ruoyi.queue.agv.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.device.agv.mapper.AgvQueueMapper;
|
||||
import com.ruoyi.device.agv.domain.AgvQueue;
|
||||
import com.ruoyi.device.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.queue.agv.mapper.AgvQueueMapper;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||
|
||||
/**
|
||||
* AGV任务队列Service业务层处理
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.queue.ddj.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.queue.ddj.domain.DdjDeviceExecutionQueue;
|
||||
import com.ruoyi.queue.ddj.service.IDdjDeviceExecutionQueueService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 堆垛机执行队列Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/queue/ddj")
|
||||
public class DdjDeviceExecutionQueueController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDdjDeviceExecutionQueueService ddjDeviceExecutionQueueService;
|
||||
|
||||
/**
|
||||
* 查询堆垛机执行队列列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('queue:ddj:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DdjDeviceExecutionQueue ddjDeviceExecutionQueue)
|
||||
{
|
||||
startPage();
|
||||
List<DdjDeviceExecutionQueue> list = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueList(ddjDeviceExecutionQueue);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出堆垛机执行队列列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('queue:ddj:export')")
|
||||
@Log(title = "堆垛机执行队列", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DdjDeviceExecutionQueue ddjDeviceExecutionQueue)
|
||||
{
|
||||
List<DdjDeviceExecutionQueue> list = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueList(ddjDeviceExecutionQueue);
|
||||
ExcelUtil<DdjDeviceExecutionQueue> util = new ExcelUtil<DdjDeviceExecutionQueue>(DdjDeviceExecutionQueue.class);
|
||||
util.exportExcel(response, list, "堆垛机执行队列数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取堆垛机执行队列详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('queue:ddj:query')")
|
||||
@GetMapping(value = "/{uuid}")
|
||||
public AjaxResult getInfo(@PathVariable("uuid") String uuid)
|
||||
{
|
||||
return success(ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByUuid(uuid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增堆垛机执行队列
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('queue:ddj:add')")
|
||||
@Log(title = "堆垛机执行队列", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DdjDeviceExecutionQueue ddjDeviceExecutionQueue)
|
||||
{
|
||||
return toAjax(ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改堆垛机执行队列
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('queue:ddj:edit')")
|
||||
@Log(title = "堆垛机执行队列", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DdjDeviceExecutionQueue ddjDeviceExecutionQueue)
|
||||
{
|
||||
return toAjax(ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除堆垛机执行队列
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('queue:ddj:remove')")
|
||||
@Log(title = "堆垛机执行队列", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{uuids}")
|
||||
public AjaxResult remove(@PathVariable String[] uuids)
|
||||
{
|
||||
return toAjax(ddjDeviceExecutionQueueService.deleteDdjDeviceExecutionQueueByUuids(uuids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.queue.ddj.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.queue.ddj.domain.DdjDeviceExecutionQueueFinish;
|
||||
import com.ruoyi.queue.ddj.service.IDdjDeviceExecutionQueueFinishService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 堆垛机完成队列Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/queue/ddjFinish")
|
||||
public class DdjDeviceExecutionQueueFinishController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDdjDeviceExecutionQueueFinishService ddjDeviceExecutionQueueFinishService;
|
||||
|
||||
/**
|
||||
* 查询堆垛机完成队列列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('queue:ddjFinish:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DdjDeviceExecutionQueueFinish ddjDeviceExecutionQueueFinish)
|
||||
{
|
||||
startPage();
|
||||
List<DdjDeviceExecutionQueueFinish> list = ddjDeviceExecutionQueueFinishService.selectDdjDeviceExecutionQueueFinishList(ddjDeviceExecutionQueueFinish);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出堆垛机完成队列列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('queue:ddjFinish:export')")
|
||||
@Log(title = "堆垛机完成队列", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DdjDeviceExecutionQueueFinish ddjDeviceExecutionQueueFinish)
|
||||
{
|
||||
List<DdjDeviceExecutionQueueFinish> list = ddjDeviceExecutionQueueFinishService.selectDdjDeviceExecutionQueueFinishList(ddjDeviceExecutionQueueFinish);
|
||||
ExcelUtil<DdjDeviceExecutionQueueFinish> util = new ExcelUtil<DdjDeviceExecutionQueueFinish>(DdjDeviceExecutionQueueFinish.class);
|
||||
util.exportExcel(response, list, "堆垛机完成队列数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取堆垛机完成队列详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('queue:ddjFinish:query')")
|
||||
@GetMapping(value = "/{uuid}")
|
||||
public AjaxResult getInfo(@PathVariable("uuid") String uuid)
|
||||
{
|
||||
return success(ddjDeviceExecutionQueueFinishService.selectDdjDeviceExecutionQueueFinishByUuid(uuid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增堆垛机完成队列
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('queue:ddjFinish:add')")
|
||||
@Log(title = "堆垛机完成队列", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DdjDeviceExecutionQueueFinish ddjDeviceExecutionQueueFinish)
|
||||
{
|
||||
return toAjax(ddjDeviceExecutionQueueFinishService.insertDdjDeviceExecutionQueueFinish(ddjDeviceExecutionQueueFinish));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改堆垛机完成队列
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('queue:ddjFinish:edit')")
|
||||
@Log(title = "堆垛机完成队列", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DdjDeviceExecutionQueueFinish ddjDeviceExecutionQueueFinish)
|
||||
{
|
||||
return toAjax(ddjDeviceExecutionQueueFinishService.updateDdjDeviceExecutionQueueFinish(ddjDeviceExecutionQueueFinish));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除堆垛机完成队列
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('queue:ddjFinish:remove')")
|
||||
@Log(title = "堆垛机完成队列", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{uuids}")
|
||||
public AjaxResult remove(@PathVariable String[] uuids)
|
||||
{
|
||||
return toAjax(ddjDeviceExecutionQueueFinishService.deleteDdjDeviceExecutionQueueFinishByUuids(uuids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,322 @@
|
||||
package com.ruoyi.queue.ddj.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 堆垛机执行队列对象 ddj_device_execution_queue
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
public class DdjDeviceExecutionQueue extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** uuid */
|
||||
private String uuid;
|
||||
|
||||
/** 任务号 */
|
||||
@Excel(name = "任务号")
|
||||
private Long rwh;
|
||||
|
||||
/** 设备名称 */
|
||||
@Excel(name = "设备名称")
|
||||
private String devName;
|
||||
|
||||
/** 设备id */
|
||||
@Excel(name = "设备id")
|
||||
private Long devId;
|
||||
|
||||
/** 任务状态 */
|
||||
@Excel(name = "任务状态")
|
||||
private Long rwzt;
|
||||
|
||||
/** 原排 */
|
||||
@Excel(name = "原排")
|
||||
private Long yph;
|
||||
|
||||
/** 原列 */
|
||||
@Excel(name = "原列")
|
||||
private Long ylh;
|
||||
|
||||
/** 原层 */
|
||||
@Excel(name = "原层")
|
||||
private Long ych;
|
||||
|
||||
/** 目标排 */
|
||||
@Excel(name = "目标排")
|
||||
private Long mbph;
|
||||
|
||||
/** 目标列 */
|
||||
@Excel(name = "目标列")
|
||||
private Long mblh;
|
||||
|
||||
/** 目标层 */
|
||||
@Excel(name = "目标层")
|
||||
private Long mbch;
|
||||
|
||||
/** 堆垛机下发 */
|
||||
@Excel(name = "堆垛机下发")
|
||||
private String ddjxf;
|
||||
|
||||
/** 任务类型 */
|
||||
@Excel(name = "任务类型")
|
||||
private Long rwlx;
|
||||
|
||||
/** 生成时间 */
|
||||
@Excel(name = "生成时间")
|
||||
private String scsj;
|
||||
|
||||
/** 下发时间 */
|
||||
@Excel(name = "下发时间")
|
||||
private String xfsj;
|
||||
|
||||
/** 结束时间 */
|
||||
@Excel(name = "结束时间")
|
||||
private String jssj;
|
||||
|
||||
/** 命令方式 */
|
||||
@Excel(name = "命令方式")
|
||||
private Long mlfs;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String spare1;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String spare2;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String spare3;
|
||||
|
||||
public void setUuid(String uuid)
|
||||
{
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public String getUuid()
|
||||
{
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setRwh(Long rwh)
|
||||
{
|
||||
this.rwh = rwh;
|
||||
}
|
||||
|
||||
public Long getRwh()
|
||||
{
|
||||
return rwh;
|
||||
}
|
||||
|
||||
public void setDevName(String devName)
|
||||
{
|
||||
this.devName = devName;
|
||||
}
|
||||
|
||||
public String getDevName()
|
||||
{
|
||||
return devName;
|
||||
}
|
||||
|
||||
public void setDevId(Long devId)
|
||||
{
|
||||
this.devId = devId;
|
||||
}
|
||||
|
||||
public Long getDevId()
|
||||
{
|
||||
return devId;
|
||||
}
|
||||
|
||||
public void setRwzt(Long rwzt)
|
||||
{
|
||||
this.rwzt = rwzt;
|
||||
}
|
||||
|
||||
public Long getRwzt()
|
||||
{
|
||||
return rwzt;
|
||||
}
|
||||
|
||||
public void setYph(Long yph)
|
||||
{
|
||||
this.yph = yph;
|
||||
}
|
||||
|
||||
public Long getYph()
|
||||
{
|
||||
return yph;
|
||||
}
|
||||
|
||||
public void setYlh(Long ylh)
|
||||
{
|
||||
this.ylh = ylh;
|
||||
}
|
||||
|
||||
public Long getYlh()
|
||||
{
|
||||
return ylh;
|
||||
}
|
||||
|
||||
public void setYch(Long ych)
|
||||
{
|
||||
this.ych = ych;
|
||||
}
|
||||
|
||||
public Long getYch()
|
||||
{
|
||||
return ych;
|
||||
}
|
||||
|
||||
public void setMbph(Long mbph)
|
||||
{
|
||||
this.mbph = mbph;
|
||||
}
|
||||
|
||||
public Long getMbph()
|
||||
{
|
||||
return mbph;
|
||||
}
|
||||
|
||||
public void setMblh(Long mblh)
|
||||
{
|
||||
this.mblh = mblh;
|
||||
}
|
||||
|
||||
public Long getMblh()
|
||||
{
|
||||
return mblh;
|
||||
}
|
||||
|
||||
public void setMbch(Long mbch)
|
||||
{
|
||||
this.mbch = mbch;
|
||||
}
|
||||
|
||||
public Long getMbch()
|
||||
{
|
||||
return mbch;
|
||||
}
|
||||
|
||||
public void setDdjxf(String ddjxf)
|
||||
{
|
||||
this.ddjxf = ddjxf;
|
||||
}
|
||||
|
||||
public String getDdjxf()
|
||||
{
|
||||
return ddjxf;
|
||||
}
|
||||
|
||||
public void setRwlx(Long rwlx)
|
||||
{
|
||||
this.rwlx = rwlx;
|
||||
}
|
||||
|
||||
public Long getRwlx()
|
||||
{
|
||||
return rwlx;
|
||||
}
|
||||
|
||||
public void setScsj(String scsj)
|
||||
{
|
||||
this.scsj = scsj;
|
||||
}
|
||||
|
||||
public String getScsj()
|
||||
{
|
||||
return scsj;
|
||||
}
|
||||
|
||||
public void setXfsj(String xfsj)
|
||||
{
|
||||
this.xfsj = xfsj;
|
||||
}
|
||||
|
||||
public String getXfsj()
|
||||
{
|
||||
return xfsj;
|
||||
}
|
||||
|
||||
public void setJssj(String jssj)
|
||||
{
|
||||
this.jssj = jssj;
|
||||
}
|
||||
|
||||
public String getJssj()
|
||||
{
|
||||
return jssj;
|
||||
}
|
||||
|
||||
public void setMlfs(Long mlfs)
|
||||
{
|
||||
this.mlfs = mlfs;
|
||||
}
|
||||
|
||||
public Long getMlfs()
|
||||
{
|
||||
return mlfs;
|
||||
}
|
||||
|
||||
public void setSpare1(String spare1)
|
||||
{
|
||||
this.spare1 = spare1;
|
||||
}
|
||||
|
||||
public String getSpare1()
|
||||
{
|
||||
return spare1;
|
||||
}
|
||||
|
||||
public void setSpare2(String spare2)
|
||||
{
|
||||
this.spare2 = spare2;
|
||||
}
|
||||
|
||||
public String getSpare2()
|
||||
{
|
||||
return spare2;
|
||||
}
|
||||
|
||||
public void setSpare3(String spare3)
|
||||
{
|
||||
this.spare3 = spare3;
|
||||
}
|
||||
|
||||
public String getSpare3()
|
||||
{
|
||||
return spare3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("uuid", getUuid())
|
||||
.append("rwh", getRwh())
|
||||
.append("devName", getDevName())
|
||||
.append("devId", getDevId())
|
||||
.append("rwzt", getRwzt())
|
||||
.append("yph", getYph())
|
||||
.append("ylh", getYlh())
|
||||
.append("ych", getYch())
|
||||
.append("mbph", getMbph())
|
||||
.append("mblh", getMblh())
|
||||
.append("mbch", getMbch())
|
||||
.append("ddjxf", getDdjxf())
|
||||
.append("rwlx", getRwlx())
|
||||
.append("scsj", getScsj())
|
||||
.append("xfsj", getXfsj())
|
||||
.append("jssj", getJssj())
|
||||
.append("mlfs", getMlfs())
|
||||
.append("spare1", getSpare1())
|
||||
.append("spare2", getSpare2())
|
||||
.append("spare3", getSpare3())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,322 @@
|
||||
package com.ruoyi.queue.ddj.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 堆垛机完成队列对象 ddj_device_execution_queue_finish
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
public class DdjDeviceExecutionQueueFinish extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** uuid */
|
||||
private String uuid;
|
||||
|
||||
/** 任务号 */
|
||||
@Excel(name = "任务号")
|
||||
private Long rwh;
|
||||
|
||||
/** 设备名称 */
|
||||
@Excel(name = "设备名称")
|
||||
private String devName;
|
||||
|
||||
/** 设备id */
|
||||
@Excel(name = "设备id")
|
||||
private Long devId;
|
||||
|
||||
/** 任务状态 */
|
||||
@Excel(name = "任务状态")
|
||||
private Long rwzt;
|
||||
|
||||
/** 原排 */
|
||||
@Excel(name = "原排")
|
||||
private Long yph;
|
||||
|
||||
/** 原列 */
|
||||
@Excel(name = "原列")
|
||||
private Long ylh;
|
||||
|
||||
/** 原层 */
|
||||
@Excel(name = "原层")
|
||||
private Long ych;
|
||||
|
||||
/** 目标排 */
|
||||
@Excel(name = "目标排")
|
||||
private Long mbph;
|
||||
|
||||
/** 目标列 */
|
||||
@Excel(name = "目标列")
|
||||
private Long mblh;
|
||||
|
||||
/** 目标层 */
|
||||
@Excel(name = "目标层")
|
||||
private Long mbch;
|
||||
|
||||
/** 堆垛机下发 */
|
||||
@Excel(name = "堆垛机下发")
|
||||
private String ddjxf;
|
||||
|
||||
/** 任务类型 */
|
||||
@Excel(name = "任务类型")
|
||||
private Long rwlx;
|
||||
|
||||
/** 生成时间 */
|
||||
@Excel(name = "生成时间")
|
||||
private String scsj;
|
||||
|
||||
/** 下发时间 */
|
||||
@Excel(name = "下发时间")
|
||||
private String xfsj;
|
||||
|
||||
/** 结束时间 */
|
||||
@Excel(name = "结束时间")
|
||||
private String jssj;
|
||||
|
||||
/** 命令方式 */
|
||||
@Excel(name = "命令方式")
|
||||
private Long mlfs;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String spare1;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String spare2;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String spare3;
|
||||
|
||||
public void setUuid(String uuid)
|
||||
{
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public String getUuid()
|
||||
{
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setRwh(Long rwh)
|
||||
{
|
||||
this.rwh = rwh;
|
||||
}
|
||||
|
||||
public Long getRwh()
|
||||
{
|
||||
return rwh;
|
||||
}
|
||||
|
||||
public void setDevName(String devName)
|
||||
{
|
||||
this.devName = devName;
|
||||
}
|
||||
|
||||
public String getDevName()
|
||||
{
|
||||
return devName;
|
||||
}
|
||||
|
||||
public void setDevId(Long devId)
|
||||
{
|
||||
this.devId = devId;
|
||||
}
|
||||
|
||||
public Long getDevId()
|
||||
{
|
||||
return devId;
|
||||
}
|
||||
|
||||
public void setRwzt(Long rwzt)
|
||||
{
|
||||
this.rwzt = rwzt;
|
||||
}
|
||||
|
||||
public Long getRwzt()
|
||||
{
|
||||
return rwzt;
|
||||
}
|
||||
|
||||
public void setYph(Long yph)
|
||||
{
|
||||
this.yph = yph;
|
||||
}
|
||||
|
||||
public Long getYph()
|
||||
{
|
||||
return yph;
|
||||
}
|
||||
|
||||
public void setYlh(Long ylh)
|
||||
{
|
||||
this.ylh = ylh;
|
||||
}
|
||||
|
||||
public Long getYlh()
|
||||
{
|
||||
return ylh;
|
||||
}
|
||||
|
||||
public void setYch(Long ych)
|
||||
{
|
||||
this.ych = ych;
|
||||
}
|
||||
|
||||
public Long getYch()
|
||||
{
|
||||
return ych;
|
||||
}
|
||||
|
||||
public void setMbph(Long mbph)
|
||||
{
|
||||
this.mbph = mbph;
|
||||
}
|
||||
|
||||
public Long getMbph()
|
||||
{
|
||||
return mbph;
|
||||
}
|
||||
|
||||
public void setMblh(Long mblh)
|
||||
{
|
||||
this.mblh = mblh;
|
||||
}
|
||||
|
||||
public Long getMblh()
|
||||
{
|
||||
return mblh;
|
||||
}
|
||||
|
||||
public void setMbch(Long mbch)
|
||||
{
|
||||
this.mbch = mbch;
|
||||
}
|
||||
|
||||
public Long getMbch()
|
||||
{
|
||||
return mbch;
|
||||
}
|
||||
|
||||
public void setDdjxf(String ddjxf)
|
||||
{
|
||||
this.ddjxf = ddjxf;
|
||||
}
|
||||
|
||||
public String getDdjxf()
|
||||
{
|
||||
return ddjxf;
|
||||
}
|
||||
|
||||
public void setRwlx(Long rwlx)
|
||||
{
|
||||
this.rwlx = rwlx;
|
||||
}
|
||||
|
||||
public Long getRwlx()
|
||||
{
|
||||
return rwlx;
|
||||
}
|
||||
|
||||
public void setScsj(String scsj)
|
||||
{
|
||||
this.scsj = scsj;
|
||||
}
|
||||
|
||||
public String getScsj()
|
||||
{
|
||||
return scsj;
|
||||
}
|
||||
|
||||
public void setXfsj(String xfsj)
|
||||
{
|
||||
this.xfsj = xfsj;
|
||||
}
|
||||
|
||||
public String getXfsj()
|
||||
{
|
||||
return xfsj;
|
||||
}
|
||||
|
||||
public void setJssj(String jssj)
|
||||
{
|
||||
this.jssj = jssj;
|
||||
}
|
||||
|
||||
public String getJssj()
|
||||
{
|
||||
return jssj;
|
||||
}
|
||||
|
||||
public void setMlfs(Long mlfs)
|
||||
{
|
||||
this.mlfs = mlfs;
|
||||
}
|
||||
|
||||
public Long getMlfs()
|
||||
{
|
||||
return mlfs;
|
||||
}
|
||||
|
||||
public void setSpare1(String spare1)
|
||||
{
|
||||
this.spare1 = spare1;
|
||||
}
|
||||
|
||||
public String getSpare1()
|
||||
{
|
||||
return spare1;
|
||||
}
|
||||
|
||||
public void setSpare2(String spare2)
|
||||
{
|
||||
this.spare2 = spare2;
|
||||
}
|
||||
|
||||
public String getSpare2()
|
||||
{
|
||||
return spare2;
|
||||
}
|
||||
|
||||
public void setSpare3(String spare3)
|
||||
{
|
||||
this.spare3 = spare3;
|
||||
}
|
||||
|
||||
public String getSpare3()
|
||||
{
|
||||
return spare3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("uuid", getUuid())
|
||||
.append("rwh", getRwh())
|
||||
.append("devName", getDevName())
|
||||
.append("devId", getDevId())
|
||||
.append("rwzt", getRwzt())
|
||||
.append("yph", getYph())
|
||||
.append("ylh", getYlh())
|
||||
.append("ych", getYch())
|
||||
.append("mbph", getMbph())
|
||||
.append("mblh", getMblh())
|
||||
.append("mbch", getMbch())
|
||||
.append("ddjxf", getDdjxf())
|
||||
.append("rwlx", getRwlx())
|
||||
.append("scsj", getScsj())
|
||||
.append("xfsj", getXfsj())
|
||||
.append("jssj", getJssj())
|
||||
.append("mlfs", getMlfs())
|
||||
.append("spare1", getSpare1())
|
||||
.append("spare2", getSpare2())
|
||||
.append("spare3", getSpare3())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.queue.ddj.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.queue.ddj.domain.DdjDeviceExecutionQueueFinish;
|
||||
|
||||
/**
|
||||
* 堆垛机完成队列Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
public interface DdjDeviceExecutionQueueFinishMapper
|
||||
{
|
||||
/**
|
||||
* 查询堆垛机完成队列
|
||||
*
|
||||
* @param uuid 堆垛机完成队列主键
|
||||
* @return 堆垛机完成队列
|
||||
*/
|
||||
public DdjDeviceExecutionQueueFinish selectDdjDeviceExecutionQueueFinishByUuid(String uuid);
|
||||
|
||||
/**
|
||||
* 查询堆垛机完成队列列表
|
||||
*
|
||||
* @param ddjDeviceExecutionQueueFinish 堆垛机完成队列
|
||||
* @return 堆垛机完成队列集合
|
||||
*/
|
||||
public List<DdjDeviceExecutionQueueFinish> selectDdjDeviceExecutionQueueFinishList(DdjDeviceExecutionQueueFinish ddjDeviceExecutionQueueFinish);
|
||||
|
||||
/**
|
||||
* 新增堆垛机完成队列
|
||||
*
|
||||
* @param ddjDeviceExecutionQueueFinish 堆垛机完成队列
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDdjDeviceExecutionQueueFinish(DdjDeviceExecutionQueueFinish ddjDeviceExecutionQueueFinish);
|
||||
|
||||
/**
|
||||
* 修改堆垛机完成队列
|
||||
*
|
||||
* @param ddjDeviceExecutionQueueFinish 堆垛机完成队列
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDdjDeviceExecutionQueueFinish(DdjDeviceExecutionQueueFinish ddjDeviceExecutionQueueFinish);
|
||||
|
||||
/**
|
||||
* 删除堆垛机完成队列
|
||||
*
|
||||
* @param uuid 堆垛机完成队列主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDdjDeviceExecutionQueueFinishByUuid(String uuid);
|
||||
|
||||
/**
|
||||
* 批量删除堆垛机完成队列
|
||||
*
|
||||
* @param uuids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDdjDeviceExecutionQueueFinishByUuids(String[] uuids);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.queue.ddj.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.queue.ddj.domain.DdjDeviceExecutionQueue;
|
||||
|
||||
/**
|
||||
* 堆垛机执行队列Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
public interface DdjDeviceExecutionQueueMapper
|
||||
{
|
||||
/**
|
||||
* 查询堆垛机执行队列
|
||||
*
|
||||
* @param uuid 堆垛机执行队列主键
|
||||
* @return 堆垛机执行队列
|
||||
*/
|
||||
public DdjDeviceExecutionQueue selectDdjDeviceExecutionQueueByUuid(String uuid);
|
||||
|
||||
/**
|
||||
* 查询堆垛机执行队列列表
|
||||
*
|
||||
* @param ddjDeviceExecutionQueue 堆垛机执行队列
|
||||
* @return 堆垛机执行队列集合
|
||||
*/
|
||||
public List<DdjDeviceExecutionQueue> selectDdjDeviceExecutionQueueList(DdjDeviceExecutionQueue ddjDeviceExecutionQueue);
|
||||
|
||||
/**
|
||||
* 新增堆垛机执行队列
|
||||
*
|
||||
* @param ddjDeviceExecutionQueue 堆垛机执行队列
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDdjDeviceExecutionQueue(DdjDeviceExecutionQueue ddjDeviceExecutionQueue);
|
||||
|
||||
/**
|
||||
* 修改堆垛机执行队列
|
||||
*
|
||||
* @param ddjDeviceExecutionQueue 堆垛机执行队列
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDdjDeviceExecutionQueue(DdjDeviceExecutionQueue ddjDeviceExecutionQueue);
|
||||
|
||||
/**
|
||||
* 删除堆垛机执行队列
|
||||
*
|
||||
* @param uuid 堆垛机执行队列主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDdjDeviceExecutionQueueByUuid(String uuid);
|
||||
|
||||
/**
|
||||
* 批量删除堆垛机执行队列
|
||||
*
|
||||
* @param uuids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDdjDeviceExecutionQueueByUuids(String[] uuids);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.queue.ddj.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.queue.ddj.domain.DdjDeviceExecutionQueueFinish;
|
||||
|
||||
/**
|
||||
* 堆垛机完成队列Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
public interface IDdjDeviceExecutionQueueFinishService
|
||||
{
|
||||
/**
|
||||
* 查询堆垛机完成队列
|
||||
*
|
||||
* @param uuid 堆垛机完成队列主键
|
||||
* @return 堆垛机完成队列
|
||||
*/
|
||||
public DdjDeviceExecutionQueueFinish selectDdjDeviceExecutionQueueFinishByUuid(String uuid);
|
||||
|
||||
/**
|
||||
* 查询堆垛机完成队列列表
|
||||
*
|
||||
* @param ddjDeviceExecutionQueueFinish 堆垛机完成队列
|
||||
* @return 堆垛机完成队列集合
|
||||
*/
|
||||
public List<DdjDeviceExecutionQueueFinish> selectDdjDeviceExecutionQueueFinishList(DdjDeviceExecutionQueueFinish ddjDeviceExecutionQueueFinish);
|
||||
|
||||
/**
|
||||
* 新增堆垛机完成队列
|
||||
*
|
||||
* @param ddjDeviceExecutionQueueFinish 堆垛机完成队列
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDdjDeviceExecutionQueueFinish(DdjDeviceExecutionQueueFinish ddjDeviceExecutionQueueFinish);
|
||||
|
||||
/**
|
||||
* 修改堆垛机完成队列
|
||||
*
|
||||
* @param ddjDeviceExecutionQueueFinish 堆垛机完成队列
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDdjDeviceExecutionQueueFinish(DdjDeviceExecutionQueueFinish ddjDeviceExecutionQueueFinish);
|
||||
|
||||
/**
|
||||
* 批量删除堆垛机完成队列
|
||||
*
|
||||
* @param uuids 需要删除的堆垛机完成队列主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDdjDeviceExecutionQueueFinishByUuids(String[] uuids);
|
||||
|
||||
/**
|
||||
* 删除堆垛机完成队列信息
|
||||
*
|
||||
* @param uuid 堆垛机完成队列主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDdjDeviceExecutionQueueFinishByUuid(String uuid);
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.ruoyi.queue.ddj.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.queue.ddj.domain.DdjDeviceExecutionQueue;
|
||||
|
||||
/**
|
||||
* 堆垛机执行队列Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
public interface IDdjDeviceExecutionQueueService
|
||||
{
|
||||
/**
|
||||
* 查询堆垛机执行队列
|
||||
*
|
||||
* @param uuid 堆垛机执行队列主键
|
||||
* @return 堆垛机执行队列
|
||||
*/
|
||||
public DdjDeviceExecutionQueue selectDdjDeviceExecutionQueueByUuid(String uuid);
|
||||
|
||||
/**
|
||||
* 查询堆垛机执行队列列表
|
||||
*
|
||||
* @param ddjDeviceExecutionQueue 堆垛机执行队列
|
||||
* @return 堆垛机执行队列集合
|
||||
*/
|
||||
public List<DdjDeviceExecutionQueue> selectDdjDeviceExecutionQueueList(DdjDeviceExecutionQueue ddjDeviceExecutionQueue);
|
||||
|
||||
/**
|
||||
* 新增堆垛机执行队列
|
||||
*
|
||||
* @param ddjDeviceExecutionQueue 堆垛机执行队列
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDdjDeviceExecutionQueue(DdjDeviceExecutionQueue ddjDeviceExecutionQueue);
|
||||
|
||||
/**
|
||||
* 修改堆垛机执行队列
|
||||
*
|
||||
* @param ddjDeviceExecutionQueue 堆垛机执行队列
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDdjDeviceExecutionQueue(DdjDeviceExecutionQueue ddjDeviceExecutionQueue);
|
||||
|
||||
/**
|
||||
* 批量删除堆垛机执行队列
|
||||
*
|
||||
* @param uuids 需要删除的堆垛机执行队列主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDdjDeviceExecutionQueueByUuids(String[] uuids);
|
||||
|
||||
/**
|
||||
* 删除堆垛机执行队列信息
|
||||
*
|
||||
* @param uuid 堆垛机执行队列主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDdjDeviceExecutionQueueByUuid(String uuid);
|
||||
|
||||
DdjDeviceExecutionQueue selectDdjDeviceExecutionQueueByRwh(Long rwh);
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.ruoyi.queue.ddj.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.queue.ddj.mapper.DdjDeviceExecutionQueueFinishMapper;
|
||||
import com.ruoyi.queue.ddj.domain.DdjDeviceExecutionQueueFinish;
|
||||
import com.ruoyi.queue.ddj.service.IDdjDeviceExecutionQueueFinishService;
|
||||
|
||||
/**
|
||||
* 堆垛机完成队列Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
@Service
|
||||
public class DdjDeviceExecutionQueueFinishServiceImpl implements IDdjDeviceExecutionQueueFinishService
|
||||
{
|
||||
@Autowired
|
||||
private DdjDeviceExecutionQueueFinishMapper ddjDeviceExecutionQueueFinishMapper;
|
||||
|
||||
/**
|
||||
* 查询堆垛机完成队列
|
||||
*
|
||||
* @param uuid 堆垛机完成队列主键
|
||||
* @return 堆垛机完成队列
|
||||
*/
|
||||
@Override
|
||||
public DdjDeviceExecutionQueueFinish selectDdjDeviceExecutionQueueFinishByUuid(String uuid)
|
||||
{
|
||||
return ddjDeviceExecutionQueueFinishMapper.selectDdjDeviceExecutionQueueFinishByUuid(uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询堆垛机完成队列列表
|
||||
*
|
||||
* @param ddjDeviceExecutionQueueFinish 堆垛机完成队列
|
||||
* @return 堆垛机完成队列
|
||||
*/
|
||||
@Override
|
||||
public List<DdjDeviceExecutionQueueFinish> selectDdjDeviceExecutionQueueFinishList(DdjDeviceExecutionQueueFinish ddjDeviceExecutionQueueFinish)
|
||||
{
|
||||
return ddjDeviceExecutionQueueFinishMapper.selectDdjDeviceExecutionQueueFinishList(ddjDeviceExecutionQueueFinish);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增堆垛机完成队列
|
||||
*
|
||||
* @param ddjDeviceExecutionQueueFinish 堆垛机完成队列
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDdjDeviceExecutionQueueFinish(DdjDeviceExecutionQueueFinish ddjDeviceExecutionQueueFinish)
|
||||
{
|
||||
return ddjDeviceExecutionQueueFinishMapper.insertDdjDeviceExecutionQueueFinish(ddjDeviceExecutionQueueFinish);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改堆垛机完成队列
|
||||
*
|
||||
* @param ddjDeviceExecutionQueueFinish 堆垛机完成队列
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDdjDeviceExecutionQueueFinish(DdjDeviceExecutionQueueFinish ddjDeviceExecutionQueueFinish)
|
||||
{
|
||||
return ddjDeviceExecutionQueueFinishMapper.updateDdjDeviceExecutionQueueFinish(ddjDeviceExecutionQueueFinish);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除堆垛机完成队列
|
||||
*
|
||||
* @param uuids 需要删除的堆垛机完成队列主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDdjDeviceExecutionQueueFinishByUuids(String[] uuids)
|
||||
{
|
||||
return ddjDeviceExecutionQueueFinishMapper.deleteDdjDeviceExecutionQueueFinishByUuids(uuids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除堆垛机完成队列信息
|
||||
*
|
||||
* @param uuid 堆垛机完成队列主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDdjDeviceExecutionQueueFinishByUuid(String uuid)
|
||||
{
|
||||
return ddjDeviceExecutionQueueFinishMapper.deleteDdjDeviceExecutionQueueFinishByUuid(uuid);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.ruoyi.queue.ddj.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.queue.ddj.mapper.DdjDeviceExecutionQueueMapper;
|
||||
import com.ruoyi.queue.ddj.domain.DdjDeviceExecutionQueue;
|
||||
import com.ruoyi.queue.ddj.service.IDdjDeviceExecutionQueueService;
|
||||
|
||||
/**
|
||||
* 堆垛机执行队列Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
@Service
|
||||
public class DdjDeviceExecutionQueueServiceImpl implements IDdjDeviceExecutionQueueService
|
||||
{
|
||||
@Autowired
|
||||
private DdjDeviceExecutionQueueMapper ddjDeviceExecutionQueueMapper;
|
||||
|
||||
/**
|
||||
* 查询堆垛机执行队列
|
||||
*
|
||||
* @param uuid 堆垛机执行队列主键
|
||||
* @return 堆垛机执行队列
|
||||
*/
|
||||
@Override
|
||||
public DdjDeviceExecutionQueue selectDdjDeviceExecutionQueueByUuid(String uuid)
|
||||
{
|
||||
return ddjDeviceExecutionQueueMapper.selectDdjDeviceExecutionQueueByUuid(uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询堆垛机执行队列列表
|
||||
*
|
||||
* @param ddjDeviceExecutionQueue 堆垛机执行队列
|
||||
* @return 堆垛机执行队列
|
||||
*/
|
||||
@Override
|
||||
public List<DdjDeviceExecutionQueue> selectDdjDeviceExecutionQueueList(DdjDeviceExecutionQueue ddjDeviceExecutionQueue)
|
||||
{
|
||||
return ddjDeviceExecutionQueueMapper.selectDdjDeviceExecutionQueueList(ddjDeviceExecutionQueue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增堆垛机执行队列
|
||||
*
|
||||
* @param ddjDeviceExecutionQueue 堆垛机执行队列
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDdjDeviceExecutionQueue(DdjDeviceExecutionQueue ddjDeviceExecutionQueue)
|
||||
{
|
||||
return ddjDeviceExecutionQueueMapper.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改堆垛机执行队列
|
||||
*
|
||||
* @param ddjDeviceExecutionQueue 堆垛机执行队列
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDdjDeviceExecutionQueue(DdjDeviceExecutionQueue ddjDeviceExecutionQueue)
|
||||
{
|
||||
return ddjDeviceExecutionQueueMapper.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除堆垛机执行队列
|
||||
*
|
||||
* @param uuids 需要删除的堆垛机执行队列主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDdjDeviceExecutionQueueByUuids(String[] uuids)
|
||||
{
|
||||
return ddjDeviceExecutionQueueMapper.deleteDdjDeviceExecutionQueueByUuids(uuids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除堆垛机执行队列信息
|
||||
*
|
||||
* @param uuid 堆垛机执行队列主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDdjDeviceExecutionQueueByUuid(String uuid)
|
||||
{
|
||||
return ddjDeviceExecutionQueueMapper.deleteDdjDeviceExecutionQueueByUuid(uuid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DdjDeviceExecutionQueue selectDdjDeviceExecutionQueueByRwh(Long rwh) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,17 @@
|
||||
package com.ruoyi.schedule;
|
||||
|
||||
import com.ruoyi.device.ddj.domain.MsgDdj;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.device.ssj.service.IDeviceSsjService;
|
||||
import com.ruoyi.schedule.plcRead.ssj.domain.PlcConnectInfo;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcRead;
|
||||
import com.ruoyi.schedule.plcRead.ssj.domain.CustomThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.bs.BsInSsjThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.bs.BsOutSsjThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.bs.BsPickSsjTread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.js.JsInSsjThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.js.JsOutSsjThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.js.JsPickSsjTread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.monitor.SsjMonitorThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ddj.Ddj1Thread;
|
||||
import com.ruoyi.schedule.scheduleTask.ddj.Ddj2Thread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.floor1.Floor1SsjInOutThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.floor1.Floor1SsjRoadWayThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.floor2.Floor2SsjInOutThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.floor2.Floor2SsjRoadWayThread;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -29,13 +29,12 @@ public class ScheduleThread {
|
||||
@Autowired
|
||||
private IDeviceSsjService deviceSsjService;
|
||||
|
||||
public CustomThread<BsInSsjThread> bsInSsjThread;
|
||||
public CustomThread<JsInSsjThread> jsInSsjThread;
|
||||
public CustomThread<BsOutSsjThread> bsOutSsjThread;
|
||||
public CustomThread<JsOutSsjThread> jsOutSsjThread;
|
||||
public CustomThread<BsPickSsjTread> bsPickSsjThread;
|
||||
public CustomThread<JsPickSsjTread> jsPickSsjThread;
|
||||
public CustomThread<SsjMonitorThread> ssjMonitorThread;
|
||||
public CustomThread<Ddj1Thread> ddj1ThreadCustomThread;
|
||||
public CustomThread<Ddj2Thread> ddj2ThreadCustomThread;
|
||||
public CustomThread<Floor1SsjInOutThread> bsOutSsjThread;
|
||||
public CustomThread<Floor1SsjRoadWayThread> jsOutSsjThread;
|
||||
public CustomThread<Floor2SsjInOutThread> bsPickSsjThread;
|
||||
public CustomThread<Floor2SsjRoadWayThread> jsPickSsjThread;
|
||||
|
||||
|
||||
private boolean isRun = false;
|
||||
@@ -58,7 +57,7 @@ public class ScheduleThread {
|
||||
* 调度初始化
|
||||
*/
|
||||
private void scheduleInit() {
|
||||
BsInSsjThread bsInSsjThread1 = new BsInSsjThread();
|
||||
/* BsInSsjThread bsInSsjThread1 = new BsInSsjThread();
|
||||
bsInSsjThread = new CustomThread<BsInSsjThread>(new Thread(bsInSsjThread1), bsInSsjThread1);
|
||||
JsInSsjThread jsInSsjThread1 = new JsInSsjThread();
|
||||
jsInSsjThread = new CustomThread<JsInSsjThread>(new Thread(jsInSsjThread1), jsInSsjThread1);
|
||||
@@ -72,7 +71,7 @@ public class ScheduleThread {
|
||||
jsPickSsjThread = new CustomThread<JsPickSsjTread>(new Thread(jsPickSsjTread1), jsPickSsjTread1);
|
||||
|
||||
SsjMonitorThread ssjMonitorThread1 = new SsjMonitorThread();
|
||||
ssjMonitorThread = new CustomThread<SsjMonitorThread>(new Thread(ssjMonitorThread1), ssjMonitorThread1);
|
||||
ssjMonitorThread = new CustomThread<SsjMonitorThread>(new Thread(ssjMonitorThread1), ssjMonitorThread1);*/
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,8 +88,10 @@ public class ScheduleThread {
|
||||
list.put(deviceSsj.getDeviceCode(), deviceSsj);
|
||||
}
|
||||
|
||||
ConcurrentHashMap<String, MsgDdj> list2 = new ConcurrentHashMap<>();
|
||||
|
||||
//plc读取线程
|
||||
PlcRead plcRead = new PlcRead(list, ssjPlcConnectInfo);
|
||||
PlcRead plcRead = new PlcRead(list,list2, ssjPlcConnectInfo);
|
||||
Thread plcReadThread = new Thread(plcRead);
|
||||
customThread = new CustomThread<PlcRead>(plcReadThread, plcRead);
|
||||
}
|
||||
@@ -107,7 +108,7 @@ public class ScheduleThread {
|
||||
* 开启线程2
|
||||
*/
|
||||
public void startAllThread2() {
|
||||
//臂式入库线程调度
|
||||
/* //臂式入库线程调度
|
||||
bsInSsjThread.getThread().start();
|
||||
//臂式出库线程调度
|
||||
bsOutSsjThread.getThread().start();
|
||||
@@ -121,7 +122,7 @@ public class ScheduleThread {
|
||||
//剪上出库到位线程调度-wms电子屏交互
|
||||
//jsPickSsjThread.getThread().start();
|
||||
//监控输送机
|
||||
//ssjMonitorThread.getThread().start();
|
||||
//ssjMonitorThread.getThread().start();*/
|
||||
|
||||
isRun2 = true;
|
||||
}
|
||||
@@ -139,12 +140,12 @@ public class ScheduleThread {
|
||||
* 停止线程2
|
||||
*/
|
||||
public void stopAllThread2() {
|
||||
bsInSsjThread.runnable.isRun = false;
|
||||
/*bsInSsjThread.runnable.isRun = false;
|
||||
jsInSsjThread.runnable.isRun = false;
|
||||
bsOutSsjThread.runnable.isRun = false;
|
||||
jsOutSsjThread.runnable.isRun = false;
|
||||
bsPickSsjThread.runnable.isRun = false;
|
||||
jsPickSsjThread.runnable.isRun = false;
|
||||
jsPickSsjThread.runnable.isRun = false;*/
|
||||
scheduleInit();
|
||||
isRun2 = false;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package com.ruoyi.device.operation.controller;
|
||||
package com.ruoyi.schedule;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.schedule.ScheduleThread;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.ruoyi.schedule.plcRead.ddj;
|
||||
|
||||
public class IsoTcpClientDDJ1 extends Thread {
|
||||
|
||||
|
||||
/// <20>Ѷ<EFBFBD><D1B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD>
|
||||
public static int WritetoDDJ(String address, byte[] tsak) {
|
||||
/*int a = 0;
|
||||
if (readWriteNet != null) {
|
||||
a = HslRead.WriteResultRender(readWriteNet.Write(address, tsak), address);
|
||||
}
|
||||
return a;*/
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import HslCommunication.Core.Types.OperateResult;
|
||||
import HslCommunication.Core.Types.OperateResultExOne;
|
||||
import HslCommunication.Profinet.Siemens.SiemensPLCS;
|
||||
import HslCommunication.Profinet.Siemens.SiemensS7Net;
|
||||
import com.ruoyi.device.ddj.domain.MsgDdj;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.schedule.plcRead.ssj.domain.HslRead;
|
||||
import com.ruoyi.schedule.plcRead.ssj.domain.PlcConnectInfo;
|
||||
@@ -18,7 +19,8 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
@Slf4j
|
||||
public class PlcRead implements Runnable {
|
||||
|
||||
public static ConcurrentHashMap<String, DeviceSsj> deviceMap;
|
||||
public static ConcurrentHashMap<String, DeviceSsj> deviceSsjMap;
|
||||
public static ConcurrentHashMap<String, MsgDdj> deviceDdjMap;
|
||||
public volatile boolean isRun = true;
|
||||
|
||||
public SiemensS7Net siemensS7Net = null;
|
||||
@@ -27,8 +29,9 @@ public class PlcRead implements Runnable {
|
||||
private int port;
|
||||
private boolean success = false;
|
||||
|
||||
public PlcRead(ConcurrentHashMap<String, DeviceSsj> deviceMap, PlcConnectInfo plcConnectInfo) {
|
||||
this.deviceMap = deviceMap;
|
||||
public PlcRead(ConcurrentHashMap<String, DeviceSsj> deviceMap1,ConcurrentHashMap<String, MsgDdj> deviceMap2, PlcConnectInfo plcConnectInfo) {
|
||||
this.deviceSsjMap = deviceMap1;
|
||||
this.deviceDdjMap = deviceMap2;
|
||||
this.ip = plcConnectInfo.getIp();
|
||||
this.port = plcConnectInfo.getPort();
|
||||
}
|
||||
@@ -48,8 +51,8 @@ public class PlcRead implements Runnable {
|
||||
if (IsConnect()) {
|
||||
int step = 20;
|
||||
int baseOffset = 0;
|
||||
for (String ssjCode : deviceMap.keySet()) {
|
||||
DeviceSsj ssjDevice = deviceMap.get(ssjCode);
|
||||
for (String ssjCode : deviceSsjMap.keySet()) {
|
||||
DeviceSsj ssjDevice = deviceSsjMap.get(ssjCode);
|
||||
switch (ssjDevice.getType()) {
|
||||
case "1":
|
||||
readPlcOutSsj(ssjDevice);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.ruoyi.schedule.plcRead.util;
|
||||
|
||||
import HslCommunication.BasicFramework.SoftBasic;
|
||||
import com.ruoyi.schedule.plcRead.ssj.domain.SendData;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -10,7 +9,7 @@ import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>:cyc16У<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
* 描述:cyc16校验码
|
||||
*
|
||||
* @author zhu
|
||||
*/
|
||||
@@ -26,31 +25,31 @@ public class Tools implements Serializable {
|
||||
System.out.println(jym);
|
||||
}
|
||||
|
||||
/*4<EFBFBD><EFBFBD>CRC-16У<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㷽<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD>ò<EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD>㷨<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㷽<EFBFBD><EFBFBD>һ<EFBFBD>㶼<EFBFBD>ǣ<EFBFBD>
|
||||
<EFBFBD><EFBFBD>1<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>16λ<EFBFBD>ļĴ<EFBFBD><EFBFBD><EFBFBD>Ϊʮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>FFFF<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȫΪ1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƴ˼Ĵ<EFBFBD><EFBFBD><EFBFBD>ΪCRC<EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD>2<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѵ<EFBFBD>һ<EFBFBD><EFBFBD>8λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><EFBFBD><EFBFBD>ͨѶ<EFBFBD><EFBFBD>Ϣ֡<EFBFBD>ĵ<EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>ֽڣ<EFBFBD><EFBFBD><EFBFBD>16λ<EFBFBD><EFBFBD>CRC<EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>
|
||||
8λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>CRC<EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߰<EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD>ݲ<EFBFBD><EFBFBD>䣻
|
||||
<EFBFBD><EFBFBD>3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>CRC<EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һλ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƺ<EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD>λ<EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD>4<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD>λΪ0<EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><EFBFBD><EFBFBD>3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һλ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD>λΪ1<EFBFBD><EFBFBD>CRC<EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD>ʽA001<EFBFBD><EFBFBD>1010 0000 0000 0001<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD>5<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>3<EFBFBD><EFBFBD>4<EFBFBD><EFBFBD>ֱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<EFBFBD>Σ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD>6<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>5<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨѶ<EFBFBD><EFBFBD>Ϣ֡<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>ֽڵĴ<EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD>7<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨѶ<EFBFBD><EFBFBD>Ϣ֡<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֽڰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɺõ<EFBFBD><EFBFBD><EFBFBD>16λCRC<EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĸߡ<EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD>ֽڽ<EFBFBD><EFBFBD>н<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD>8<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><EFBFBD><EFBFBD>CRC<EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD>Ϊ<EFBFBD><EFBFBD>CRC<EFBFBD>롣
|
||||
<EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><EFBFBD>㲽<EFBFBD><EFBFBD><EFBFBD>еĶ<EFBFBD><EFBFBD><EFBFBD>ʽA001<EFBFBD><EFBFBD>8005<EFBFBD><EFBFBD>λ<EFBFBD>ߵ<EFBFBD><EFBFBD><EFBFBD>Ľ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD>0~256<35><36><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ16λ<36>ļĴ<C4BC><C4B4><EFBFBD><EFBFBD>еĵͰ<C4B5>λ<EFBFBD><CEBB><EFBFBD>߰<EFBFBD>λ<EFBFBD><CEBB><EFBFBD>0<EFBFBD><30>Ȼ<EFBFBD>üĴ<C3BC><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ0XA001<30><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>3<EFBFBD><33>4<EFBFBD><34><EFBFBD>裬ֱ<E8A3AC><D6B1><EFBFBD><EFBFBD>λȫ<CEBB><C8AB><EFBFBD>Ƴ<EFBFBD><C6B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD>е<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD>DZ<EFBFBD><C7B1><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3>߰<EFBFBD>λ<EFBFBD><CEBB><EFBFBD>Ͱ<EFBFBD>λ<EFBFBD>ֱ<D6B1>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>*/
|
||||
/*4、CRC-16校验码计算方法:
|
||||
常用查表法和计算法。计算方法一般都是:
|
||||
(1)、预置1个16位的寄存器为十六进制FFFF(即全为1),称此寄存器为CRC寄存器;
|
||||
(2)、把第一个8位二进制数据(既通讯信息帧的第一个字节)与16位的CRC寄存器的低
|
||||
8位相异或,把结果放于CRC寄存器,高八位数据不变;
|
||||
(3)、把CRC寄存器的内容右移一位(朝低位)用0填补最高位,并检查右移后的移出位;
|
||||
(4)、如果移出位为0:重复第3步(再次右移一位);如果移出位为1,CRC寄存器与多
|
||||
项式A001(1010 0000 0000 0001)进行异或;
|
||||
(5)、重复步骤3和4,直到右移8次,这样整个8位数据全部进行了处理;
|
||||
(6)、重复步骤2到步骤5,进行通讯信息帧下一个字节的处理;
|
||||
(7)、将该通讯信息帧所有字节按上述步骤计算完成后,得到的16位CRC寄存器的高、低
|
||||
字节进行交换;
|
||||
(8)、最后得到的CRC寄存器内容即为:CRC码。
|
||||
以上计算步骤中的多项式A001是8005按位颠倒后的结果。
|
||||
查表法是将移位异或的计算结果做成了一个表,就是将0~256放入一个长度为16位的寄存器中的低八位,高八位填充0,然后将该寄存器与多项式0XA001按照上述3、4步骤,直到八位全部移出,最后寄存器中的值就是表格中的数据,高八位、低八位分别单独一个表。*/
|
||||
|
||||
|
||||
/**
|
||||
* ȫ<EFBFBD><EFBFBD>У<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ
|
||||
* 全部校验码可用这个获取
|
||||
*
|
||||
* @param ints <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
* @return <EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>int
|
||||
* @param ints 传入的校验码
|
||||
* @return 返回的int
|
||||
*/
|
||||
public static int getJYM(int... ints) {
|
||||
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>תΪ32λ<EFBFBD><EFBFBD><EFBFBD>ܺ<EFBFBD>תΪ<EFBFBD>ĸ<EFBFBD><EFBFBD>ֽڣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>תΪ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>4
|
||||
//将整形任务号转为32位,能后转为四个字节,最后转为整形组4
|
||||
int[] ints1 = new int[ints.length * 4];
|
||||
for (int i = 0; i < ints.length; i++) {
|
||||
int[] son;
|
||||
@@ -69,13 +68,13 @@ public class Tools implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param hex <EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
|
||||
* @return a <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
* @param hex 字符串
|
||||
* @return a 整型
|
||||
*/
|
||||
public static int[] binaryTints(String hex) {
|
||||
int[] a = new int[4];
|
||||
String hexString = change32(hex);
|
||||
a[0] = Integer.parseInt(hexString.substring(0, 8), 2);//<EFBFBD><EFBFBD>
|
||||
a[0] = Integer.parseInt(hexString.substring(0, 8), 2);//将
|
||||
a[1] = Integer.parseInt(hexString.substring(8, 16), 2);
|
||||
a[2] = Integer.parseInt(hexString.substring(16, 24), 2);
|
||||
a[3] = Integer.parseInt(hexString.substring(24, 32), 2);
|
||||
@@ -85,7 +84,7 @@ public class Tools implements Serializable {
|
||||
public static int[] binaryTints16(String hex) {
|
||||
int[] a = new int[2];
|
||||
String hexString = change16(hex);
|
||||
a[0] = Integer.parseInt(hexString.substring(0, 8), 2);//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>תΪ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
a[0] = Integer.parseInt(hexString.substring(0, 8), 2);//将二进制字符串转为整形
|
||||
a[1] = Integer.parseInt(hexString.substring(8, 16), 2);
|
||||
return a;
|
||||
}
|
||||
@@ -93,7 +92,7 @@ public class Tools implements Serializable {
|
||||
public static int binaryTints8(String hex) {
|
||||
int a;
|
||||
String hexString = change8(hex);
|
||||
a = Integer.parseInt(hexString.substring(0, 8), 2);//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>תΪ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
a = Integer.parseInt(hexString.substring(0, 8), 2);//将二进制字符串转为整形
|
||||
return a;
|
||||
}
|
||||
|
||||
@@ -110,21 +109,21 @@ public class Tools implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>תΪ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
* 将字符转为整形
|
||||
**/
|
||||
public static int showAscii(char x) {
|
||||
return x;
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>תΪ<EFBFBD>ַ<EFBFBD>
|
||||
* 将整形转为字符
|
||||
**/
|
||||
public static char showChar(int x) {
|
||||
return (char) x;
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
* 托盘条码解析
|
||||
**/
|
||||
public static String byteToStringTool(byte[] aaa) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
@@ -136,21 +135,21 @@ public class Tools implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>תΪ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
|
||||
* 将整形转为二进制字符串
|
||||
*/
|
||||
public static String printBits(int n) {
|
||||
return Integer.toBinaryString(n);
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>תΪ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
* 将整形转为浮点型
|
||||
*/
|
||||
public static Float printFloat(int n) {
|
||||
return Float.intBitsToFloat(n);
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>8λ<EFBFBD>Ӹ<EFBFBD>λ<EFBFBD><EFBFBD>0
|
||||
* 不满8位加高位加0
|
||||
**/
|
||||
public static String change8(String value) {
|
||||
if (value != null && !value.equals("")) {
|
||||
@@ -165,7 +164,7 @@ public class Tools implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>32λ<EFBFBD>Ӹ<EFBFBD>λ<EFBFBD><EFBFBD>0 4<><34><EFBFBD>ֽ<EFBFBD>
|
||||
* 不满32位加高位加0 4个字节
|
||||
**/
|
||||
public static String change32(String value) {
|
||||
if (value != null && !value.equals("")) {
|
||||
@@ -180,7 +179,7 @@ public class Tools implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>16λ<EFBFBD>Ӹ<EFBFBD>λ<EFBFBD><EFBFBD>0 4<><34><EFBFBD>ֽ<EFBFBD>
|
||||
* 不满16位加高位加0 4个字节
|
||||
**/
|
||||
public static String change16(String value) {
|
||||
if (value != null && !value.equals("")) {
|
||||
@@ -195,7 +194,7 @@ public class Tools implements Serializable {
|
||||
}
|
||||
|
||||
|
||||
///<EFBFBD>ֽ<EFBFBD>ת<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
///字节转整型
|
||||
public static int get(byte a1, byte a2, byte a3, byte a4, byte a5, byte a6, byte a7, byte a8,
|
||||
byte a9, byte a10, byte a11, byte a12, byte a13, byte a14, byte a15, byte a16,
|
||||
byte a17, byte a18, byte a19, byte a20, byte a21, byte a22, byte a23, byte a24, byte a25) {
|
||||
@@ -225,7 +224,9 @@ public class Tools implements Serializable {
|
||||
ints[22] = binaryTints8(printBits(a23));
|
||||
ints[23] = binaryTints8(printBits(a24));
|
||||
ints[24] = binaryTints8(printBits(a25));
|
||||
for (int anInt : ints) System.out.print(anInt + " ");
|
||||
for (int anInt : ints) {
|
||||
System.out.print(anInt + " ");
|
||||
}
|
||||
System.out.println();
|
||||
return BytesToInt(ints);
|
||||
}
|
||||
@@ -233,18 +234,18 @@ public class Tools implements Serializable {
|
||||
|
||||
|
||||
//
|
||||
public static byte[] int2byte(int res) {///Java<EFBFBD><EFBFBD>10<EFBFBD><EFBFBD><EFBFBD><EFBFBD>תbyte[]
|
||||
public static byte[] int2byte(int res) {///Java中10进制转byte[]
|
||||
byte[] targets = new byte[4];
|
||||
|
||||
targets[3] = (byte) (res & 0xff);// <EFBFBD><EFBFBD><EFBFBD>λ
|
||||
targets[2] = (byte) ((res >> 8) & 0xff);// <EFBFBD>ε<EFBFBD>λ
|
||||
targets[1] = (byte) ((res >> 16) & 0xff);// <EFBFBD>θ<EFBFBD>λ
|
||||
targets[0] = (byte) (res >>> 24);// <EFBFBD><EFBFBD><EFBFBD>λ,<2C><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ơ<EFBFBD>
|
||||
targets[3] = (byte) (res & 0xff);// 最低位
|
||||
targets[2] = (byte) ((res >> 8) & 0xff);// 次低位
|
||||
targets[1] = (byte) ((res >> 16) & 0xff);// 次高位
|
||||
targets[0] = (byte) (res >>> 24);// 最高位,无符号右移。
|
||||
return targets;
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD><EFBFBD>byte <EFBFBD>ϲ<EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>byte
|
||||
* 多个byte 合并成一个byte
|
||||
*/
|
||||
public static byte[] byteMerge(byte[]... values) {
|
||||
int length_byte = 0;
|
||||
@@ -264,18 +265,20 @@ public class Tools implements Serializable {
|
||||
public static String bytetostringtool(byte[] aaa) {
|
||||
String tptm = "";
|
||||
for(int i=0;i<aaa.length;i++){
|
||||
//System.out.println("??????:for:"+aaa[i]);
|
||||
String x = Character.toString(showChar(aaa[i]));
|
||||
char ddd=showChar(aaa[i]);
|
||||
tptm=tptm+x;
|
||||
//System.out.println(tptm);
|
||||
}
|
||||
if(tptm.isEmpty() || "\u0000\u0000\u0000\u0000\u0000\u0000\u0000".equals(tptm)){
|
||||
return "";
|
||||
if(tptm.length() == 0 || tptm.equals("")){
|
||||
return "00000000";
|
||||
}else {
|
||||
return tptm;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* int תbyte
|
||||
* int 转byte
|
||||
*/
|
||||
public static byte[] intToBytes(int value, int len) {
|
||||
byte[] b = new byte[len];
|
||||
@@ -287,7 +290,7 @@ public class Tools implements Serializable {
|
||||
|
||||
|
||||
|
||||
//<EFBFBD>·<EFBFBD><EFBFBD>ֽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//下发字节数组
|
||||
public static byte[] sendDataToDevice(long taskNo,String trayCode, int...ints){
|
||||
int length = 0;
|
||||
byte[] xfData = null;
|
||||
@@ -343,58 +346,34 @@ public class Tools implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD>ֽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
|
||||
* 字节数组转字符船
|
||||
*/
|
||||
public static String byteToString(String substring) {
|
||||
return new String(SoftBasic.HexStringToBytes(substring), StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static String getDate() {
|
||||
Date t = new Date();
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
return df.format(t);
|
||||
}
|
||||
|
||||
//int ת2<EFBFBD>ֽ<EFBFBD>
|
||||
public static byte[] intbyte(int res) {///Java<EFBFBD><EFBFBD>10<EFBFBD><EFBFBD><EFBFBD><EFBFBD>תbyte[]
|
||||
//int 转2字节
|
||||
public static byte[] intbyte(int res) {///Java中10进制转byte[]
|
||||
byte[] targets = new byte[2];
|
||||
targets[1] = (byte) ((res >> 0) & 0xff);// <EFBFBD>θ<EFBFBD>λ
|
||||
targets[0] = (byte) (res >>> 8);// <EFBFBD><EFBFBD><EFBFBD>λ,<2C><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ơ<EFBFBD>
|
||||
targets[1] = (byte) ((res >> 0) & 0xff);// 次高位
|
||||
targets[0] = (byte) (res >>> 8);// 最高位,无符号右移。
|
||||
return targets;
|
||||
}
|
||||
|
||||
public static int[] binarysToints(String hex){
|
||||
int[] a = new int[4];
|
||||
String hexString = change32(hex);
|
||||
a[0] = Integer.parseInt(hexString.substring(0,8),2);//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>תΪ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
a[0] = Integer.parseInt(hexString.substring(0,8),2);//将二进制字符串转为整形
|
||||
a[1] = Integer.parseInt(hexString.substring(8,16),2);
|
||||
a[2] = Integer.parseInt(hexString.substring(16,24),2);
|
||||
a[3] = Integer.parseInt(hexString.substring(24,32),2);
|
||||
return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* 下发到PLC的反馈字节
|
||||
*/
|
||||
public static byte[] sendData(SendData... list) {
|
||||
byte[][] values = new byte[list.length][0];
|
||||
for (int i = 0; i < list.length; i++) {
|
||||
byte[] bytes = Tools.intToBytes(list[i].getNum2(), list[i].getNum());
|
||||
//System.out.println(bytes.length);
|
||||
values[i] = bytes;
|
||||
}
|
||||
int length_byte = 0;
|
||||
for (byte[] value : values) {
|
||||
length_byte += value.length;
|
||||
}
|
||||
byte[] all_byte = new byte[length_byte];
|
||||
int countLength = 0;
|
||||
for (byte[] b : values) {
|
||||
System.arraycopy(b, 0, all_byte, countLength, b.length);
|
||||
countLength += b.length;
|
||||
}
|
||||
return all_byte;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,256 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ddj;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.ddj.domain.MsgDdj;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.job.service.IMydoJobService;
|
||||
import com.ruoyi.queue.ddj.domain.DdjDeviceExecutionQueue;
|
||||
import com.ruoyi.queue.ddj.service.IDdjDeviceExecutionQueueFinishService;
|
||||
import com.ruoyi.queue.ddj.service.IDdjDeviceExecutionQueueService;
|
||||
import com.ruoyi.schedule.plcRead.ddj.IsoTcpClientDDJ1;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcRead;
|
||||
import com.ruoyi.schedule.plcRead.util.Tools;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Slf4j
|
||||
public class Ddj1Thread implements Runnable {
|
||||
|
||||
public HashMap<String, List<String>> ddjCodeList;
|
||||
|
||||
private IApiService apiService;
|
||||
private IDdjDeviceExecutionQueueService ddjDeviceExecutionQueueService;
|
||||
private IDdjDeviceExecutionQueueFinishService ddjDeviceExecutionQueueFinishService;
|
||||
private IMydoJobService mydoJobService;
|
||||
|
||||
public boolean isRun = true;
|
||||
|
||||
|
||||
public void init() {
|
||||
//todo 获取设备编码列表
|
||||
ddjCodeList = new HashMap<>();
|
||||
ArrayList<String> ddjCodes = new ArrayList<>();
|
||||
ddjCodes.add("ddj1");
|
||||
ddjCodes.add("ddj2");
|
||||
ddjCodeList.put("ddj", ddjCodes);
|
||||
|
||||
apiService = SpringUtils.getBean(IApiService.class);
|
||||
ddjDeviceExecutionQueueService = SpringUtils.getBean(IDdjDeviceExecutionQueueService.class);
|
||||
ddjDeviceExecutionQueueFinishService = SpringUtils.getBean(IDdjDeviceExecutionQueueFinishService.class);
|
||||
log.info("初始化服务 {},{},{}", apiService, ddjDeviceExecutionQueueService, ddjDeviceExecutionQueueFinishService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
init();
|
||||
while (isRun) {
|
||||
for (String type : ddjCodeList.keySet()) {
|
||||
|
||||
if ("ddj".equals(type)) {
|
||||
for (String ddjCode : ddjCodeList.get(type)) {
|
||||
try {
|
||||
if (PlcRead.deviceDdjMap.containsKey(ddjCode)) {
|
||||
ddjTask(PlcRead.deviceDdjMap.get(ddjCode));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", ddjCode);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void ddjTask(MsgDdj ddj) {
|
||||
/*
|
||||
第一部分
|
||||
堆垛机线程进来后第一件事先进行堆垛机正执行任务的账务处理
|
||||
以防存在漏处理,没处理的情况发生
|
||||
*/
|
||||
if (ddj.getCzfs() == 5 && ddj.getSbzt() == 0 && ddj.getJdbz() == 5) {
|
||||
Long rwh = ddj.getRwh();
|
||||
//完成作业
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh);
|
||||
if (mydoJob != null && ddjDeviceExecutionQueue != null) {
|
||||
//回传完成信号
|
||||
ddjTaskFinish(rwh, ddj.getId());
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
第二部分
|
||||
跟踪队列执行阶段
|
||||
*/
|
||||
if (ddj.getCzfs() == 5 && ddj.getSbzt() == 1 && (ddj.getJdbz() == 2 || ddj.getJdbz() == 3 || ddj.getJdbz() == 4)) {
|
||||
//根据堆垛机上任务号,修改任务执行阶段
|
||||
Long rwh = ddj.getRwh();
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh);
|
||||
if (ddjDeviceExecutionQueue != null) {
|
||||
//修改队列执行阶段
|
||||
ddjDeviceExecutionQueue.setRwzt(ddj.getJdbz());
|
||||
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
第三部分
|
||||
放货有货,重新分配货位
|
||||
*/
|
||||
if (ddj.getCzfs() == 5 && ddj.getSbzt() == 1052 && ddj.getJdbz() < 5 && ddj.getYxxf() == 1) {
|
||||
//判断堆垛机上任务是否已重分,若未重分,则调用接口,请求重分货位
|
||||
Long rwh = ddj.getRwh();
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
||||
if ("0".equals(mydoJob.getFaultFlag())){
|
||||
mydoJob.setStatus("1");
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
AjaxResult ajaxResult = apiService.reAssignMydoJob(new JobParam(rwh.toString(), null, null));
|
||||
if (ajaxResult.isSuccess()){
|
||||
mydoJob.setStatus("2");
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
第四部分
|
||||
取货无货,重新分配单据
|
||||
*/
|
||||
if (ddj.getCzfs() == 5 && ddj.getSbzt() == 1053 && ddj.getJdbz() < 5) {
|
||||
Long rwh = ddj.getRwh();
|
||||
//无货异常处理
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh);
|
||||
//找到对应任务 调用api接口 取货无货,重新分配单据
|
||||
if (ObjUtil.isNotNull(ddjDeviceExecutionQueue)) {
|
||||
AjaxResult ajaxResult = apiService.reAssignMydoJob2(new JobParam(rwh.toString(), null, null));
|
||||
if (ajaxResult.isSuccess()) {
|
||||
//作废作业
|
||||
InvalidMydoJob(rwh, ddj.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
第五部分
|
||||
堆垛机任务下发
|
||||
*/
|
||||
if (ddj.getYxxf() == 1 && ddj.getCzfs() == 5 && ddj.getSbzt() == 1052) {
|
||||
Long rwh = ddj.getRwh();
|
||||
//查询作业
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
||||
if (ObjUtil.isNotNull(mydoJob) && "2".equals(mydoJob.getFaultFlag())) {
|
||||
//判断任务是否重分完成
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh);
|
||||
if (ObjUtil.isNotNull(ddjDeviceExecutionQueue)) {
|
||||
//重新下发堆垛机任务
|
||||
int i = issuedDDJTask(ddj.getId(), ddjDeviceExecutionQueue);
|
||||
if (i == 1) {
|
||||
//更新开始时间,修改ddjxf为已下发1
|
||||
ddjDeviceExecutionQueue.setXfsj(DateUtil.formatDateTime(DateUtil.date()));
|
||||
ddjDeviceExecutionQueue.setDdjxf("1");
|
||||
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
mydoJob.setFaultFlag("0");
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
log.info("托盘堆垛机重新下发任务成功 rwh:{}", rwh);
|
||||
} else {
|
||||
log.error("托盘堆垛机重新下发任务失败!!!!!!!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//正常下发
|
||||
if (ddj.getYxxf() == 1 && ddj.getCzfs() == 5 && ddj.getSbzt() == 0) {
|
||||
Long rwh = ddj.getRwh();
|
||||
//对堆垛机执行队列中无已下发队列
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueueParam = new DdjDeviceExecutionQueue();
|
||||
ddjDeviceExecutionQueueParam.setDdjxf("1");
|
||||
ddjDeviceExecutionQueueParam.setDevId(ddj.getId());
|
||||
List<DdjDeviceExecutionQueue> ddjDeviceExecutionQueues = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueList(ddjDeviceExecutionQueueParam);
|
||||
//取堆垛机队列中,生成时间最早的执行队列下发
|
||||
if (CollUtil.isEmpty(ddjDeviceExecutionQueues)) {
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueues.get(0);
|
||||
if (ddjDeviceExecutionQueue == null) {
|
||||
return;
|
||||
}
|
||||
int i = issuedDDJTask(ddj.getId(), ddjDeviceExecutionQueue);
|
||||
if (i == 1) {
|
||||
//更新开始时间,修改ddjxf为已下发1
|
||||
ddjDeviceExecutionQueue.setXfsj(DateUtil.formatDateTime(DateUtil.date()));
|
||||
ddjDeviceExecutionQueue.setDdjxf("1");
|
||||
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
log.info("托盘堆垛机下发任务成功 rwh:{}", rwh);
|
||||
} else {
|
||||
log.error("托盘堆垛机下发任务失败!!!!!!!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 作废作业
|
||||
*
|
||||
* @param rwh 作业单号
|
||||
* @param id 作业单id
|
||||
*/
|
||||
private void InvalidMydoJob(Long rwh, Long id) {
|
||||
mydoJobService.InvalidMydoJob(rwh, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 堆垛机任务完成
|
||||
*
|
||||
* @param rwh 作业单号
|
||||
* @param id 作业单id
|
||||
*/
|
||||
private void ddjTaskFinish(Long rwh, Long id) {
|
||||
mydoJobService.ddjTaskFinish(rwh, id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 给堆垛机下发任务
|
||||
*
|
||||
* @param queue 堆垛机执行的队列
|
||||
*/
|
||||
private int issuedDDJTask(Long devId, DdjDeviceExecutionQueue queue) {
|
||||
int taskNo = Convert.toInt(queue.getRwh());
|
||||
int yph = Convert.toInt(queue.getYph());
|
||||
int ylh = Convert.toInt(queue.getYlh());
|
||||
int ych = Convert.toInt(queue.getYch());
|
||||
int mbph = Convert.toInt(queue.getMbph());
|
||||
int mblh = Convert.toInt(queue.getMblh());
|
||||
int mbch = Convert.toInt(queue.getMbch());
|
||||
int mlfs = 5;
|
||||
int xfwc = 1;
|
||||
int jym = Tools.getJYM(taskNo, yph, ylh, ych, mbph, mblh, mbch, mlfs, xfwc);
|
||||
byte[] sendData = Tools.sendDataToDevice(taskNo, null, yph, ylh, ych, mbph, mblh, mbch, mlfs, xfwc, jym);
|
||||
if (devId==1){
|
||||
return IsoTcpClientDDJ1.WritetoDDJ("DB61.0", sendData);
|
||||
}else {
|
||||
return IsoTcpClientDDJ1.WritetoDDJ("DB61.0", sendData);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.js;
|
||||
package com.ruoyi.schedule.scheduleTask.ddj;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskResponse;
|
||||
import com.ruoyi.api.domain.wcs2wms.MydoJob;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.agv.domain.AgvQueue;
|
||||
import com.ruoyi.device.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcRead;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -19,7 +19,7 @@ import java.util.List;
|
||||
|
||||
|
||||
@Slf4j
|
||||
public class JsInSsjThread implements Runnable {
|
||||
public class Ddj2Thread implements Runnable {
|
||||
|
||||
public HashMap<String, List<String>> ssjCodeList;
|
||||
|
||||
@@ -58,8 +58,8 @@ public class JsInSsjThread implements Runnable {
|
||||
//正常入库 尾箱回流 物料入库 空料箱入库
|
||||
for (String ssjCode : ssjCodeList.get(type)) {
|
||||
try {
|
||||
if (PlcRead.deviceMap.containsKey(ssjCode)) {
|
||||
inDispatch(PlcRead.deviceMap.get(ssjCode));
|
||||
if (PlcRead.deviceSsjMap.containsKey(ssjCode)) {
|
||||
inDispatch(PlcRead.deviceSsjMap.get(ssjCode));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", ssjCode);
|
||||
}
|
||||
@@ -1,148 +0,0 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.bs;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.bas.fluent.domain.BasFluentFrame;
|
||||
import com.ruoyi.bas.fluent.service.IBasFluentFrameService;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.agv.domain.AgvQueue;
|
||||
import com.ruoyi.device.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskRequest;
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskResponse;
|
||||
import com.ruoyi.api.domain.wcs2wms.MydoJob;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcRead;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Slf4j
|
||||
public class BsOutSsjThread implements Runnable {
|
||||
|
||||
public HashMap<String, List<String>> ssjCodeList;
|
||||
|
||||
private IApiService apiService;
|
||||
private IAgvQueueService agvQueueService;
|
||||
private IBasFluentFrameService basFluentFrameService;
|
||||
|
||||
public boolean isRun = true;
|
||||
|
||||
|
||||
public void init() {
|
||||
ssjCodeList = new HashMap<>();
|
||||
ArrayList<String> ssjCodes = new ArrayList<>();
|
||||
ssjCodes.add("G1004");
|
||||
ssjCodes.add("G1010");
|
||||
ssjCodeList.put("ssjOut", ssjCodes);
|
||||
ArrayList<String> fluentOut = new ArrayList<>();
|
||||
fluentOut.add("fluent1");
|
||||
fluentOut.add("fluent2");
|
||||
ssjCodeList.put("fluentOut", fluentOut);
|
||||
|
||||
apiService = SpringUtils.getBean(IApiService.class);
|
||||
agvQueueService = SpringUtils.getBean(IAgvQueueService.class);
|
||||
basFluentFrameService = SpringUtils.getBean(IBasFluentFrameService.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
init();
|
||||
while (isRun){
|
||||
for (String type : ssjCodeList.keySet()) {
|
||||
switch (type){
|
||||
case "ssjOut":
|
||||
//正常输送线出口
|
||||
for (String ssjCode : ssjCodeList.get(type)) {
|
||||
try {
|
||||
if (PlcRead.deviceMap.containsKey(ssjCode)) {
|
||||
ssjOutDispatch(PlcRead.deviceMap.get(ssjCode));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", ssjCode);
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case "fluentOut":
|
||||
//流利架出口
|
||||
for (String ssjCode : ssjCodeList.get(type)) {
|
||||
try {
|
||||
fluentOutDispatch(ssjCode);
|
||||
}catch (Exception e){
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 输送线出口
|
||||
* @param outSsjDevice
|
||||
*/
|
||||
public void ssjOutDispatch(DeviceSsj outSsjDevice) {
|
||||
//输送线出库
|
||||
if (outSsjDevice.getKx()==1){
|
||||
//查询对应的作业
|
||||
AgvQueue agvQueue = new AgvQueue();
|
||||
agvQueue.setPositionCode2(outSsjDevice.getDeviceCode());
|
||||
agvQueue.setStatus("0");
|
||||
List<AgvQueue> agvQueueList = agvQueueService.selectAgvQueueList(agvQueue);
|
||||
if (CollUtil.isNotEmpty(agvQueueList)){
|
||||
for (AgvQueue queue : agvQueueList) {
|
||||
apiService.requestAgvQueue(queue);
|
||||
agvQueue.setStatus("1");
|
||||
agvQueueService.updateAgvQueue(queue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* todo 流利架出口
|
||||
* @param outSsjDevice
|
||||
*/
|
||||
public void fluentOutDispatch(String outSsjDevice) {
|
||||
//查询对应的作业
|
||||
AgvQueue agvQueue = new AgvQueue();
|
||||
agvQueue.setPositionCode2(outSsjDevice);
|
||||
agvQueue.setStatus("0");
|
||||
List<AgvQueue> agvQueueList = agvQueueService.selectAgvQueueList(agvQueue);
|
||||
for (AgvQueue queue : agvQueueList) {
|
||||
//修改实际流利架货位
|
||||
BasFluentFrame basFluentFrame = basFluentFrameService.selectBasFluentFrameOrderByAllotNum(queue.getPositionCode2());
|
||||
if (basFluentFrame != null){
|
||||
queue.setPositionCode2(basFluentFrame.getLocationName());
|
||||
agvQueueService.updateAgvQueue(queue);
|
||||
GenAgvSchedulingTaskResponse genAgvSchedulingTaskResponse = apiService.requestAgvQueue(queue);
|
||||
if (genAgvSchedulingTaskResponse.getCode() == 0) {
|
||||
//修改ctu执行状态
|
||||
queue.setStatus("1");
|
||||
agvQueueService.updateAgvQueue(queue);
|
||||
log.info("向CTU下入库库作业");
|
||||
//更新流利架
|
||||
basFluentFrame.setTrayCode(queue.getWmsTraycode());
|
||||
basFluentFrame.setAllotNum(1L);
|
||||
basFluentFrameService.updateBasFluentFrame(basFluentFrame);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.bs;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.api.domain.RequestLog;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.bas.port.domain.WcsPort;
|
||||
import com.ruoyi.bas.port.service.IWcsPortService;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcRead;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.ruoyi.common.Constant.JOB_FINISH_URL;
|
||||
|
||||
|
||||
@Slf4j
|
||||
public class BsPickSsjTread implements Runnable{
|
||||
|
||||
public HashMap<String, List<String>> ssjCodeList;
|
||||
|
||||
private IApiService apiService;
|
||||
private IAgvQueueService agvQueueService;
|
||||
private IWcsPortService wcsPortService;
|
||||
|
||||
public boolean isRun = true;
|
||||
|
||||
|
||||
public void init() {
|
||||
ssjCodeList = new HashMap<>();
|
||||
ArrayList<String> ssjCodes = new ArrayList<>();
|
||||
ssjCodes.add("G1006");
|
||||
ssjCodes.add("G1012");
|
||||
ssjCodeList.put("pick", ssjCodes);
|
||||
|
||||
|
||||
apiService = SpringUtils.getBean(IApiService.class);
|
||||
agvQueueService = SpringUtils.getBean(IAgvQueueService.class);
|
||||
wcsPortService = SpringUtils.getBean(IWcsPortService.class);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
init();
|
||||
while (isRun) {
|
||||
for (String type : ssjCodeList.keySet()) {
|
||||
if ("pick".equals(type)) {
|
||||
for (String ssjCode : ssjCodeList.get(type)) {
|
||||
try {
|
||||
if (PlcRead.deviceMap.containsKey(ssjCode)) {
|
||||
pickDispatch(PlcRead.deviceMap.get(ssjCode));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", ssjCode);
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error(e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void pickDispatch(DeviceSsj pickSsjDevice) {
|
||||
if (pickSsjDevice.getDw() == 1 && pickSsjDevice.getTaskNo() > 0) {
|
||||
WcsPort wcsPortParam = new WcsPort();
|
||||
wcsPortParam.setPortCode(pickSsjDevice.getDeviceCode());
|
||||
wcsPortParam.setPortType("1");
|
||||
List<WcsPort> wcsPorts = wcsPortService.selectWcsPortList(wcsPortParam);
|
||||
if (CollUtil.isNotEmpty(wcsPorts)){
|
||||
WcsPort wcsPort = wcsPorts.get(0);
|
||||
if ("1".equals(wcsPort.getStatus())){
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put("taskNo", pickSsjDevice.getTaskNo());
|
||||
param.put("wmsType", "2");
|
||||
param.put("pickSsj", pickSsjDevice.getDeviceCode());
|
||||
RequestLog requestLog = apiService.finishMydoJob(JOB_FINISH_URL, "出库任务到达拣选口", param);
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
wcsPort.setStatus("2");
|
||||
wcsPortService.updateWcsPort(wcsPort);
|
||||
}else {
|
||||
log.error("任务失败{}", requestLog.getErrorDetails());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (pickSsjDevice.getKx() == 1 && pickSsjDevice.getTaskNo() == 0){
|
||||
WcsPort wcsPortParam = new WcsPort();
|
||||
wcsPortParam.setPortCode(pickSsjDevice.getDeviceCode());
|
||||
wcsPortParam.setPortType("1");
|
||||
List<WcsPort> wcsPorts = wcsPortService.selectWcsPortList(wcsPortParam);
|
||||
if (CollUtil.isNotEmpty(wcsPorts)){
|
||||
WcsPort wcsPort = wcsPorts.get(0);
|
||||
if ("2".equals(wcsPort.getStatus())){
|
||||
wcsPort.setStatus("1");
|
||||
wcsPortService.updateWcsPort(wcsPort);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,33 +1,25 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.bs;
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.floor1;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskRequest;
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskResponse;
|
||||
import com.ruoyi.api.domain.wcs2wms.MydoJob;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.agv.domain.AgvQueue;
|
||||
import com.ruoyi.device.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcRead;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@Slf4j
|
||||
public class BsInSsjThread implements Runnable {
|
||||
public class Floor1SsjInOutThread implements Runnable {
|
||||
|
||||
public HashMap<String, List<String>> ssjCodeList;
|
||||
|
||||
@@ -40,25 +32,15 @@ public class BsInSsjThread implements Runnable {
|
||||
public void init() {
|
||||
//todo 获取设备编码列表
|
||||
ssjCodeList = new HashMap<>();
|
||||
log.info("初始化臂式入库输送机");
|
||||
//入库口
|
||||
ArrayList<String> ssjCodes = new ArrayList<>();
|
||||
ssjCodes.add("G1003");
|
||||
ssjCodes.add("G1009");
|
||||
ssjCodeList.put("ssjIn", ssjCodes);
|
||||
//流利架
|
||||
ArrayList<String> ssjCodes2 = new ArrayList<>();
|
||||
ssjCodes2.add("fluent1-11");
|
||||
ssjCodes2.add("fluent1-12");
|
||||
ssjCodes2.add("fluent1-13");
|
||||
ssjCodes2.add("fluent1-14");
|
||||
ssjCodes2.add("fluent1-15");
|
||||
ssjCodes2.add("fluent2-11");
|
||||
ssjCodes2.add("fluent2-12");
|
||||
ssjCodes2.add("fluent2-13");
|
||||
ssjCodes2.add("fluent2-14");
|
||||
ssjCodes2.add("fluent2-15");
|
||||
ssjCodeList.put("fluentIn", ssjCodes2);
|
||||
ssjCodes.add("G2012");
|
||||
ssjCodes.add("G3009");
|
||||
ssjCodes.add("G3018");
|
||||
ssjCodes.add("G4009");
|
||||
ssjCodes.add("G4018");
|
||||
ssjCodes.add("G5009");
|
||||
ssjCodes.add("G5018");
|
||||
ssjCodeList.put("in", ssjCodes);
|
||||
|
||||
apiService = SpringUtils.getBean(IApiService.class);
|
||||
agvQueueService = SpringUtils.getBean(IAgvQueueService.class);
|
||||
@@ -68,36 +50,24 @@ public class BsInSsjThread implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
init();
|
||||
while (isRun) {
|
||||
while (isRun){
|
||||
for (String type : ssjCodeList.keySet()) {
|
||||
|
||||
switch (type) {
|
||||
case "ssjIn":
|
||||
//正常入库
|
||||
switch ( type){
|
||||
case "in":
|
||||
//正常入库 尾箱回流 物料入库 空料箱入库
|
||||
for (String ssjCode : ssjCodeList.get(type)) {
|
||||
try {
|
||||
if (PlcRead.deviceMap.containsKey(ssjCode)) {
|
||||
inDispatch(PlcRead.deviceMap.get(ssjCode));
|
||||
if (PlcRead.deviceSsjMap.containsKey(ssjCode)) {
|
||||
inDispatch(PlcRead.deviceSsjMap.get(ssjCode));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", ssjCode);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
log.error(e.getMessage(),e);
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case "fluentIn":
|
||||
//流利架 空料箱入库
|
||||
for (String lljCode : ssjCodeList.get(type)) {
|
||||
try {
|
||||
inLljDispatch(lljCode);
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -108,44 +78,9 @@ public class BsInSsjThread implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 流利架空料箱入库
|
||||
*
|
||||
* @param lljCode
|
||||
*/
|
||||
private void inLljDispatch(String lljCode) {
|
||||
|
||||
//判断是否生成队列
|
||||
AgvQueue agvQueueParam = new AgvQueue();
|
||||
agvQueueParam.setPositionCode1(lljCode);
|
||||
agvQueueParam.setStatus("0");
|
||||
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList(agvQueueParam);
|
||||
if (CollUtil.isNotEmpty(agvQueues)) {
|
||||
for (AgvQueue agvQueue : agvQueues) {
|
||||
//请求任务生成
|
||||
GenAgvSchedulingTaskResponse genAgvSchedulingTaskResponse = apiService.requestAgvQueue(agvQueue);
|
||||
//修改wms任务状态
|
||||
if (genAgvSchedulingTaskResponse.getCode() == 0) {
|
||||
//修改ctu执行状态
|
||||
agvQueue.setStatus("1");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
log.info("向CTU下入库库作业");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 输送线入库
|
||||
*
|
||||
* @param inSsjDevice
|
||||
*/
|
||||
public void inDispatch(DeviceSsj inSsjDevice) {
|
||||
//如果入库请求1 并且 托盘码不为空
|
||||
if (inSsjDevice.getDw()==1 && inSsjDevice.getRkqq() == 1 && StrUtil.isNotEmpty(inSsjDevice.getTrayCode())) {
|
||||
@@ -166,7 +101,7 @@ public class BsInSsjThread implements Runnable {
|
||||
//生成agv队列
|
||||
AgvQueue agvQueue = apiService.createAgvQueue(inSsjDevice.getName(), mydoJob.getCargoSpaceId(),mydoJob.getTrayCode(),mydoJob.getTaskNo(),"1");
|
||||
//请求任务生成
|
||||
GenAgvSchedulingTaskResponse genAgvSchedulingTaskResponse = apiService.requestAgvQueue( agvQueue);
|
||||
GenAgvSchedulingTaskResponse genAgvSchedulingTaskResponse = apiService.requestAgvQueue(agvQueue);
|
||||
//修改wms任务状态
|
||||
if (genAgvSchedulingTaskResponse.getCode() == 0) {
|
||||
//修改ctu执行状态
|
||||
@@ -194,7 +129,4 @@ public class BsInSsjThread implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.floor1;
|
||||
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcRead;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Slf4j
|
||||
public class Floor1SsjRoadWayThread implements Runnable {
|
||||
|
||||
public HashMap<String, List<String>> ssjCodeList;
|
||||
|
||||
private IApiService apiService;
|
||||
private IAgvQueueService agvQueueService;
|
||||
|
||||
public boolean isRun = true;
|
||||
|
||||
|
||||
public void init() {
|
||||
//todo 获取设备编码列表
|
||||
ssjCodeList = new HashMap<>();
|
||||
ArrayList<String> in = new ArrayList<>();
|
||||
in.add("L2003");
|
||||
in.add("L2005");
|
||||
ssjCodeList.put("in", in);
|
||||
ArrayList<String> out = new ArrayList<>();
|
||||
in.add("L2003");
|
||||
in.add("L2005");
|
||||
ssjCodeList.put("out", out);
|
||||
|
||||
apiService = SpringUtils.getBean(IApiService.class);
|
||||
agvQueueService = SpringUtils.getBean(IAgvQueueService.class);
|
||||
log.info("初始化服务 {},{}", apiService, agvQueueService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
init();
|
||||
while (isRun) {
|
||||
for (String type : ssjCodeList.keySet()) {
|
||||
|
||||
switch (type) {
|
||||
case "in":
|
||||
//退料入库 其它入库
|
||||
for (String ssjCode : ssjCodeList.get(type)) {
|
||||
try {
|
||||
if (PlcRead.deviceSsjMap.containsKey(ssjCode)) {
|
||||
inDispatch(PlcRead.deviceSsjMap.get(ssjCode));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", ssjCode);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case "out":
|
||||
for (String ssjCode : ssjCodeList.get(type)) {
|
||||
try {
|
||||
if (PlcRead.deviceSsjMap.containsKey(ssjCode)) {
|
||||
outDispatch(PlcRead.deviceSsjMap.get(ssjCode));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", ssjCode);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void outDispatch(DeviceSsj outSsjDevice) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void inDispatch(DeviceSsj inSsjDevice) {
|
||||
//如果入库请求1 并且 托盘码不为空
|
||||
if (inSsjDevice.getDw() == 1 && inSsjDevice.getTaskNo() > 0 && inSsjDevice.getRkqq() == 1) {
|
||||
//查询货位 排列层
|
||||
|
||||
//查询入口 排列层
|
||||
|
||||
//生成堆垛机队列
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.floor2;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskResponse;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcRead;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Slf4j
|
||||
public class Floor2SsjInOutThread implements Runnable {
|
||||
|
||||
public HashMap<String, List<String>> ssjCodeList;
|
||||
|
||||
private IApiService apiService;
|
||||
private IAgvQueueService agvQueueService;
|
||||
|
||||
public boolean isRun = true;
|
||||
|
||||
|
||||
public void init() {
|
||||
//todo 获取设备编码列表
|
||||
ssjCodeList = new HashMap<>();
|
||||
ArrayList<String> ssjCodes = new ArrayList<>();
|
||||
ssjCodes.add("G2012");
|
||||
ssjCodes.add("G3009");
|
||||
ssjCodes.add("G3018");
|
||||
ssjCodes.add("G4009");
|
||||
ssjCodes.add("G4018");
|
||||
ssjCodes.add("G5009");
|
||||
ssjCodes.add("G5018");
|
||||
ssjCodeList.put("in", ssjCodes);
|
||||
|
||||
apiService = SpringUtils.getBean(IApiService.class);
|
||||
agvQueueService = SpringUtils.getBean(IAgvQueueService.class);
|
||||
log.info("初始化服务 {},{}", apiService, agvQueueService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
init();
|
||||
while (isRun){
|
||||
for (String type : ssjCodeList.keySet()) {
|
||||
|
||||
switch ( type){
|
||||
case "in":
|
||||
//正常入库 尾箱回流 物料入库 空料箱入库
|
||||
for (String ssjCode : ssjCodeList.get(type)) {
|
||||
try {
|
||||
if (PlcRead.deviceSsjMap.containsKey(ssjCode)) {
|
||||
inDispatch(PlcRead.deviceSsjMap.get(ssjCode));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", ssjCode);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(),e);
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void inDispatch(DeviceSsj inSsjDevice) {
|
||||
//如果入库请求1 并且 托盘码不为空
|
||||
if (inSsjDevice.getDw()==1 && inSsjDevice.getRkqq() == 1 && StrUtil.isNotEmpty(inSsjDevice.getTrayCode())) {
|
||||
//判断是否生成队列
|
||||
AgvQueue agvQueueParam = new AgvQueue();
|
||||
agvQueueParam.setWmsTraycode(inSsjDevice.getTrayCode());
|
||||
//agvQueueParam.setStatus("0");
|
||||
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList(agvQueueParam);
|
||||
if (CollUtil.isEmpty(agvQueues)) {
|
||||
//根据入口,查询对应的入库作业
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
mydoJobParam.setStatus("1");
|
||||
mydoJobParam.setTrayCode(inSsjDevice.getTrayCode());
|
||||
mydoJobParam.setEntranceId(inSsjDevice.getDeviceCode());
|
||||
MydoJob mydoJob = apiService.requestEnterByTrayCode(mydoJobParam);
|
||||
if (ObjUtil.isNotNull(mydoJob)) {
|
||||
|
||||
//生成agv队列
|
||||
AgvQueue agvQueue = apiService.createAgvQueue(inSsjDevice.getName(), mydoJob.getCargoSpaceId(),mydoJob.getTrayCode(),mydoJob.getTaskNo(),"1");
|
||||
//请求任务生成
|
||||
GenAgvSchedulingTaskResponse genAgvSchedulingTaskResponse = apiService.requestAgvQueue(agvQueue);
|
||||
//修改wms任务状态
|
||||
if (genAgvSchedulingTaskResponse.getCode() == 0) {
|
||||
//修改ctu执行状态
|
||||
agvQueue.setStatus("1");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
log.info("向CTU下入库库作业");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}else {
|
||||
AgvQueue agvQueue = agvQueues.get(0);
|
||||
if ("0".equals(agvQueue.getStatus())){
|
||||
//请求任务生成
|
||||
GenAgvSchedulingTaskResponse genAgvSchedulingTaskResponse = apiService.requestAgvQueue(agvQueue);
|
||||
//修改wms任务状态
|
||||
if (genAgvSchedulingTaskResponse.getCode() == 0) {
|
||||
//修改ctu执行状态
|
||||
agvQueue.setStatus("1");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
log.info("向CTU下入库库作业");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.floor2;
|
||||
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcRead;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Slf4j
|
||||
public class Floor2SsjRoadWayThread implements Runnable {
|
||||
|
||||
public HashMap<String, List<String>> ssjCodeList;
|
||||
|
||||
private IApiService apiService;
|
||||
private IAgvQueueService agvQueueService;
|
||||
|
||||
public boolean isRun = true;
|
||||
|
||||
|
||||
public void init() {
|
||||
ssjCodeList = new HashMap<>();
|
||||
ArrayList<String> ssjCodes = new ArrayList<>();
|
||||
ssjCodes.add("L1002");
|
||||
ssjCodes.add("L1004");
|
||||
ssjCodeList.put("in", ssjCodes);
|
||||
apiService = SpringUtils.getBean(IApiService.class);
|
||||
agvQueueService = SpringUtils.getBean(IAgvQueueService.class);
|
||||
log.info("初始化服务 {},{}", apiService, agvQueueService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
init();
|
||||
while (isRun){
|
||||
for (String type : ssjCodeList.keySet()) {
|
||||
|
||||
switch ( type){
|
||||
case "in":
|
||||
//生产线入库
|
||||
for (String ssjCode : ssjCodeList.get(type)) {
|
||||
try {
|
||||
if (PlcRead.deviceSsjMap.containsKey(ssjCode)) {
|
||||
inDispatch(PlcRead.deviceSsjMap.get(ssjCode));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", ssjCode);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(),e);
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void inDispatch(DeviceSsj inSsjDevice) {
|
||||
//如果入库请求1 并且 托盘码不为空
|
||||
if (inSsjDevice.getDw() == 1 && inSsjDevice.getTaskNo() > 0 && inSsjDevice.getRkqq() == 1) {
|
||||
//查询货位 排列层
|
||||
|
||||
//查询入口 排列层
|
||||
|
||||
//生成堆垛机队列
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,135 +0,0 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.js;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.api.domain.agv.continueTask.ContinueTaskRequest;
|
||||
import com.ruoyi.api.domain.agv.continueTask.ContinueTaskResponse;
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskRequest;
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskResponse;
|
||||
import com.ruoyi.api.domain.wcs2wms.MydoJob;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.agv.domain.AgvQueue;
|
||||
import com.ruoyi.device.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcRead;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Slf4j
|
||||
public class JsOutSsjThread implements Runnable{
|
||||
|
||||
public HashMap<String, List<String>> ssjCodeList;
|
||||
|
||||
private IApiService apiService;
|
||||
private IAgvQueueService agvQueueService;
|
||||
|
||||
public boolean isRun = true;
|
||||
|
||||
|
||||
public void init() {
|
||||
ssjCodeList = new HashMap<>();
|
||||
ArrayList<String> ssjCodes = new ArrayList<>();
|
||||
ssjCodes.add("G2001");
|
||||
ssjCodes.add("G3001");
|
||||
ssjCodes.add("G3010");
|
||||
ssjCodes.add("G4001");
|
||||
ssjCodes.add("G4010");
|
||||
ssjCodes.add("G5001");
|
||||
ssjCodes.add("G5010");
|
||||
ssjCodeList.put("ssjOut", ssjCodes);
|
||||
|
||||
apiService = SpringUtils.getBean(IApiService.class);
|
||||
agvQueueService = SpringUtils.getBean(IAgvQueueService.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
init();
|
||||
|
||||
while (isRun){
|
||||
for (String type : ssjCodeList.keySet()) {
|
||||
switch (type){
|
||||
case "ssjOut":
|
||||
try {
|
||||
//正常输送线出口
|
||||
for (String ssjCode : ssjCodeList.get(type)) {
|
||||
if (PlcRead.deviceMap.containsKey(ssjCode)) {
|
||||
ssjOutDispatch(PlcRead.deviceMap.get(ssjCode));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", ssjCode);
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
break;
|
||||
case "fluentOut":
|
||||
//流利架出口(剪式没有)
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 输送线出口
|
||||
* @param outSsjDevice
|
||||
*/
|
||||
public void ssjOutDispatch(DeviceSsj outSsjDevice) {
|
||||
if (outSsjDevice.getKx()==1){
|
||||
//查询对应的作业
|
||||
AgvQueue agvQueue = new AgvQueue();
|
||||
agvQueue.setPositionCode2(outSsjDevice.getDeviceCode());
|
||||
agvQueue.setStatus("0");
|
||||
List<AgvQueue> agvQueueList = agvQueueService.selectAgvQueueList(agvQueue);
|
||||
if (CollUtil.isNotEmpty(agvQueueList)){
|
||||
for (AgvQueue queue : agvQueueList) {
|
||||
requestAgvQueue( queue);
|
||||
}
|
||||
}else {
|
||||
log.info("ssjCode:{},没有待下发的出库任务", outSsjDevice.getDeviceCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求海康生成agv任务,并修改wms任务状态
|
||||
* @param agvQueue
|
||||
*/
|
||||
private void requestAgvQueue(AgvQueue agvQueue) {
|
||||
//请求ctu
|
||||
GenAgvSchedulingTaskRequest genAgvSchedulingTaskRequest = new GenAgvSchedulingTaskRequest();
|
||||
genAgvSchedulingTaskRequest.setReqCode(agvQueue.getReqCode());
|
||||
genAgvSchedulingTaskRequest.setTaskMode("0");
|
||||
genAgvSchedulingTaskRequest.setPriority("10");
|
||||
genAgvSchedulingTaskRequest.setTaskTyp("F01");
|
||||
genAgvSchedulingTaskRequest.setCtnrCode("0");
|
||||
genAgvSchedulingTaskRequest.setCtnrNum("0");
|
||||
genAgvSchedulingTaskRequest.setTaskMode("0");
|
||||
genAgvSchedulingTaskRequest.setTaskCode(agvQueue.getTaskCode());
|
||||
genAgvSchedulingTaskRequest.setAgvTyp("CTU");
|
||||
genAgvSchedulingTaskRequest.setPositionSelStrategy("0");
|
||||
GenAgvSchedulingTaskResponse genAgvSchedulingTaskResponse = apiService.genAgvSchedulingTask(genAgvSchedulingTaskRequest);
|
||||
if (genAgvSchedulingTaskResponse.getCode() == 0){
|
||||
//修改ctu执行状态
|
||||
agvQueue.setStatus("1");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
log.info("向CTU下入库库作业");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.js;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.api.domain.RequestLog;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.bas.port.domain.WcsPort;
|
||||
import com.ruoyi.bas.port.service.IWcsPortService;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcRead;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.ruoyi.common.Constant.JOB_FINISH_URL;
|
||||
|
||||
|
||||
@Slf4j
|
||||
public class JsPickSsjTread implements Runnable {
|
||||
|
||||
public HashMap<String, List<String>> ssjCodeList;
|
||||
|
||||
private IApiService apiService;
|
||||
private IAgvQueueService agvQueueService;
|
||||
private IWcsPortService wcsPortService;
|
||||
|
||||
|
||||
public boolean isRun = true;
|
||||
|
||||
|
||||
public void init() {
|
||||
ssjCodeList = new HashMap<>();
|
||||
ArrayList<String> ssjCodes = new ArrayList<>();
|
||||
ssjCodes.add("G5013");
|
||||
ssjCodes.add("G5014");
|
||||
ssjCodes.add("G5015");
|
||||
ssjCodes.add("G5004");
|
||||
ssjCodes.add("G5005");
|
||||
ssjCodes.add("G5006");
|
||||
ssjCodes.add("G4013");
|
||||
ssjCodes.add("G4014");
|
||||
ssjCodes.add("G4015");
|
||||
ssjCodes.add("G4004");
|
||||
ssjCodes.add("G4005");
|
||||
ssjCodes.add("G4006");
|
||||
ssjCodeList.put("pick", ssjCodes);
|
||||
|
||||
|
||||
apiService = SpringUtils.getBean(IApiService.class);
|
||||
agvQueueService = SpringUtils.getBean(IAgvQueueService.class);
|
||||
wcsPortService = SpringUtils.getBean(IWcsPortService.class);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void run(){
|
||||
init();
|
||||
while (isRun){
|
||||
for (String type : ssjCodeList.keySet()) {
|
||||
if ("pick".equals(type)) {
|
||||
for (String ssjCode : ssjCodeList.get(type)) {
|
||||
try {
|
||||
if (PlcRead.deviceMap.containsKey(ssjCode)) {
|
||||
pickDispatch(PlcRead.deviceMap.get(ssjCode));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", ssjCode);
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error(e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void pickDispatch(DeviceSsj pickSsjDevice) {
|
||||
if (pickSsjDevice.getDw() == 1 && pickSsjDevice.getTaskNo() > 0) {
|
||||
WcsPort wcsPortParam = new WcsPort();
|
||||
wcsPortParam.setPortCode(pickSsjDevice.getDeviceCode());
|
||||
wcsPortParam.setPortType("1");
|
||||
List<WcsPort> wcsPorts = wcsPortService.selectWcsPortList(wcsPortParam);
|
||||
if (CollUtil.isNotEmpty(wcsPorts)){
|
||||
WcsPort wcsPort = wcsPorts.get(0);
|
||||
if ("1".equals(wcsPort.getStatus())){
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put("taskNo", pickSsjDevice.getTaskNo());
|
||||
param.put("wmsType", "2");
|
||||
param.put("pickSsj", pickSsjDevice.getDeviceCode());
|
||||
RequestLog requestLog = apiService.finishMydoJob(JOB_FINISH_URL, "出库任务到达拣选口", param);
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
wcsPort.setStatus("2");
|
||||
wcsPortService.updateWcsPort(wcsPort);
|
||||
}else {
|
||||
log.error("任务失败{}", requestLog.getErrorDetails());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (pickSsjDevice.getKx() == 1 && pickSsjDevice.getTaskNo() == 0){
|
||||
WcsPort wcsPortParam = new WcsPort();
|
||||
wcsPortParam.setPortCode(pickSsjDevice.getDeviceCode());
|
||||
wcsPortParam.setPortType("1");
|
||||
List<WcsPort> wcsPorts = wcsPortService.selectWcsPortList(wcsPortParam);
|
||||
if (CollUtil.isNotEmpty(wcsPorts)){
|
||||
WcsPort wcsPort = wcsPorts.get(0);
|
||||
if ("2".equals(wcsPort.getStatus())){
|
||||
wcsPort.setStatus("1");
|
||||
wcsPortService.updateWcsPort(wcsPort);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.monitor;
|
||||
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.device.ssj.service.IDeviceSsjService;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcRead;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
||||
@Slf4j
|
||||
public class CarMonitorThread implements Runnable {
|
||||
|
||||
|
||||
|
||||
private IDeviceSsjService deviceSsjService;
|
||||
public boolean isRun = true;
|
||||
|
||||
|
||||
public void init() {
|
||||
deviceSsjService = SpringUtils.getBean(IDeviceSsjService.class);
|
||||
log.info("初始化服务 {}", deviceSsjService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
init();
|
||||
while (isRun) {
|
||||
for (String ssjCode : PlcRead.deviceMap.keySet()) {
|
||||
try {
|
||||
DeviceSsj deviceSsj = PlcRead.deviceMap.get(ssjCode);
|
||||
if (ObjUtil.isNotNull(deviceSsj)){
|
||||
switch (deviceSsj.getType()) {
|
||||
case "1":
|
||||
monitor1(deviceSsj);
|
||||
break;
|
||||
case "2":
|
||||
monitor2(deviceSsj);
|
||||
break;
|
||||
case "3":
|
||||
monitor3(deviceSsj);
|
||||
break;
|
||||
case "4":
|
||||
monitor4(deviceSsj);
|
||||
break;
|
||||
}
|
||||
}else {
|
||||
log.error("设备不存在 {}", ssjCode);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*其他输送机监控
|
||||
* @param deviceSsj
|
||||
*/
|
||||
private void monitor4(DeviceSsj deviceSsj) {
|
||||
deviceSsjService.updateDeviceSsj(deviceSsj);
|
||||
}
|
||||
|
||||
/**
|
||||
*入库输送机监控
|
||||
* @param deviceSsj
|
||||
*/
|
||||
private void monitor3(DeviceSsj deviceSsj) {
|
||||
deviceSsjService.updateDeviceSsj(deviceSsj);
|
||||
}
|
||||
|
||||
/**
|
||||
*拣选输送机监控
|
||||
* @param deviceSsj
|
||||
*/
|
||||
private void monitor2(DeviceSsj deviceSsj) {
|
||||
deviceSsjService.updateDeviceSsj(deviceSsj);
|
||||
}
|
||||
|
||||
/**
|
||||
*出库输送机监控
|
||||
* @param deviceSsj
|
||||
*/
|
||||
private void monitor1(DeviceSsj deviceSsj) {
|
||||
deviceSsjService.updateDeviceSsj(deviceSsj);
|
||||
}
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.monitor;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskResponse;
|
||||
import com.ruoyi.api.domain.wcs2wms.MydoJob;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.agv.domain.AgvQueue;
|
||||
import com.ruoyi.device.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.device.ssj.service.IDeviceSsjService;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcRead;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Slf4j
|
||||
public class SsjMonitorThread implements Runnable {
|
||||
|
||||
|
||||
|
||||
private IDeviceSsjService deviceSsjService;
|
||||
public boolean isRun = true;
|
||||
|
||||
|
||||
public void init() {
|
||||
deviceSsjService = SpringUtils.getBean(IDeviceSsjService.class);
|
||||
log.info("初始化服务 {}", deviceSsjService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
init();
|
||||
while (isRun) {
|
||||
for (String ssjCode : PlcRead.deviceMap.keySet()) {
|
||||
try {
|
||||
DeviceSsj deviceSsj = PlcRead.deviceMap.get(ssjCode);
|
||||
if (ObjUtil.isNotNull(deviceSsj)){
|
||||
switch (deviceSsj.getType()) {
|
||||
case "1":
|
||||
monitor1(deviceSsj);
|
||||
break;
|
||||
case "2":
|
||||
monitor2(deviceSsj);
|
||||
break;
|
||||
case "3":
|
||||
monitor3(deviceSsj);
|
||||
break;
|
||||
case "4":
|
||||
monitor4(deviceSsj);
|
||||
break;
|
||||
}
|
||||
}else {
|
||||
log.error("设备不存在 {}", ssjCode);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.sleep(15000);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*其他输送机监控
|
||||
* @param deviceSsj
|
||||
*/
|
||||
private void monitor4(DeviceSsj deviceSsj) {
|
||||
deviceSsjService.updateDeviceSsj(deviceSsj);
|
||||
}
|
||||
|
||||
/**
|
||||
*入库输送机监控
|
||||
* @param deviceSsj
|
||||
*/
|
||||
private void monitor3(DeviceSsj deviceSsj) {
|
||||
deviceSsjService.updateDeviceSsj(deviceSsj);
|
||||
}
|
||||
|
||||
/**
|
||||
*拣选输送机监控
|
||||
* @param deviceSsj
|
||||
*/
|
||||
private void monitor2(DeviceSsj deviceSsj) {
|
||||
deviceSsjService.updateDeviceSsj(deviceSsj);
|
||||
}
|
||||
|
||||
/**
|
||||
*出库输送机监控
|
||||
* @param deviceSsj
|
||||
*/
|
||||
private void monitor1(DeviceSsj deviceSsj) {
|
||||
deviceSsjService.updateDeviceSsj(deviceSsj);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.device.agv.mapper.AgvQueueFinishMapper">
|
||||
<mapper namespace="com.ruoyi.queue.agv.mapper.AgvQueueFinishMapper">
|
||||
|
||||
<resultMap type="AgvQueueFinish" id="AgvQueueFinishResult">
|
||||
<result property="reqCode" column="req_code" />
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.device.agv.mapper.AgvQueueMapper">
|
||||
<mapper namespace="com.ruoyi.queue.agv.mapper.AgvQueueMapper">
|
||||
|
||||
<resultMap type="AgvQueue" id="AgvQueueResult">
|
||||
<result property="reqCode" column="req_code" />
|
||||
|
||||
143
ruoyi-admin/src/main/resources/mapper/device/MsgDdjMapper.xml
Normal file
143
ruoyi-admin/src/main/resources/mapper/device/MsgDdjMapper.xml
Normal file
@@ -0,0 +1,143 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.device.ddj.mapper.MsgDdjMapper">
|
||||
|
||||
<resultMap type="MsgDdj" id="MsgDdjResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="rwh" column="rwh" />
|
||||
<result property="jdbz" column="jdbz" />
|
||||
<result property="sbzt" column="sbzt" />
|
||||
<result property="czfs" column="czfs" />
|
||||
<result property="yxxf" column="yxxf" />
|
||||
<result property="yp" column="yp" />
|
||||
<result property="yl" column="yl" />
|
||||
<result property="yc" column="yc" />
|
||||
<result property="mbp" column="mbp" />
|
||||
<result property="mbl" column="mbl" />
|
||||
<result property="mbc" column="mbc" />
|
||||
<result property="xtxh" column="xtxh" />
|
||||
<result property="dqxd" column="dqxd" />
|
||||
<result property="hczt" column="hczt" />
|
||||
<result property="spare1" column="spare1" />
|
||||
<result property="spare2" column="spare2" />
|
||||
<result property="spare3" column="spare3" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMsgDdjVo">
|
||||
select id, name, rwh, jdbz, sbzt, czfs, yxxf, yp, yl, yc, mbp, mbl, mbc, xtxh, dqxd, hczt, spare1, spare2, spare3 from msg_ddj
|
||||
</sql>
|
||||
|
||||
<select id="selectMsgDdjList" parameterType="MsgDdj" resultMap="MsgDdjResult">
|
||||
<include refid="selectMsgDdjVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="rwh != null "> and rwh = #{rwh}</if>
|
||||
<if test="jdbz != null "> and jdbz = #{jdbz}</if>
|
||||
<if test="sbzt != null "> and sbzt = #{sbzt}</if>
|
||||
<if test="czfs != null "> and czfs = #{czfs}</if>
|
||||
<if test="yxxf != null "> and yxxf = #{yxxf}</if>
|
||||
<if test="yp != null "> and yp = #{yp}</if>
|
||||
<if test="yl != null "> and yl = #{yl}</if>
|
||||
<if test="yc != null "> and yc = #{yc}</if>
|
||||
<if test="mbp != null "> and mbp = #{mbp}</if>
|
||||
<if test="mbl != null "> and mbl = #{mbl}</if>
|
||||
<if test="mbc != null "> and mbc = #{mbc}</if>
|
||||
<if test="xtxh != null "> and xtxh = #{xtxh}</if>
|
||||
<if test="dqxd != null "> and dqxd = #{dqxd}</if>
|
||||
<if test="hczt != null "> and hczt = #{hczt}</if>
|
||||
<if test="spare1 != null "> and spare1 = #{spare1}</if>
|
||||
<if test="spare2 != null "> and spare2 = #{spare2}</if>
|
||||
<if test="spare3 != null "> and spare3 = #{spare3}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMsgDdjById" parameterType="Long" resultMap="MsgDdjResult">
|
||||
<include refid="selectMsgDdjVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertMsgDdj" parameterType="MsgDdj">
|
||||
insert into msg_ddj
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="rwh != null">rwh,</if>
|
||||
<if test="jdbz != null">jdbz,</if>
|
||||
<if test="sbzt != null">sbzt,</if>
|
||||
<if test="czfs != null">czfs,</if>
|
||||
<if test="yxxf != null">yxxf,</if>
|
||||
<if test="yp != null">yp,</if>
|
||||
<if test="yl != null">yl,</if>
|
||||
<if test="yc != null">yc,</if>
|
||||
<if test="mbp != null">mbp,</if>
|
||||
<if test="mbl != null">mbl,</if>
|
||||
<if test="mbc != null">mbc,</if>
|
||||
<if test="xtxh != null">xtxh,</if>
|
||||
<if test="dqxd != null">dqxd,</if>
|
||||
<if test="hczt != null">hczt,</if>
|
||||
<if test="spare1 != null">spare1,</if>
|
||||
<if test="spare2 != null">spare2,</if>
|
||||
<if test="spare3 != null">spare3,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="rwh != null">#{rwh},</if>
|
||||
<if test="jdbz != null">#{jdbz},</if>
|
||||
<if test="sbzt != null">#{sbzt},</if>
|
||||
<if test="czfs != null">#{czfs},</if>
|
||||
<if test="yxxf != null">#{yxxf},</if>
|
||||
<if test="yp != null">#{yp},</if>
|
||||
<if test="yl != null">#{yl},</if>
|
||||
<if test="yc != null">#{yc},</if>
|
||||
<if test="mbp != null">#{mbp},</if>
|
||||
<if test="mbl != null">#{mbl},</if>
|
||||
<if test="mbc != null">#{mbc},</if>
|
||||
<if test="xtxh != null">#{xtxh},</if>
|
||||
<if test="dqxd != null">#{dqxd},</if>
|
||||
<if test="hczt != null">#{hczt},</if>
|
||||
<if test="spare1 != null">#{spare1},</if>
|
||||
<if test="spare2 != null">#{spare2},</if>
|
||||
<if test="spare3 != null">#{spare3},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMsgDdj" parameterType="MsgDdj">
|
||||
update msg_ddj
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="rwh != null">rwh = #{rwh},</if>
|
||||
<if test="jdbz != null">jdbz = #{jdbz},</if>
|
||||
<if test="sbzt != null">sbzt = #{sbzt},</if>
|
||||
<if test="czfs != null">czfs = #{czfs},</if>
|
||||
<if test="yxxf != null">yxxf = #{yxxf},</if>
|
||||
<if test="yp != null">yp = #{yp},</if>
|
||||
<if test="yl != null">yl = #{yl},</if>
|
||||
<if test="yc != null">yc = #{yc},</if>
|
||||
<if test="mbp != null">mbp = #{mbp},</if>
|
||||
<if test="mbl != null">mbl = #{mbl},</if>
|
||||
<if test="mbc != null">mbc = #{mbc},</if>
|
||||
<if test="xtxh != null">xtxh = #{xtxh},</if>
|
||||
<if test="dqxd != null">dqxd = #{dqxd},</if>
|
||||
<if test="hczt != null">hczt = #{hczt},</if>
|
||||
<if test="spare1 != null">spare1 = #{spare1},</if>
|
||||
<if test="spare2 != null">spare2 = #{spare2},</if>
|
||||
<if test="spare3 != null">spare3 = #{spare3},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMsgDdjById" parameterType="Long">
|
||||
delete from msg_ddj where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMsgDdjByIds" parameterType="String">
|
||||
delete from msg_ddj where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
148
ruoyi-admin/src/main/resources/mapper/job/MydoJobMapper.xml
Normal file
148
ruoyi-admin/src/main/resources/mapper/job/MydoJobMapper.xml
Normal file
@@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.job.mapper.MydoJobMapper">
|
||||
|
||||
<resultMap type="MydoJob" id="MydoJobResult">
|
||||
<result property="jobId" column="job_id" />
|
||||
<result property="status" column="status" />
|
||||
<result property="taskNo" column="task_no" />
|
||||
<result property="roadwayId" column="roadway_id" />
|
||||
<result property="cargoSpaceId" column="cargo_space_id" />
|
||||
<result property="targetRoadwayId" column="target_roadway_id" />
|
||||
<result property="targetCargoSpaceId" column="target_cargo_space_id" />
|
||||
<result property="priority" column="priority" />
|
||||
<result property="executionPhase" column="execution_phase" />
|
||||
<result property="inOrOut" column="in_or_out" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="finishTime" column="finish_time" />
|
||||
<result property="entranceId" column="entrance_id" />
|
||||
<result property="exitId" column="exit_id" />
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="faultFlag" column="fault_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMydoJobVo">
|
||||
select job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag from mydo_job_wcs
|
||||
</sql>
|
||||
|
||||
<select id="selectMydoJobList" parameterType="MydoJob" resultMap="MydoJobResult">
|
||||
<include refid="selectMydoJobVo"/>
|
||||
<where>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="taskNo != null and taskNo != ''"> and task_no = #{taskNo}</if>
|
||||
<if test="roadwayId != null and roadwayId != ''"> and roadway_id = #{roadwayId}</if>
|
||||
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and cargo_space_id = #{cargoSpaceId}</if>
|
||||
<if test="targetRoadwayId != null and targetRoadwayId != ''"> and target_roadway_id = #{targetRoadwayId}</if>
|
||||
<if test="targetCargoSpaceId != null and targetCargoSpaceId != ''"> and target_cargo_space_id = #{targetCargoSpaceId}</if>
|
||||
<if test="priority != null "> and priority = #{priority}</if>
|
||||
<if test="executionPhase != null and executionPhase != ''"> and execution_phase = #{executionPhase}</if>
|
||||
<if test="inOrOut != null and inOrOut != ''"> and in_or_out = #{inOrOut}</if>
|
||||
<if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
|
||||
<if test="finishTime != null and finishTime != ''"> and finish_time = #{finishTime}</if>
|
||||
<if test="entranceId != null and entranceId != ''"> and entrance_id = #{entranceId}</if>
|
||||
<if test="exitId != null and exitId != ''"> and exit_id = #{exitId}</if>
|
||||
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
|
||||
<if test="faultFlag != null and faultFlag != ''"> and fault_flag = #{faultFlag}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMydoJobByJobId" parameterType="String" resultMap="MydoJobResult">
|
||||
<include refid="selectMydoJobVo"/>
|
||||
where job_id = #{jobId}
|
||||
</select>
|
||||
<select id="ddjTaskFinish" parameterType="java.util.Map" statementType="CALLABLE">
|
||||
{call proc_mydojob_finish(
|
||||
#{v_rwh,mode=IN,jdbcType=INTEGER},
|
||||
#{v_ddj_id,mode=IN,jdbcType=INTEGER},
|
||||
#{v_result,mode=OUT,jdbcType=INTEGER},
|
||||
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
|
||||
)}
|
||||
</select>
|
||||
<select id="InvalidMydoJob" parameterType="java.util.Map" statementType="CALLABLE">
|
||||
{call proc_mydojob_invalid(
|
||||
#{v_rwh,mode=IN,jdbcType=INTEGER},
|
||||
#{v_ddj_id,mode=IN,jdbcType=INTEGER},
|
||||
#{v_result,mode=OUT,jdbcType=INTEGER},
|
||||
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
|
||||
)}
|
||||
</select>
|
||||
|
||||
<insert id="insertMydoJob" parameterType="MydoJob">
|
||||
insert into mydo_job_wcs
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="jobId != null">job_id,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="taskNo != null and taskNo != ''">task_no,</if>
|
||||
<if test="roadwayId != null">roadway_id,</if>
|
||||
<if test="cargoSpaceId != null">cargo_space_id,</if>
|
||||
<if test="targetRoadwayId != null">target_roadway_id,</if>
|
||||
<if test="targetCargoSpaceId != null">target_cargo_space_id,</if>
|
||||
<if test="priority != null">priority,</if>
|
||||
<if test="executionPhase != null">execution_phase,</if>
|
||||
<if test="inOrOut != null">in_or_out,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="finishTime != null">finish_time,</if>
|
||||
<if test="entranceId != null">entrance_id,</if>
|
||||
<if test="exitId != null">exit_id,</if>
|
||||
<if test="warehouseId != null">warehouse_id,</if>
|
||||
<if test="faultFlag != null">fault_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="jobId != null">#{jobId},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="taskNo != null and taskNo != ''">#{taskNo},</if>
|
||||
<if test="roadwayId != null">#{roadwayId},</if>
|
||||
<if test="cargoSpaceId != null">#{cargoSpaceId},</if>
|
||||
<if test="targetRoadwayId != null">#{targetRoadwayId},</if>
|
||||
<if test="targetCargoSpaceId != null">#{targetCargoSpaceId},</if>
|
||||
<if test="priority != null">#{priority},</if>
|
||||
<if test="executionPhase != null">#{executionPhase},</if>
|
||||
<if test="inOrOut != null">#{inOrOut},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="finishTime != null">#{finishTime},</if>
|
||||
<if test="entranceId != null">#{entranceId},</if>
|
||||
<if test="exitId != null">#{exitId},</if>
|
||||
<if test="warehouseId != null">#{warehouseId},</if>
|
||||
<if test="faultFlag != null">#{faultFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMydoJob" parameterType="MydoJob">
|
||||
update mydo_job_wcs
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="taskNo != null and taskNo != ''">task_no = #{taskNo},</if>
|
||||
<if test="roadwayId != null">roadway_id = #{roadwayId},</if>
|
||||
<if test="cargoSpaceId != null">cargo_space_id = #{cargoSpaceId},</if>
|
||||
<if test="targetRoadwayId != null">target_roadway_id = #{targetRoadwayId},</if>
|
||||
<if test="targetCargoSpaceId != null">target_cargo_space_id = #{targetCargoSpaceId},</if>
|
||||
<if test="priority != null">priority = #{priority},</if>
|
||||
<if test="executionPhase != null">execution_phase = #{executionPhase},</if>
|
||||
<if test="inOrOut != null">in_or_out = #{inOrOut},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="finishTime != null">finish_time = #{finishTime},</if>
|
||||
<if test="entranceId != null">entrance_id = #{entranceId},</if>
|
||||
<if test="exitId != null">exit_id = #{exitId},</if>
|
||||
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
|
||||
<if test="faultFlag != null">fault_flag = #{faultFlag},</if>
|
||||
</trim>
|
||||
where job_id = #{jobId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMydoJobByJobId" parameterType="String">
|
||||
delete from mydo_job_wcs where job_id = #{jobId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMydoJobByJobIds" parameterType="String">
|
||||
delete from mydo_job_wcs where job_id in
|
||||
<foreach item="jobId" collection="array" open="(" separator="," close=")">
|
||||
#{jobId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.queue.ddj.mapper.DdjDeviceExecutionQueueFinishMapper">
|
||||
|
||||
<resultMap type="DdjDeviceExecutionQueueFinish" id="DdjDeviceExecutionQueueFinishResult">
|
||||
<result property="uuid" column="uuid" />
|
||||
<result property="rwh" column="rwh" />
|
||||
<result property="devName" column="dev_name" />
|
||||
<result property="devId" column="dev_id" />
|
||||
<result property="rwzt" column="rwzt" />
|
||||
<result property="yph" column="yph" />
|
||||
<result property="ylh" column="ylh" />
|
||||
<result property="ych" column="ych" />
|
||||
<result property="mbph" column="mbph" />
|
||||
<result property="mblh" column="mblh" />
|
||||
<result property="mbch" column="mbch" />
|
||||
<result property="ddjxf" column="ddjxf" />
|
||||
<result property="rwlx" column="rwlx" />
|
||||
<result property="scsj" column="scsj" />
|
||||
<result property="xfsj" column="xfsj" />
|
||||
<result property="jssj" column="jssj" />
|
||||
<result property="mlfs" column="mlfs" />
|
||||
<result property="spare1" column="spare1" />
|
||||
<result property="spare2" column="spare2" />
|
||||
<result property="spare3" column="spare3" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDdjDeviceExecutionQueueFinishVo">
|
||||
select uuid, rwh, dev_name, dev_id, rwzt, yph, ylh, ych, mbph, mblh, mbch, ddjxf, rwlx, scsj, xfsj, jssj, mlfs, spare1, spare2, spare3 from ddj_device_execution_queue_finish
|
||||
</sql>
|
||||
|
||||
<select id="selectDdjDeviceExecutionQueueFinishList" parameterType="DdjDeviceExecutionQueueFinish" resultMap="DdjDeviceExecutionQueueFinishResult">
|
||||
<include refid="selectDdjDeviceExecutionQueueFinishVo"/>
|
||||
<where>
|
||||
<if test="rwh != null "> and rwh = #{rwh}</if>
|
||||
<if test="devName != null and devName != ''"> and dev_name like concat('%', #{devName}, '%')</if>
|
||||
<if test="devId != null "> and dev_id = #{devId}</if>
|
||||
<if test="rwzt != null "> and rwzt = #{rwzt}</if>
|
||||
<if test="yph != null "> and yph = #{yph}</if>
|
||||
<if test="ylh != null "> and ylh = #{ylh}</if>
|
||||
<if test="ych != null "> and ych = #{ych}</if>
|
||||
<if test="mbph != null "> and mbph = #{mbph}</if>
|
||||
<if test="mblh != null "> and mblh = #{mblh}</if>
|
||||
<if test="mbch != null "> and mbch = #{mbch}</if>
|
||||
<if test="ddjxf != null and ddjxf != ''"> and ddjxf = #{ddjxf}</if>
|
||||
<if test="rwlx != null "> and rwlx = #{rwlx}</if>
|
||||
<if test="scsj != null and scsj != ''"> and scsj = #{scsj}</if>
|
||||
<if test="xfsj != null and xfsj != ''"> and xfsj = #{xfsj}</if>
|
||||
<if test="jssj != null and jssj != ''"> and jssj = #{jssj}</if>
|
||||
<if test="mlfs != null "> and mlfs = #{mlfs}</if>
|
||||
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
|
||||
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
|
||||
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDdjDeviceExecutionQueueFinishByUuid" parameterType="String" resultMap="DdjDeviceExecutionQueueFinishResult">
|
||||
<include refid="selectDdjDeviceExecutionQueueFinishVo"/>
|
||||
where uuid = #{uuid}
|
||||
</select>
|
||||
|
||||
<insert id="insertDdjDeviceExecutionQueueFinish" parameterType="DdjDeviceExecutionQueueFinish">
|
||||
insert into ddj_device_execution_queue_finish
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="uuid != null">uuid,</if>
|
||||
<if test="rwh != null">rwh,</if>
|
||||
<if test="devName != null and devName != ''">dev_name,</if>
|
||||
<if test="devId != null">dev_id,</if>
|
||||
<if test="rwzt != null">rwzt,</if>
|
||||
<if test="yph != null">yph,</if>
|
||||
<if test="ylh != null">ylh,</if>
|
||||
<if test="ych != null">ych,</if>
|
||||
<if test="mbph != null">mbph,</if>
|
||||
<if test="mblh != null">mblh,</if>
|
||||
<if test="mbch != null">mbch,</if>
|
||||
<if test="ddjxf != null">ddjxf,</if>
|
||||
<if test="rwlx != null">rwlx,</if>
|
||||
<if test="scsj != null">scsj,</if>
|
||||
<if test="xfsj != null">xfsj,</if>
|
||||
<if test="jssj != null">jssj,</if>
|
||||
<if test="mlfs != null">mlfs,</if>
|
||||
<if test="spare1 != null">spare1,</if>
|
||||
<if test="spare2 != null">spare2,</if>
|
||||
<if test="spare3 != null">spare3,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="uuid != null">#{uuid},</if>
|
||||
<if test="rwh != null">#{rwh},</if>
|
||||
<if test="devName != null and devName != ''">#{devName},</if>
|
||||
<if test="devId != null">#{devId},</if>
|
||||
<if test="rwzt != null">#{rwzt},</if>
|
||||
<if test="yph != null">#{yph},</if>
|
||||
<if test="ylh != null">#{ylh},</if>
|
||||
<if test="ych != null">#{ych},</if>
|
||||
<if test="mbph != null">#{mbph},</if>
|
||||
<if test="mblh != null">#{mblh},</if>
|
||||
<if test="mbch != null">#{mbch},</if>
|
||||
<if test="ddjxf != null">#{ddjxf},</if>
|
||||
<if test="rwlx != null">#{rwlx},</if>
|
||||
<if test="scsj != null">#{scsj},</if>
|
||||
<if test="xfsj != null">#{xfsj},</if>
|
||||
<if test="jssj != null">#{jssj},</if>
|
||||
<if test="mlfs != null">#{mlfs},</if>
|
||||
<if test="spare1 != null">#{spare1},</if>
|
||||
<if test="spare2 != null">#{spare2},</if>
|
||||
<if test="spare3 != null">#{spare3},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDdjDeviceExecutionQueueFinish" parameterType="DdjDeviceExecutionQueueFinish">
|
||||
update ddj_device_execution_queue_finish
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="rwh != null">rwh = #{rwh},</if>
|
||||
<if test="devName != null and devName != ''">dev_name = #{devName},</if>
|
||||
<if test="devId != null">dev_id = #{devId},</if>
|
||||
<if test="rwzt != null">rwzt = #{rwzt},</if>
|
||||
<if test="yph != null">yph = #{yph},</if>
|
||||
<if test="ylh != null">ylh = #{ylh},</if>
|
||||
<if test="ych != null">ych = #{ych},</if>
|
||||
<if test="mbph != null">mbph = #{mbph},</if>
|
||||
<if test="mblh != null">mblh = #{mblh},</if>
|
||||
<if test="mbch != null">mbch = #{mbch},</if>
|
||||
<if test="ddjxf != null">ddjxf = #{ddjxf},</if>
|
||||
<if test="rwlx != null">rwlx = #{rwlx},</if>
|
||||
<if test="scsj != null">scsj = #{scsj},</if>
|
||||
<if test="xfsj != null">xfsj = #{xfsj},</if>
|
||||
<if test="jssj != null">jssj = #{jssj},</if>
|
||||
<if test="mlfs != null">mlfs = #{mlfs},</if>
|
||||
<if test="spare1 != null">spare1 = #{spare1},</if>
|
||||
<if test="spare2 != null">spare2 = #{spare2},</if>
|
||||
<if test="spare3 != null">spare3 = #{spare3},</if>
|
||||
</trim>
|
||||
where uuid = #{uuid}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDdjDeviceExecutionQueueFinishByUuid" parameterType="String">
|
||||
delete from ddj_device_execution_queue_finish where uuid = #{uuid}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDdjDeviceExecutionQueueFinishByUuids" parameterType="String">
|
||||
delete from ddj_device_execution_queue_finish where uuid in
|
||||
<foreach item="uuid" collection="array" open="(" separator="," close=")">
|
||||
#{uuid}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,149 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.queue.ddj.mapper.DdjDeviceExecutionQueueMapper">
|
||||
|
||||
<resultMap type="DdjDeviceExecutionQueue" id="DdjDeviceExecutionQueueResult">
|
||||
<result property="uuid" column="uuid" />
|
||||
<result property="rwh" column="rwh" />
|
||||
<result property="devName" column="dev_name" />
|
||||
<result property="devId" column="dev_id" />
|
||||
<result property="rwzt" column="rwzt" />
|
||||
<result property="yph" column="yph" />
|
||||
<result property="ylh" column="ylh" />
|
||||
<result property="ych" column="ych" />
|
||||
<result property="mbph" column="mbph" />
|
||||
<result property="mblh" column="mblh" />
|
||||
<result property="mbch" column="mbch" />
|
||||
<result property="ddjxf" column="ddjxf" />
|
||||
<result property="rwlx" column="rwlx" />
|
||||
<result property="scsj" column="scsj" />
|
||||
<result property="xfsj" column="xfsj" />
|
||||
<result property="jssj" column="jssj" />
|
||||
<result property="mlfs" column="mlfs" />
|
||||
<result property="spare1" column="spare1" />
|
||||
<result property="spare2" column="spare2" />
|
||||
<result property="spare3" column="spare3" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDdjDeviceExecutionQueueVo">
|
||||
select uuid, rwh, dev_name, dev_id, rwzt, yph, ylh, ych, mbph, mblh, mbch, ddjxf, rwlx, scsj, xfsj, jssj, mlfs, spare1, spare2, spare3 from ddj_device_execution_queue
|
||||
</sql>
|
||||
|
||||
<select id="selectDdjDeviceExecutionQueueList" parameterType="DdjDeviceExecutionQueue" resultMap="DdjDeviceExecutionQueueResult">
|
||||
<include refid="selectDdjDeviceExecutionQueueVo"/>
|
||||
<where>
|
||||
<if test="rwh != null "> and rwh = #{rwh}</if>
|
||||
<if test="devName != null and devName != ''"> and dev_name like concat('%', #{devName}, '%')</if>
|
||||
<if test="devId != null "> and dev_id = #{devId}</if>
|
||||
<if test="rwzt != null "> and rwzt = #{rwzt}</if>
|
||||
<if test="yph != null "> and yph = #{yph}</if>
|
||||
<if test="ylh != null "> and ylh = #{ylh}</if>
|
||||
<if test="ych != null "> and ych = #{ych}</if>
|
||||
<if test="mbph != null "> and mbph = #{mbph}</if>
|
||||
<if test="mblh != null "> and mblh = #{mblh}</if>
|
||||
<if test="mbch != null "> and mbch = #{mbch}</if>
|
||||
<if test="ddjxf != null and ddjxf != ''"> and ddjxf = #{ddjxf}</if>
|
||||
<if test="rwlx != null "> and rwlx = #{rwlx}</if>
|
||||
<if test="scsj != null and scsj != ''"> and scsj = #{scsj}</if>
|
||||
<if test="xfsj != null and xfsj != ''"> and xfsj = #{xfsj}</if>
|
||||
<if test="jssj != null and jssj != ''"> and jssj = #{jssj}</if>
|
||||
<if test="mlfs != null "> and mlfs = #{mlfs}</if>
|
||||
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
|
||||
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
|
||||
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
|
||||
</where>
|
||||
order by scsj desc
|
||||
</select>
|
||||
|
||||
<select id="selectDdjDeviceExecutionQueueByUuid" parameterType="String" resultMap="DdjDeviceExecutionQueueResult">
|
||||
<include refid="selectDdjDeviceExecutionQueueVo"/>
|
||||
where uuid = #{uuid}
|
||||
</select>
|
||||
|
||||
<insert id="insertDdjDeviceExecutionQueue" parameterType="DdjDeviceExecutionQueue">
|
||||
insert into ddj_device_execution_queue
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="uuid != null">uuid,</if>
|
||||
<if test="rwh != null">rwh,</if>
|
||||
<if test="devName != null and devName != ''">dev_name,</if>
|
||||
<if test="devId != null">dev_id,</if>
|
||||
<if test="rwzt != null">rwzt,</if>
|
||||
<if test="yph != null">yph,</if>
|
||||
<if test="ylh != null">ylh,</if>
|
||||
<if test="ych != null">ych,</if>
|
||||
<if test="mbph != null">mbph,</if>
|
||||
<if test="mblh != null">mblh,</if>
|
||||
<if test="mbch != null">mbch,</if>
|
||||
<if test="ddjxf != null">ddjxf,</if>
|
||||
<if test="rwlx != null">rwlx,</if>
|
||||
<if test="scsj != null">scsj,</if>
|
||||
<if test="xfsj != null">xfsj,</if>
|
||||
<if test="jssj != null">jssj,</if>
|
||||
<if test="mlfs != null">mlfs,</if>
|
||||
<if test="spare1 != null">spare1,</if>
|
||||
<if test="spare2 != null">spare2,</if>
|
||||
<if test="spare3 != null">spare3,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="uuid != null">#{uuid},</if>
|
||||
<if test="rwh != null">#{rwh},</if>
|
||||
<if test="devName != null and devName != ''">#{devName},</if>
|
||||
<if test="devId != null">#{devId},</if>
|
||||
<if test="rwzt != null">#{rwzt},</if>
|
||||
<if test="yph != null">#{yph},</if>
|
||||
<if test="ylh != null">#{ylh},</if>
|
||||
<if test="ych != null">#{ych},</if>
|
||||
<if test="mbph != null">#{mbph},</if>
|
||||
<if test="mblh != null">#{mblh},</if>
|
||||
<if test="mbch != null">#{mbch},</if>
|
||||
<if test="ddjxf != null">#{ddjxf},</if>
|
||||
<if test="rwlx != null">#{rwlx},</if>
|
||||
<if test="scsj != null">#{scsj},</if>
|
||||
<if test="xfsj != null">#{xfsj},</if>
|
||||
<if test="jssj != null">#{jssj},</if>
|
||||
<if test="mlfs != null">#{mlfs},</if>
|
||||
<if test="spare1 != null">#{spare1},</if>
|
||||
<if test="spare2 != null">#{spare2},</if>
|
||||
<if test="spare3 != null">#{spare3},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDdjDeviceExecutionQueue" parameterType="DdjDeviceExecutionQueue">
|
||||
update ddj_device_execution_queue
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="rwh != null">rwh = #{rwh},</if>
|
||||
<if test="devName != null and devName != ''">dev_name = #{devName},</if>
|
||||
<if test="devId != null">dev_id = #{devId},</if>
|
||||
<if test="rwzt != null">rwzt = #{rwzt},</if>
|
||||
<if test="yph != null">yph = #{yph},</if>
|
||||
<if test="ylh != null">ylh = #{ylh},</if>
|
||||
<if test="ych != null">ych = #{ych},</if>
|
||||
<if test="mbph != null">mbph = #{mbph},</if>
|
||||
<if test="mblh != null">mblh = #{mblh},</if>
|
||||
<if test="mbch != null">mbch = #{mbch},</if>
|
||||
<if test="ddjxf != null">ddjxf = #{ddjxf},</if>
|
||||
<if test="rwlx != null">rwlx = #{rwlx},</if>
|
||||
<if test="scsj != null">scsj = #{scsj},</if>
|
||||
<if test="xfsj != null">xfsj = #{xfsj},</if>
|
||||
<if test="jssj != null">jssj = #{jssj},</if>
|
||||
<if test="mlfs != null">mlfs = #{mlfs},</if>
|
||||
<if test="spare1 != null">spare1 = #{spare1},</if>
|
||||
<if test="spare2 != null">spare2 = #{spare2},</if>
|
||||
<if test="spare3 != null">spare3 = #{spare3},</if>
|
||||
</trim>
|
||||
where uuid = #{uuid}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDdjDeviceExecutionQueueByUuid" parameterType="String">
|
||||
delete from ddj_device_execution_queue where uuid = #{uuid}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDdjDeviceExecutionQueueByUuids" parameterType="String">
|
||||
delete from ddj_device_execution_queue where uuid in
|
||||
<foreach item="uuid" collection="array" open="(" separator="," close=")">
|
||||
#{uuid}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user