This commit is contained in:
zj
2026-03-18 11:47:30 +08:00
parent 036ee35af3
commit 8eb2bcc592
19 changed files with 370 additions and 370 deletions

View File

@@ -137,7 +137,5 @@ public interface IApiService
AjaxResult deleteAgvTray(AgvQueue agvQueue); AjaxResult deleteAgvTray(AgvQueue agvQueue);
AjaxResult requestWmsSpace(MydoJob mydoJob);
} }

View File

@@ -392,6 +392,7 @@ public class ApiServiceImpl implements IApiService {
} }
mydoJob.setInOrOut(receiveOutJob.getInOrOut()); mydoJob.setInOrOut(receiveOutJob.getInOrOut());
mydoJob.setStatus("1"); mydoJob.setStatus("1");
mydoJob.setPriority(Long.valueOf(10));
mydoJob.setTrayCode(receiveOutJob.getTrayCode()); mydoJob.setTrayCode(receiveOutJob.getTrayCode());
mydoJob.setRoadwayId(receiveOutJob.getRoadwayId()); mydoJob.setRoadwayId(receiveOutJob.getRoadwayId());
mydoJob.setCreateTime(DateUtils.getNowDate()); mydoJob.setCreateTime(DateUtils.getNowDate());
@@ -451,6 +452,17 @@ public class ApiServiceImpl implements IApiService {
} }
} }
@Override
public AjaxResult requestWmsSpace(MydoJob mydoJob) {
RequestLog requestLog = requestLogService.getRequestLog(REQUEST_IN_SPACE_URL, "入库请求分货位", JSONUtil.toJsonStr(mydoJob));
if ("1".equals(requestLog.getIsSuccessful())) {
InterfaceReceive bean = JSONUtil.toBean(requestLog.getResponseBody(), InterfaceReceive.class);
return AjaxResult.success(bean.getData());
} else {
return AjaxResult.error();
}
}
@Override @Override
public AjaxResult selectMydoJobByNoTrayCode(Map<String, Object> param) { public AjaxResult selectMydoJobByNoTrayCode(Map<String, Object> param) {

View File

@@ -17,7 +17,7 @@ public class Constant {
public static final String RE_ASSIGN_URL = WMS_BASE_URL+"reAssign"; public static final String RE_ASSIGN_URL = WMS_BASE_URL+"reAssign";
public static final String RE_MATERIAL_URL = WMS_BASE_URL+"reMaterial"; public static final String RE_MATERIAL_URL = WMS_BASE_URL+"reMaterial";
public static final String REQUEST_ENTER_URL = WMS_BASE_URL+"requestEnterByTrayCodeAndEntranceId"; public static final String REQUEST_ENTER_URL = WMS_BASE_URL+"requestEnterByTrayCodeAndEntranceId";
public static final String REQUEST_IN_SPACE_URL = WMS_BASE_URL+"requestInSpace";

View File

@@ -71,7 +71,7 @@ public interface MydoJobMapper
void InvalidMydoJob(HashMap<String, Object> map); void InvalidMydoJob(HashMap<String, Object> map);
MydoJob selectMydoJobByExitList(@Param("exitList") List<String> exitList ); MydoJob selectMydoJobByExitList(@Param("exitList") List<String> exitList );
MydoJob selectMydoJobByExitList1(@Param("exitList") List<String> exitList ,@Param("roadwayId") String roadwayId); MydoJob selectMydoJobByExitList1(@Param("exitId") String exitId ,@Param("roadwayId") String roadwayId);
void insertHistory(String jobId); void insertHistory(String jobId);
@@ -88,4 +88,8 @@ public interface MydoJobMapper
MydoJob selectJobByTaskNo(String taskNo); MydoJob selectJobByTaskNo(String taskNo);
MydoJob selectMydoJobByEntranceList1(@Param("entranceId") String entranceId); MydoJob selectMydoJobByEntranceList1(@Param("entranceId") String entranceId);
List<MydoJob> getInJobByEntranceId(@Param("entranceId") String exitId);
MydoJob selectMydoJobByExitId(@Param("exitId") String exitId);
} }

View File

@@ -68,7 +68,7 @@ public interface IMydoJobService
boolean InvalidMydoJob(Long rwh, Integer id); boolean InvalidMydoJob(Long rwh, Integer id);
MydoJob selectMydoJobByExitList(List<String> exitList); MydoJob selectMydoJobByExitList(List<String> exitList);
MydoJob selectMydoJobByExitList1(List<String> exitList,String roadwayId); MydoJob selectMydoJobByExitList1(String exitId,String roadwayId);
void insertHistory(String jobId); void insertHistory(String jobId);
@@ -87,4 +87,8 @@ public interface IMydoJobService
MydoJob selectMydoJobByEntranceList1(String entranceId); MydoJob selectMydoJobByEntranceList1(String entranceId);
AjaxResult OuthandFinish(String[] jobIds); AjaxResult OuthandFinish(String[] jobIds);
List<MydoJob> getInJobByEntranceId(String exitId);
MydoJob selectMydoJobByExitId(String exitId);
} }

View File

@@ -76,6 +76,8 @@ public class MydoJobServiceImpl implements IMydoJobService
@Override @Override
public int updateMydoJob(MydoJob mydoJob) public int updateMydoJob(MydoJob mydoJob)
{ {
long priority = mydoJob.getPriority();
mydoJob.setPriority(Math.abs(priority));
return mydoJobMapper.updateMydoJob(mydoJob); return mydoJobMapper.updateMydoJob(mydoJob);
} }
@@ -144,8 +146,8 @@ public class MydoJobServiceImpl implements IMydoJobService
} }
@Override @Override
public MydoJob selectMydoJobByExitList1(List<String> exitList ,String roadwayId) { public MydoJob selectMydoJobByExitList1(String exitId ,String roadwayId) {
return mydoJobMapper.selectMydoJobByExitList1(exitList,roadwayId); return mydoJobMapper.selectMydoJobByExitList1(exitId,roadwayId);
} }
@Override @Override
@@ -190,6 +192,16 @@ public class MydoJobServiceImpl implements IMydoJobService
return AjaxResult.success("操作成功"); return AjaxResult.success("操作成功");
} }
@Override
public List<MydoJob> getInJobByEntranceId(String exitId) {
return mydoJobMapper.getInJobByEntranceId(exitId);
}
@Override
public MydoJob selectMydoJobByExitId(String exitId) {
return mydoJobMapper.selectMydoJobByExitId(exitId);
}
@Override @Override
public List<MydoJob> selectMydoJobFinishList(MydoJob mydoJob) { public List<MydoJob> selectMydoJobFinishList(MydoJob mydoJob) {
return mydoJobMapper.selectMydoJobFinishList(mydoJob); return mydoJobMapper.selectMydoJobFinishList(mydoJob);

View File

@@ -88,6 +88,7 @@ public class DdjDeviceExecutionQueueController extends BaseController
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody DdjDeviceExecutionQueue ddjDeviceExecutionQueue) public AjaxResult edit(@RequestBody DdjDeviceExecutionQueue ddjDeviceExecutionQueue)
{ {
ddjDeviceExecutionQueue.setDdjxf("0");
return toAjax(ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue)); return toAjax(ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue));
} }

View File

@@ -64,7 +64,6 @@ public class DdjDeviceExecutionQueueServiceImpl implements IDdjDeviceExecutionQu
@Override @Override
public int updateDdjDeviceExecutionQueue(DdjDeviceExecutionQueue ddjDeviceExecutionQueue) public int updateDdjDeviceExecutionQueue(DdjDeviceExecutionQueue ddjDeviceExecutionQueue)
{ {
ddjDeviceExecutionQueue.setDdjxf("0");
return ddjDeviceExecutionQueueMapper.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue); return ddjDeviceExecutionQueueMapper.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
} }

View File

@@ -94,7 +94,7 @@ public class DdjThread implements Runnable {
堆垛机线程进来后第一件事先进行堆垛机正执行任务的账务处理 堆垛机线程进来后第一件事先进行堆垛机正执行任务的账务处理
以防存在漏处理,没处理的情况发生 以防存在漏处理,没处理的情况发生
*/ */
if (ddj.getCzfs() == 5 && ddj.getSbzt() == 0 && ddj.getJdbz() == 5) { if (ddj.getCzfs() == 5 && ddj.getSbzt() == 0 && (ddj.getJdbz() == 5 || ddj.getJdbz() == 0)) {
Long rwh = ddj.getRwh(); Long rwh = ddj.getRwh();
//完成作业 //完成作业
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh); MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
@@ -114,7 +114,7 @@ public class DdjThread implements Runnable {
//根据堆垛机上任务号,修改任务执行阶段 //根据堆垛机上任务号,修改任务执行阶段
Long rwh = ddj.getRwh(); Long rwh = ddj.getRwh();
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh, ddj.getId()); DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh, ddj.getId());
if (ddjDeviceExecutionQueue != null) { if (ddjDeviceExecutionQueue != null && !"1".equals(ddjDeviceExecutionQueue.getSpare1())) {
//修改队列执行阶段 //修改队列执行阶段
ddjDeviceExecutionQueue.setRwzt(ddj.getJdbz()); ddjDeviceExecutionQueue.setRwzt(ddj.getJdbz());
ddjDeviceExecutionQueue.setSpare1("1"); ddjDeviceExecutionQueue.setSpare1("1");
@@ -134,7 +134,7 @@ public class DdjThread implements Runnable {
if ("0".equals(mydoJob.getFaultFlag()) && "1".equals(ddjDeviceExecutionQueue.getSpare1())) { if ("0".equals(mydoJob.getFaultFlag()) && "1".equals(ddjDeviceExecutionQueue.getSpare1())) {
mydoJob.setStatus("1"); mydoJob.setStatus("1");
mydoJobService.updateMydoJob(mydoJob); mydoJobService.updateMydoJob(mydoJob);
AjaxResult ajaxResult = apiService.reAssign(new JobParam(mydoJob.getJobId(), null, null)); AjaxResult ajaxResult = apiService.reAssign(new JobParam(mydoJob.getJobId(), mydoJob.getTrayCode(), mydoJob.getTaskNo()));
if (ajaxResult.isSuccess()){ if (ajaxResult.isSuccess()){
mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh); mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
mydoJob.setFaultFlag("2"); mydoJob.setFaultFlag("2");
@@ -143,7 +143,7 @@ public class DdjThread implements Runnable {
ddjDeviceExecutionQueue.setMbph(basCargoSpace.getThePlatoon()); ddjDeviceExecutionQueue.setMbph(basCargoSpace.getThePlatoon());
ddjDeviceExecutionQueue.setMblh(basCargoSpace.getTheColumn()); ddjDeviceExecutionQueue.setMblh(basCargoSpace.getTheColumn());
ddjDeviceExecutionQueue.setMbch(basCargoSpace.getTheFloor()); ddjDeviceExecutionQueue.setMbch(basCargoSpace.getTheFloor());
ddjDeviceExecutionQueue.setSpare1("0"); ddjDeviceExecutionQueue.setDdjxf("0");
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue); ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
} }
} }
@@ -155,16 +155,15 @@ public class DdjThread implements Runnable {
*/ */
if (ddj.getCzfs() == 5 && ddj.getSbzt() == 1053 && ddj.getJdbz() < 5) { if (ddj.getCzfs() == 5 && ddj.getSbzt() == 1053 && ddj.getJdbz() < 5) {
Long rwh = ddj.getRwh(); Long rwh = ddj.getRwh();
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
//无货异常处理 //无货异常处理
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh,ddj.getId()); DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh,ddj.getId());
//找到对应任务 调用api接口 取货无货,重新分配单据 //找到对应任务 调用api接口 取货无货,重新分配单据
if (ObjUtil.isNotNull(ddjDeviceExecutionQueue)) { if (ObjUtil.isNotNull(ddjDeviceExecutionQueue)) {
AjaxResult ajaxResult = apiService.reMaterial(new JobParam(rwh.toString(), null, null)); AjaxResult ajaxResult = apiService.reMaterial(new JobParam(mydoJob.getJobId(), mydoJob.getTrayCode(), mydoJob.getTaskNo()));
if (ajaxResult.isSuccess()) { if (ajaxResult.isSuccess()) {
//作废作业 //作废作业
InvalidMydoJob(rwh, ddj.getId()); InvalidMydoJob(rwh, ddj.getId());
//删除队列
ddjDeviceExecutionQueueService.deleteDdjDeviceExecutionQueueByUuid(ddjDeviceExecutionQueue.getUuid());
} }
} }
} }
@@ -180,7 +179,7 @@ public class DdjThread implements Runnable {
if (ObjUtil.isNotNull(mydoJob) && "2".equals(mydoJob.getFaultFlag())) { if (ObjUtil.isNotNull(mydoJob) && "2".equals(mydoJob.getFaultFlag())) {
//判断任务是否重分完成 //判断任务是否重分完成
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh,ddj.getId()); DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh,ddj.getId());
if (ObjUtil.isNotNull(ddjDeviceExecutionQueue) && "0".equals(ddjDeviceExecutionQueue.getSpare1())) { if (ObjUtil.isNotNull(ddjDeviceExecutionQueue) && "0".equals(ddjDeviceExecutionQueue.getDdjxf())) {
//重新下发堆垛机任务 //重新下发堆垛机任务
int i = issuedDDJTask(ddj.getId(), ddjDeviceExecutionQueue); int i = issuedDDJTask(ddj.getId(), ddjDeviceExecutionQueue);
if (i == 1) { if (i == 1) {
@@ -190,9 +189,9 @@ public class DdjThread implements Runnable {
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue); ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
mydoJob.setFaultFlag("0"); mydoJob.setFaultFlag("0");
mydoJobService.updateMydoJob(mydoJob); mydoJobService.updateMydoJob(mydoJob);
log.info("托盘堆垛机重新下发任务成功 rwh:{}", rwh); log.info("堆垛机放货目标有货,重分货位下发任务成功 rwh:{}", rwh);
} else { } else {
log.error("托盘堆垛机重新下发任务失败!!!!!!!"); log.error("堆垛机放货目标有货,重分货位下发任务失败!!!!!!!");
} }
} }
} }
@@ -224,9 +223,9 @@ public class DdjThread implements Runnable {
ddjDeviceExecutionQueue.setXfsj(DateUtil.formatDateTime(DateUtil.date())); ddjDeviceExecutionQueue.setXfsj(DateUtil.formatDateTime(DateUtil.date()));
ddjDeviceExecutionQueue.setDdjxf("1"); ddjDeviceExecutionQueue.setDdjxf("1");
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue); ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
log.info("托盘堆垛机下发任务成功 rwh:{}", ddjDeviceExecutionQueue.getRwh()); log.info("堆垛机下发任务成功 rwh:{}", ddjDeviceExecutionQueue.getRwh());
} else { } else {
log.error("托盘堆垛机下发任务失败!!!!!!!"); log.error("堆垛机下发任务失败!!!!!!!");
} }
} }
} }

View File

@@ -99,18 +99,30 @@ public class Floor1BothWayInSsjThread implements Runnable {
if (ssj.getDw() == 1 && ssj.getTaskNo() > 1000) { if (ssj.getDw() == 1 && ssj.getTaskNo() > 1000) {
int taskNo = ssj.getTaskNo(); int taskNo = ssj.getTaskNo();
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(taskNo)); MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(taskNo));
if (ObjUtil.isNotNull(mydoJob) && TASK_STATUS_CREATE.equals(mydoJob.getStatus()) if(ObjUtil.isNotNull(mydoJob) && Convert.toInt(mydoJob.getInOrOut()) < 20){
&& TASK_EP_SSJ.equals(mydoJob.getExecutionPhase()) && Convert.toInt(mydoJob.getInOrOut()) < 20) { if (TASK_STATUS_CREATE.equals(mydoJob.getStatus())
&& TASK_EP_SSJ.equals(mydoJob.getExecutionPhase())) {
//修改作业执行状态 //修改作业执行状态
mydoJob.setStatus(TASK_STATUS_RUNNING); mydoJob.setStatus(TASK_STATUS_RUNNING);
mydoJob.setStartTime(DateUtil.formatDateTime(DateUtil.date())); mydoJob.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
mydoJobService.updateMydoJob(mydoJob); mydoJobService.updateMydoJob(mydoJob);
} }
if (ObjUtil.isNotNull(mydoJob) && mydoJob.getExecutionPhase().equals(TASK_EP_SSJ)) { if(mydoJob.getCargoSpaceId() == null || "".equals(mydoJob.getCargoSpaceId())){
AjaxResult ajaxResult = apiService.requestWmsSpace(mydoJob);
if(ajaxResult.isSuccess()){
BasCargoSpace space = BeanUtil.toBean(ajaxResult.get("data"), BasCargoSpace.class);
String cargoSpaceId = space.getCargoSpaceId();
mydoJob.setCargoSpaceId(cargoSpaceId);
mydoJobService.updateMydoJob(mydoJob);
}
}
if(mydoJob.getCargoSpaceId()!=null && !"".equals(mydoJob.getCargoSpaceId())){
if(mydoJob.getExecutionPhase().equals(TASK_EP_SSJ)){
mydoJob.setExecutionPhase(TASK_EP_ROADWAY_SSJ); mydoJob.setExecutionPhase(TASK_EP_ROADWAY_SSJ);
mydoJobService.updateMydoJob(mydoJob); mydoJobService.updateMydoJob(mydoJob);
} }
if (ObjUtil.isNotNull(mydoJob) && mydoJob.getExecutionPhase().equals(TASK_EP_ROADWAY_SSJ) && Convert.toInt(mydoJob.getInOrOut()) < 20) {
if(mydoJob.getExecutionPhase().equals(TASK_EP_ROADWAY_SSJ)){
List<DdjDeviceExecutionQueue> ddjDeviceExecutionQueues = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueListByRwlx(DDJ_RWLX_3, Convert.toInt(mydoJob.getRoadwayId())); List<DdjDeviceExecutionQueue> ddjDeviceExecutionQueues = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueListByRwlx(DDJ_RWLX_3, Convert.toInt(mydoJob.getRoadwayId()));
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId()); BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
List<Integer> pclList = roadwayMap.get(ssj.getDeviceCode()); List<Integer> pclList = roadwayMap.get(ssj.getDeviceCode());
@@ -140,12 +152,13 @@ public class Floor1BothWayInSsjThread implements Runnable {
} }
} }
} }
}
}
private void dispatch2(DeviceSsj ssj) { private void dispatch2(DeviceSsj ssj) {
if (ssj.getRkqq() == 1 && ssj.getTaskNo() > 0 && ssj.getTaskNo() < 1000 ) { if (ssj.getRkqq() == 1 && ssj.getTaskNo() > 0 && ssj.getTaskNo() < 1000 && StrUtil.isEmpty(ssj.getTrayCode())) {
//先检测有没有出库作业,有出库作业直接退回 //先检测有没有出库作业,有出库作业直接退回
MydoJob outMydoJob = mydoJobService.selectRunningMydoJobByExitList(Collections.singletonList(ssj.getDeviceCode())); MydoJob outMydoJob = mydoJobService.selectRunningMydoJobByExitList(Collections.singletonList(ssj.getDeviceCode()));
// || StrUtil.isEmpty(ssj.getTrayCode())
if (ObjUtil.isNotNull(outMydoJob)) { if (ObjUtil.isNotNull(outMydoJob)) {
//下发去向 和任务号 //下发去向 和任务号
int i = writeToSsj(ssj.getPlcDbWriteAddress(), "99", 2, 2); int i = writeToSsj(ssj.getPlcDbWriteAddress(), "99", 2, 2);
@@ -175,6 +188,7 @@ public class Floor1BothWayInSsjThread implements Runnable {
inJob.setStatus(TASK_STATUS_CREATE); inJob.setStatus(TASK_STATUS_CREATE);
inJob.setExecutionPhase(TASK_EP_CREATE); inJob.setExecutionPhase(TASK_EP_CREATE);
inJob.setFaultFlag("0"); inJob.setFaultFlag("0");
inJob.setPriority(Long.valueOf(10));
mydoJobService.insertMydoJob(inJob); mydoJobService.insertMydoJob(inJob);
log.info("托盘码请求作业成功, rwh:{},trayCode:{}", ssj.getTaskNo(), ssj.getTrayCode()); log.info("托盘码请求作业成功, rwh:{},trayCode:{}", ssj.getTaskNo(), ssj.getTrayCode());
}else{ }else{
@@ -203,52 +217,53 @@ public class Floor1BothWayInSsjThread implements Runnable {
log.info("托盘码请求作业失败,下发回退 rwh:{},qx:{},trayCode:{}", ssj.getTaskNo(), 2, ssj.getTrayCode()); log.info("托盘码请求作业失败,下发回退 rwh:{},qx:{},trayCode:{}", ssj.getTaskNo(), 2, ssj.getTrayCode());
} }
} }
}else {
//查询下发的任务
MydoJob param = new MydoJob();
ArrayList<String> epList = new ArrayList<>();
epList.add(TASK_EP_CREATE);
epList.add(TASK_EP_SSJ);
param.setEpList(epList);
param.setStatus(TASK_STATUS_CREATE);
param.setEntranceId(ssj.getDeviceCode());
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobList(param);
if (CollUtil.isNotEmpty(mydoJobs)){
//已请求wms,生成任务,二次下发
MydoJob mydoJob = mydoJobs.get(0);
int i = writeToSsj(ssj.getPlcDbWriteAddress(),mydoJob.getTaskNo(),1,1);
if (i == 1) {
mydoJob.setExecutionPhase(TASK_EP_SSJ);
mydoJobService.updateMydoJob(mydoJob);
log.info("{}无条码请求作业,二次下发任务号{}:",ssj.getDeviceCode(),mydoJob.getTaskNo());
}
}else {
//不存在扫不到托盘码的任务
HashMap<String, Object> paramMap = new HashMap<>();
paramMap.put("entranceId",ssj.getDeviceCode());
AjaxResult ajaxResult = apiService.selectMydoJobByNoTrayCode(paramMap);
if (ajaxResult.isSuccess()) {
MydoJob mydoJob2 = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class);
mydoJob2.setExecutionPhase(TASK_EP_CREATE);
mydoJob2.setFaultFlag("0");
mydoJobService.insertMydoJob(mydoJob2);
int i = writeToSsj(ssj.getPlcDbWriteAddress(),mydoJob2.getTaskNo(),1,1);
if (i == 1) {
mydoJob2.setExecutionPhase(TASK_EP_SSJ);
mydoJobService.updateMydoJob(mydoJob2);
log.info("{}无条码请求作业成功,下发任务号{}:",ssj.getDeviceCode(),mydoJob2.getTaskNo());
}
} else if (ajaxResult.isError()) {
//超大,给plc下发错误信息,等待人工处理
//托盘大小对不上,给plc下发错误信息,等待人工处理
//码不对,给plc下发错误信息,等待人工处理
int i = writeToSsj(ssj.getPlcDbWriteAddress(), "99", Integer.parseInt(ajaxResult.get("code").toString()), 2);
if (i == 1) {
log.info("{}无条码请求作业失败,下发退回{}:",ssj.getDeviceCode(),Integer.parseInt(ajaxResult.get("code").toString()));
}
}
}
} }
// else {
// //查询下发的任务
// MydoJob param = new MydoJob();
// ArrayList<String> epList = new ArrayList<>();
// epList.add(TASK_EP_CREATE);
// epList.add(TASK_EP_SSJ);
// param.setEpList(epList);
// param.setStatus(TASK_STATUS_CREATE);
// param.setEntranceId(ssj.getDeviceCode());
// List<MydoJob> mydoJobs = mydoJobService.selectMydoJobList(param);
// if (CollUtil.isNotEmpty(mydoJobs)){
// //已请求wms,生成任务,二次下发
// MydoJob mydoJob = mydoJobs.get(0);
// int i = writeToSsj(ssj.getPlcDbWriteAddress(),mydoJob.getTaskNo(),1,1);
// if (i == 1) {
// mydoJob.setExecutionPhase(TASK_EP_SSJ);
// mydoJobService.updateMydoJob(mydoJob);
// log.info("{}无条码请求作业,二次下发任务号{}:",ssj.getDeviceCode(),mydoJob.getTaskNo());
// }
// }else {
// //不存在扫不到托盘码的任务
// HashMap<String, Object> paramMap = new HashMap<>();
// paramMap.put("entranceId",ssj.getDeviceCode());
// AjaxResult ajaxResult = apiService.selectMydoJobByNoTrayCode(paramMap);
// if (ajaxResult.isSuccess()) {
// MydoJob mydoJob2 = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class);
// mydoJob2.setExecutionPhase(TASK_EP_CREATE);
// mydoJob2.setFaultFlag("0");
// mydoJobService.insertMydoJob(mydoJob2);
// int i = writeToSsj(ssj.getPlcDbWriteAddress(),mydoJob2.getTaskNo(),1,1);
// if (i == 1) {
// mydoJob2.setExecutionPhase(TASK_EP_SSJ);
// mydoJobService.updateMydoJob(mydoJob2);
// log.info("{}无条码请求作业成功,下发任务号{}:",ssj.getDeviceCode(),mydoJob2.getTaskNo());
// }
// } else if (ajaxResult.isError()) {
// //超大,给plc下发错误信息,等待人工处理
// //托盘大小对不上,给plc下发错误信息,等待人工处理
// //码不对,给plc下发错误信息,等待人工处理
// int i = writeToSsj(ssj.getPlcDbWriteAddress(), "99", Integer.parseInt(ajaxResult.get("code").toString()), 2);
// if (i == 1) {
// log.info("{}无条码请求作业失败,下发退回{}:",ssj.getDeviceCode(),Integer.parseInt(ajaxResult.get("code").toString()));
// }
// }
// }
// }
} }
} }
} }

View File

@@ -166,10 +166,10 @@ public class Floor1BothWayOutSsjThread implements Runnable {
inOutSsj = PlcSsjRead.deviceSsjMap.get("L2006"); inOutSsj = PlcSsjRead.deviceSsjMap.get("L2006");
} }
List<String> exitList = new ArrayList<>(); MydoJob mydoJob = mydoJobService.selectMydoJobByExitList1("1", roadwayId);
exitList.add("1");
MydoJob mydoJob = mydoJobService.selectMydoJobByExitList1(exitList, roadwayId);
MydoJob inJob = mydoJobService.selectMydoJobByEntranceList1(entrance_id); MydoJob inJob = mydoJobService.selectMydoJobByEntranceList1(entrance_id);
// log.info("输送线"+deviceSsj.getDeviceCode()+"空闲:"+ deviceSsj.getKx()+"任务号:"+deviceSsj.getTaskNo());
// log.info("输送线"+inOutSsj.getDeviceCode()+"入出库模式:"+ inOutSsj.getInOrOut());
if (ObjUtil.isNotNull(mydoJob) && deviceSsj.getKx() == 1 && ssj.getKx() == 0 if (ObjUtil.isNotNull(mydoJob) && deviceSsj.getKx() == 1 && ssj.getKx() == 0
&& ObjUtil.isNull(inJob) && inOutSsj.getInOrOut() == 1 && deviceSsj.getTaskNo() == 0) { && ObjUtil.isNull(inJob) && inOutSsj.getInOrOut() == 1 && deviceSsj.getTaskNo() == 0) {
//所有线体为空闲 并且存在出库作业 并且不存在入库作业 //所有线体为空闲 并且存在出库作业 并且不存在入库作业

View File

@@ -99,41 +99,6 @@ public class Floor1SingleSsjThread implements Runnable {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
} }
// for (String type : ssjCodeList.keySet()) {
// //一楼单向巷道口
// if ("outRoadwaySsj".equals(type)) {
// for (String ssjCode : ssjCodeList.get(type)) {
// try {
// if (PlcSsjRead.deviceSsjMap.containsKey(ssjCode)) {
// dispatch(PlcSsjRead.deviceSsjMap.get(ssjCode));
// } else {
// log.error("设备不存在 ssjCode{}", ssjCode);
// }
// } catch (RuntimeException e) {
// log.error(e.getMessage(), e);
// }
//
// }
// }
// if ("outSsj".equals(type)) {
// for (String ssjCode : ssjCodeList.get(type)) {
// try {
// if (PlcSsjRead.deviceSsjMap.containsKey(ssjCode)) {
// dispatch2(PlcSsjRead.deviceSsjMap.get(ssjCode));
// } else {
// log.error("设备不存在 ssjCode{}", ssjCode);
// }
// } catch (RuntimeException e) {
// log.error(e.getMessage(), e);
// }
// }
// }
// }
try { try {
Thread.sleep(1500); Thread.sleep(1500);
} catch (InterruptedException e) { } catch (InterruptedException e) {
@@ -181,8 +146,7 @@ public class Floor1SingleSsjThread implements Runnable {
public void dispatch(DeviceSsj ssj) { public void dispatch(DeviceSsj ssj) {
//如果入库请求1 并且 托盘码不为空 //如果入库请求1 并且 托盘码不为空
if (ssj.getKx() == 1 && ssj.getTaskNo() == 0) { if (ssj.getKx() == 1 && ssj.getTaskNo() == 0) {
List<String> exitList = new ArrayList<>();
exitList.add("1");
String roadwayId = ""; String roadwayId = "";
String entrance_id = ""; String entrance_id = "";
if("L2001".equals(ssj.getDeviceCode())){ if("L2001".equals(ssj.getDeviceCode())){
@@ -194,7 +158,7 @@ public class Floor1SingleSsjThread implements Runnable {
roadwayId = "2"; roadwayId = "2";
entrance_id = "L2008"; entrance_id = "L2008";
} }
MydoJob mydoJob = mydoJobService.selectMydoJobByExitList1(exitList,roadwayId); MydoJob mydoJob = mydoJobService.selectMydoJobByExitList1("1",roadwayId);
if (ObjUtil.isNotNull(mydoJob)) { if (ObjUtil.isNotNull(mydoJob)) {
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId()); BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
if (ObjUtil.isNull(basCargoSpace)) { if (ObjUtil.isNull(basCargoSpace)) {

View File

@@ -134,12 +134,13 @@ public class Floor2InOutSsjThread implements Runnable {
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList1(agvQueue); List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList1(agvQueue);
if (!agvQueues.isEmpty()) { if (!agvQueues.isEmpty()) {
//解绑AGV容器 //解绑AGV容器
apiService.deleteAgvTray(agvQueues.get(0)); AjaxResult ajaxResult = apiService.deleteAgvTray(agvQueues.get(0));
try { if(ajaxResult.isSuccess()) {
Thread.sleep(5000); AgvQueue agvQueue1 = agvQueues.get(0);
} catch (InterruptedException e) { agvQueue1.setStatus("8");
throw new RuntimeException(e); agvQueueService.updateAgvQueue(agvQueue1);
} }
if("L1001".equals(inSsjDevice.getDeviceCode())) { if("L1001".equals(inSsjDevice.getDeviceCode())) {
int i = writeToSsj("DB802.100", agvQueues.get(0).getWmsTaskNo(), 2,Integer.parseInt(agvQueues.get(0).getCtnrCode())); int i = writeToSsj("DB802.100", agvQueues.get(0).getWmsTaskNo(), 2,Integer.parseInt(agvQueues.get(0).getCtnrCode()));
if (i == 1) { if (i == 1) {
@@ -154,12 +155,34 @@ public class Floor2InOutSsjThread implements Runnable {
} }
} }
}else{
AgvQueue agvQueue2 = new AgvQueue();
agvQueue2.setStatus("8"); //end
//todo 与agv对点
agvQueue2.setPositionCode2(inSsjDevice.getDeviceCode());
List<AgvQueue> queueList = agvQueueService.selectAgvQueueList1(agvQueue2);
if (!queueList.isEmpty()) {
if("L1001".equals(inSsjDevice.getDeviceCode())) {
int i = writeToSsj("DB802.100", queueList.get(0).getWmsTaskNo(), 2,Integer.parseInt(queueList.get(0).getCtnrCode()));
if (i == 1) {
log.info("输送机{}AGV放货完成下发任务号{}成功", inSsjDevice.getDeviceCode(), queueList.get(0).getWmsTaskNo());
}
}
if("L1003".equals(inSsjDevice.getDeviceCode())) {
int i = writeToSsj("DB802.112", queueList.get(0).getWmsTaskNo(), 2,Integer.parseInt(queueList.get(0).getCtnrCode()));
if (i == 1) {
log.info("输送机{}AGV放货完成下发任务号{}成功", inSsjDevice.getDeviceCode(), queueList.get(0).getWmsTaskNo());
}
}
}
} }
} }
if(inSsjDevice.getKx() == 0 && inSsjDevice.getTaskNo2() > 0){ if(inSsjDevice.getKx() == 0 && inSsjDevice.getTaskNo2() > 0){
AgvQueue agvQueue = new AgvQueue(); AgvQueue agvQueue = new AgvQueue();
agvQueue.setStatus("7"); //end agvQueue.setStatus("8"); //end
//todo 与agv对点 //todo 与agv对点
agvQueue.setPositionCode2(inSsjDevice.getDeviceCode()); agvQueue.setPositionCode2(inSsjDevice.getDeviceCode());
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList1(agvQueue); List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList1(agvQueue);
@@ -239,6 +262,7 @@ public class Floor2InOutSsjThread implements Runnable {
mydoJob2.setExecutionPhase(TASK_EP_CREATE); mydoJob2.setExecutionPhase(TASK_EP_CREATE);
mydoJob2.setCreateTime(new Date()); mydoJob2.setCreateTime(new Date());
mydoJob2.setFaultFlag("0"); mydoJob2.setFaultFlag("0");
mydoJob2.setPriority(Long.valueOf(10));
mydoJobService.insertMydoJob(mydoJob2); mydoJobService.insertMydoJob(mydoJob2);
int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(),mydoJob2.getTaskNo(),1,1); int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(),mydoJob2.getTaskNo(),1,1);
if (i == 1) { if (i == 1) {
@@ -257,50 +281,50 @@ public class Floor2InOutSsjThread implements Runnable {
} }
} }
if(StrUtil.isBlank(ssjDevice.getTrayCode()) && ssjDevice.getRkqq()==1 && ssjDevice.getTaskNo()<1000){ // if(StrUtil.isBlank(ssjDevice.getTrayCode()) && ssjDevice.getRkqq()==1 && ssjDevice.getTaskNo()<1000){
//
MydoJob mydoJob1 = new MydoJob(); // MydoJob mydoJob1 = new MydoJob();
mydoJob1.setInOrOut("1"); // mydoJob1.setInOrOut("1");
mydoJob1.setEntranceId(ssjDevice.getDeviceCode()); // mydoJob1.setEntranceId(ssjDevice.getDeviceCode());
// mydoJob1.setStatus("1"); //// mydoJob1.setStatus("1");
List<MydoJob> mydoJobs = mydoJobService.selectInOrOutMydoJobList(mydoJob1); // List<MydoJob> mydoJobs = mydoJobService.selectInOrOutMydoJobList(mydoJob1);
if(!mydoJobs.isEmpty()){ // if(!mydoJobs.isEmpty()){
MydoJob mydoJob2 = mydoJobs.get(0); // MydoJob mydoJob2 = mydoJobs.get(0);
int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(),mydoJob2.getTaskNo(),1,1); // int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(),mydoJob2.getTaskNo(),1,1);
if (i == 1) { // if (i == 1) {
mydoJob2.setExecutionPhase(TASK_EP_SSJ); // mydoJob2.setExecutionPhase(TASK_EP_SSJ);
mydoJob2.setStatus("3"); // mydoJob2.setStatus("3");
mydoJobService.updateMydoJob(mydoJob2); // mydoJobService.updateMydoJob(mydoJob2);
log.info(ssjDevice.getDeviceCode()+"输送机下发任务号成功:" + mydoJob2.getTaskNo()); // log.info(ssjDevice.getDeviceCode()+"输送机下发任务号成功:" + mydoJob2.getTaskNo());
} // }
//
}else{ // }else{
HashMap<String, Object> paramMap = new HashMap<>(); // HashMap<String, Object> paramMap = new HashMap<>();
paramMap.put("size", ssjDevice.getTraySize()); // paramMap.put("size", ssjDevice.getTraySize());
paramMap.put("entranceId", ssjDevice.getDeviceCode()); // paramMap.put("entranceId", ssjDevice.getDeviceCode());
AjaxResult ajaxResult = apiService.selectMydoJobByNoTrayCode(paramMap); // AjaxResult ajaxResult = apiService.selectMydoJobByNoTrayCode(paramMap);
if(ajaxResult.isSuccess()){ // if(ajaxResult.isSuccess()){
MydoJob mydoJob2 = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class) ; // MydoJob mydoJob2 = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class) ;
mydoJob2.setStatus("1"); // mydoJob2.setStatus("1");
mydoJob2.setExecutionPhase(TASK_EP_CREATE); // mydoJob2.setExecutionPhase(TASK_EP_CREATE);
mydoJob2.setCreateTime(new Date()); // mydoJob2.setCreateTime(new Date());
mydoJob2.setFaultFlag("0"); // mydoJob2.setFaultFlag("0");
mydoJobService.insertMydoJob(mydoJob2); // mydoJobService.insertMydoJob(mydoJob2);
int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(),mydoJob2.getTaskNo(),1,1); // int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(),mydoJob2.getTaskNo(),1,1);
if (i == 1) { // if (i == 1) {
mydoJob2.setExecutionPhase(TASK_EP_SSJ); // mydoJob2.setExecutionPhase(TASK_EP_SSJ);
mydoJob2.setStatus("3"); // mydoJob2.setStatus("3");
mydoJobService.updateMydoJob(mydoJob2); // mydoJobService.updateMydoJob(mydoJob2);
log.info(ssjDevice.getDeviceCode()+"输送机下发任务号成功:" + mydoJob2.getTaskNo()); // log.info(ssjDevice.getDeviceCode()+"输送机下发任务号成功:" + mydoJob2.getTaskNo());
} // }
}else{ // }else{
int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(), "99", Integer.parseInt(ajaxResult.get("code").toString()), 2); // int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(), "99", Integer.parseInt(ajaxResult.get("code").toString()), 2);
if (i == 1) { // if (i == 1) {
log.info(ssjDevice.getDeviceCode()+"输送机下发错误信息成功"); // log.info(ssjDevice.getDeviceCode()+"输送机下发错误信息成功");
} // }
} // }
} // }
} // }
} }
private static final Map<String, Pattern> PATTERNS = createPatterns(); private static final Map<String, Pattern> PATTERNS = createPatterns();

View File

@@ -1,5 +1,6 @@
package com.ruoyi.schedule.scheduleTask.ssj.floor2; package com.ruoyi.schedule.scheduleTask.ssj.floor2;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
@@ -8,6 +9,7 @@ import cn.hutool.core.util.ObjUtil;
import com.ruoyi.api.service.IApiService; import com.ruoyi.api.service.IApiService;
import com.ruoyi.bas.cargospace.domain.BasCargoSpace; import com.ruoyi.bas.cargospace.domain.BasCargoSpace;
import com.ruoyi.bas.cargospace.service.IBasCargoSpaceService; import com.ruoyi.bas.cargospace.service.IBasCargoSpaceService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.job.domain.JobCallBack; import com.ruoyi.job.domain.JobCallBack;
import com.ruoyi.job.domain.MydoJob; import com.ruoyi.job.domain.MydoJob;
@@ -95,7 +97,18 @@ public class Floor2RoadWaySsjThread implements Runnable {
//如果到位,且任务号大于0 //如果到位,且任务号大于0
if (roadSsjDevice.getDw()==1 && roadSsjDevice.getTaskNo()>1000) { if (roadSsjDevice.getDw()==1 && roadSsjDevice.getTaskNo()>1000) {
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(roadSsjDevice.getTaskNo())); MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(roadSsjDevice.getTaskNo()));
if (ObjUtil.isNotNull(mydoJob) && mydoJob.getExecutionPhase().equals(TASK_EP_SSJ)) { if(ObjUtil.isNotNull(mydoJob)){
if(mydoJob.getCargoSpaceId() == null || "".equals(mydoJob.getCargoSpaceId())){
AjaxResult ajaxResult = apiService.requestWmsSpace(mydoJob);
if(ajaxResult.isSuccess()){
BasCargoSpace space = BeanUtil.toBean(ajaxResult.get("data"), BasCargoSpace.class);
String cargoSpaceId = space.getCargoSpaceId();
mydoJob.setCargoSpaceId(cargoSpaceId);
mydoJobService.updateMydoJob(mydoJob);
}
}
if(mydoJob.getCargoSpaceId()!=null && !"".equals(mydoJob.getCargoSpaceId())){
if(mydoJob.getExecutionPhase().equals(TASK_EP_SSJ)){
mydoJob.setExecutionPhase(TASK_EP_ROADWAY_SSJ); mydoJob.setExecutionPhase(TASK_EP_ROADWAY_SSJ);
mydoJobService.updateMydoJob(mydoJob); mydoJobService.updateMydoJob(mydoJob);
} }
@@ -129,18 +142,30 @@ public class Floor2RoadWaySsjThread implements Runnable {
} }
} }
} }
}
}
if(roadSsjDevice.getKx()==1 && roadSsjDevice.getTaskNo() == 0){ if(roadSsjDevice.getKx()==1 && roadSsjDevice.getTaskNo() == 0){
List<String> exitList = new ArrayList<>(); // List<String> exitList = new ArrayList<>();
// if("L1002".equals(roadSsjDevice.getDeviceCode())){
// exitList.add("L1001");
// }
// if("L1004".equals(roadSsjDevice.getDeviceCode())){
// exitList.add("L1003");
// }
// List<MydoJob> inList = mydoJobService.getInJobByEntrance(exitList);
String exitId = "";
if("L1002".equals(roadSsjDevice.getDeviceCode())){ if("L1002".equals(roadSsjDevice.getDeviceCode())){
exitList.add("L1001"); exitId = "L1001";
} }
if("L1004".equals(roadSsjDevice.getDeviceCode())){ if("L1004".equals(roadSsjDevice.getDeviceCode())){
exitList.add("L1003"); exitId = "L1003";
} }
List<MydoJob> inList = mydoJobService.getInJobByEntrance(exitList);
List<MydoJob> inList = mydoJobService.getInJobByEntranceId(exitId);
if(inList.size() == 0){ if(inList.size() == 0){
MydoJob mydoJob = mydoJobService.selectMydoJobByExitList(exitList); // MydoJob mydoJob = mydoJobService.selectMydoJobByExitList(exitList);
MydoJob mydoJob = mydoJobService.selectMydoJobByExitId(exitId);
if (ObjUtil.isNotNull(mydoJob)) { if (ObjUtil.isNotNull(mydoJob)) {
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId()); BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
if (ObjUtil.isNull(basCargoSpace)) { if (ObjUtil.isNull(basCargoSpace)) {
@@ -178,7 +203,7 @@ public class Floor2RoadWaySsjThread implements Runnable {
} }
} }
}else{ }else{
log.info("当前出口"+ exitList+"存在入库任务,无法出库!"); log.info("当前出口"+ exitId+"存在入库任务,无法出库!");
} }
} }

View File

@@ -135,6 +135,7 @@ public class LineSsjThread implements Runnable {
mydoJob2.setCreateTime(new Date()); mydoJob2.setCreateTime(new Date());
mydoJob2.setTraySize(Convert.toStr(SsjDevice.getTraySize())); mydoJob2.setTraySize(Convert.toStr(SsjDevice.getTraySize()));
mydoJob2.setFaultFlag("0"); mydoJob2.setFaultFlag("0");
mydoJob2.setPriority(Long.valueOf(10));
mydoJobService.insertMydoJob(mydoJob2); mydoJobService.insertMydoJob(mydoJob2);
int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), mydoJob2.getTaskNo(), Integer.parseInt(mydoJob2.getTraySize()), 1); int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), mydoJob2.getTaskNo(), Integer.parseInt(mydoJob2.getTraySize()), 1);
if (i == 1) { if (i == 1) {
@@ -154,27 +155,12 @@ public class LineSsjThread implements Runnable {
* 8, "没有可用货位!" * 8, "没有可用货位!"
* 9, "创建工艺入库单失败!" * 9, "创建工艺入库单失败!"
*/ */
//超大,给plc下发错误信息,AGV搬到缓存区 其余人工处理
// if ((Integer) ajaxResult.get("code") == 5) {
// int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), "2222", 1, 1);
// if (i == 1) {
// log.info("G1005产线输送机下发超大托盘处理成功");
// }
// createMoveToPort(SsjDevice);
// } else {
// int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), "99", Integer.parseInt(ajaxResult.get("code").toString()), 2);
// if (i == 1) {
// log.info("G1005产线输送机下发错误信息成功");
// }
// }
} }
} }
} }
if (SsjDevice.getRkqq() == 1 && StrUtil.isBlank(SsjDevice.getTrayCode()) && if (SsjDevice.getRkqq() == 1 && StrUtil.isBlank(SsjDevice.getTrayCode()) &&
SsjDevice.getTraySize() != 0 && SsjDevice.getTaskNo() < 1000) { SsjDevice.getTraySize() != 0 && SsjDevice.getTaskNo() < 1000) {
//log.info("设备:{} 位置:{} 条码:{} 托盘大小:{}", SsjDevice.getDeviceCode(), "产线", SsjDevice.getTrayCode(), SsjDevice.getTraySize());
//查wcs有没作业,有下发给输送机任务号,覆盖任务号 //查wcs有没作业,有下发给输送机任务号,覆盖任务号
MydoJob mydoJob = new MydoJob(); MydoJob mydoJob = new MydoJob();
mydoJob.setInOrOut("1"); mydoJob.setInOrOut("1");
@@ -206,6 +192,7 @@ public class LineSsjThread implements Runnable {
mydoJob2.setCreateTime(new Date()); mydoJob2.setCreateTime(new Date());
mydoJob2.setTraySize(Convert.toStr(SsjDevice.getTraySize())); mydoJob2.setTraySize(Convert.toStr(SsjDevice.getTraySize()));
mydoJob2.setFaultFlag("0"); mydoJob2.setFaultFlag("0");
mydoJob2.setPriority(Long.valueOf(10));
mydoJobService.insertMydoJob(mydoJob2); mydoJobService.insertMydoJob(mydoJob2);
int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), mydoJob2.getTaskNo(), 1, 1); int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), mydoJob2.getTaskNo(), 1, 1);
if (i == 1) { if (i == 1) {
@@ -219,19 +206,6 @@ public class LineSsjThread implements Runnable {
//超大,给plc下发错误信息,等待人工处理 //超大,给plc下发错误信息,等待人工处理
//托盘大小对不上,给plc下发错误信息,等待人工处理 //托盘大小对不上,给plc下发错误信息,等待人工处理
//码不对,给plc下发错误信息,等待人工处理 //码不对,给plc下发错误信息,等待人工处理
// if ((Integer) ajaxResult.get("code") == 5) {
// int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), "2222", 1, 1);
// if (i == 1) {
// log.info("G1005产线输送机下发错误信息成功");
// }
// createMoveToPort(SsjDevice);
// } else {
// int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), "99", Integer.parseInt(ajaxResult.get("code").toString()), 2);
// if (i == 1) {
// log.info("G1005产线输送机下发错误信息成功");
// }
// }
} }
} }
@@ -342,39 +316,6 @@ public class LineSsjThread implements Runnable {
} }
void createMoveToPort(DeviceSsj SsjDevice) {
WcsPort wcsPort = new WcsPort();
wcsPort.setStatus("1");
List<WcsPort> wcsPorts = wcsPortService.selectWcsPortList(wcsPort);
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList(new AgvQueue());
//检查agvQueues中是否有任何一个positionCode2是wcsPorts中的portCode
boolean hasMatchingPort = agvQueues.stream()
.map(AgvQueue::getPositionCode2)
.anyMatch(positionCode2 -> wcsPorts.stream()
.map(WcsPort::getPortCode)
.anyMatch(portCode -> portCode.equals(positionCode2)));
if (hasMatchingPort == false) {
if (!wcsPorts.isEmpty()) {
HashMap<String, String> map = new HashMap<>();
// map.put("trayCode", mydoJob.getTrayCode());
map.put("taskNo", StrUtil.uuid());
//todo 与agv对点
map.put("startPoint", "G1005");
map.put("endPoint", wcsPorts.get(0).getPortCode());
map.put("traySize", "5");
// map.put("wmsTaskNo", mydoJob.getTaskNo());
AjaxResult ajaxResult1 = apiService.receiveAgvMoveJob(map);
if (ajaxResult1.isSuccess()) {
log.info("G1005产线生成作业失败,AGV下发搬运至缓存点任务成功:{}", ajaxResult1.get("data"));
}
}
}
}
private static final Map<String, Pattern> PATTERNS = createPatterns(); private static final Map<String, Pattern> PATTERNS = createPatterns();
private static Map<String, Pattern> createPatterns() { private static Map<String, Pattern> createPatterns() {

View File

@@ -111,19 +111,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
and in_or_out &gt; 20 and in_or_out &gt; 20
and status = 1 and execution_phase= 0 and status = 1 and execution_phase= 0
order by priority desc,create_time order by priority asc,create_time
</select> </select>
<select id="selectMydoJobByExitList1" resultMap="MydoJobResult"> <select id="selectMydoJobByExitList1" resultMap="MydoJobResult">
select TOP 1 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,flag,tray_code,tray_size from mydo_job_wcs select TOP 1 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,flag,tray_code,tray_size from mydo_job_wcs
where exit_id in where exit_id = #{exitId}
<foreach item="item" index="index" collection="exitList" separator="," open="(" close=")">
#{item}
</foreach>
and roadway_id = #{roadwayId} and roadway_id = #{roadwayId}
and in_or_out &gt; 20 and in_or_out &gt; 20
and status = 1 and execution_phase= 0 and status = 1 and execution_phase= 0
order by priority desc,create_time order by priority asc,create_time
</select> </select>
<insert id="insertMydoJob" parameterType="MydoJob"> <insert id="insertMydoJob" parameterType="MydoJob">
@@ -249,15 +246,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item} #{item}
</foreach> </foreach>
and in_or_out &lt;= 20 and status = 3 and in_or_out &lt;= 20 and status = 3
order by priority desc,create_time desc order by priority asc,create_time asc
</select> </select>
<select id="selectMydoJobByEntranceList1" resultMap="MydoJobResult"> <select id="selectMydoJobByEntranceList1" resultMap="MydoJobResult">
select TOP 1 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,flag, tray_code from mydo_job_wcs select TOP 1 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,flag, tray_code from mydo_job_wcs
where entrance_id = #{entranceId} where entrance_id = #{entranceId}
and in_or_out &lt;= 20 and status = 3 and in_or_out &lt;= 20 and status = 3
order by priority desc,create_time desc order by priority asc,create_time asc
</select>
<select id="getInJobByEntranceId" parameterType="java.lang.String" resultMap="MydoJobResult">
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,flag, tray_code from mydo_job_wcs
where entrance_id = #{entranceId}
and in_or_out &lt;= 20 and status = 3
order by priority asc,create_time asc
</select>
<select id="selectMydoJobByExitId" parameterType="java.lang.String" resultMap="MydoJobResult">
select TOP 1 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,flag, tray_code from mydo_job_wcs
where exit_id = #{exitId}
and in_or_out &gt; 20
and status = 1 and execution_phase= 0
order by priority asc,create_time asc
</select> </select>
<select id="selectMydoJobFinishList" resultMap="MydoJobResult"> <select id="selectMydoJobFinishList" resultMap="MydoJobResult">
@@ -291,7 +302,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
and in_or_out &gt; 20 and in_or_out &gt; 20
and status = 3 and status = 3
order by priority desc,create_time order by priority asc,create_time
</select> </select>
<select id="getInJobByEntrance" resultMap="MydoJobResult"> <select id="getInJobByEntrance" resultMap="MydoJobResult">

View File

@@ -77,12 +77,12 @@
<el-table-column label="任务类型" align="center" prop="taskType" /> <el-table-column label="任务类型" align="center" prop="taskType" />
<el-table-column label="容器类型" align="center" prop="ctnrType" /> <el-table-column label="容器类型" align="center" prop="ctnrType" />
<el-table-column label="容器编号" align="center" prop="ctnrCode" /> <el-table-column label="容器编号" align="center" prop="ctnrCode" />
<el-table-column label="容器数量" align="center" prop="ctnrNum" /> <!-- <el-table-column label="容器数量" align="center" prop="ctnrNum" />-->
<el-table-column label="任务模式" align="center" prop="taskMode" /> <!-- <el-table-column label="任务模式" align="center" prop="taskMode" />-->
<el-table-column label="优先级" align="center" prop="priority" /> <el-table-column label="优先级" align="center" prop="priority" />
<el-table-column label="设备类型" align="center" prop="agvType" /> <el-table-column label="设备类型" align="center" prop="agvType" />
<el-table-column label="继续请求" align="center" prop="request" /> <!-- <el-table-column label="继续请求" align="center" prop="request" />-->
<el-table-column label="结束时间" align="center" prop="finishTime" /> <!-- <el-table-column label="结束时间" align="center" prop="finishTime" />-->
<el-table-column label="wms托盘码" align="center" prop="wmsTraycode" /> <el-table-column label="wms托盘码" align="center" prop="wmsTraycode" />
<el-table-column label="wms任务号" align="center" prop="wmsTaskNo" /> <el-table-column label="wms任务号" align="center" prop="wmsTaskNo" />
<el-table-column label="任务单号" align="center" prop="taskCode" /> <el-table-column label="任务单号" align="center" prop="taskCode" />

View File

@@ -64,6 +64,11 @@
<el-table-column label="设备编码" prop="deviceCode"/> <el-table-column label="设备编码" prop="deviceCode"/>
<!-- <el-table-column label="设备名称" prop="name"/>--> <!-- <el-table-column label="设备名称" prop="name"/>-->
<el-table-column label="任务号" prop="taskNo"/> <el-table-column label="任务号" prop="taskNo"/>
<el-table-column label="请求" prop="rkqq">
<template slot-scope="scope">
<dict-tag :options="dict.type.ssj_rkqq" :value="scope.row.rkqq"/>
</template>
</el-table-column>
<el-table-column label="到位" prop="dw"> <el-table-column label="到位" prop="dw">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.ssj_dw" :value="scope.row.dw"/> <dict-tag :options="dict.type.ssj_dw" :value="scope.row.dw"/>
@@ -74,9 +79,9 @@
<dict-tag :options="dict.type.ssj_kx" :value="scope.row.kx"/> <dict-tag :options="dict.type.ssj_kx" :value="scope.row.kx"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" prop="exception"> <el-table-column label="状态" prop="sszt">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.ssj_ex" :value="scope.row.exception"/> <dict-tag :options="dict.type.ssj_ex" :value="scope.row.sszt"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="托盘尺寸" prop="traySize" > <el-table-column label="托盘尺寸" prop="traySize" >
@@ -111,9 +116,9 @@
<dict-tag :options="dict.type.ssj_kx" :value="scope.row.kx"/> <dict-tag :options="dict.type.ssj_kx" :value="scope.row.kx"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" prop="exception"> <el-table-column label="状态" prop="sszt">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.ssj_ex" :value="scope.row.exception"/> <dict-tag :options="dict.type.ssj_ex" :value="scope.row.sszt"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="允许放货" prop="allowPut" > <el-table-column label="允许放货" prop="allowPut" >
@@ -146,9 +151,9 @@
<dict-tag :options="dict.type.ssj_kx" :value="scope.row.kx"/> <dict-tag :options="dict.type.ssj_kx" :value="scope.row.kx"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" prop="exception"> <el-table-column label="状态" prop="sszt">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.ssj_ex" :value="scope.row.exception"/> <dict-tag :options="dict.type.ssj_ex" :value="scope.row.sszt"/>
</template> </template>
</el-table-column> </el-table-column>
@@ -204,9 +209,9 @@
<dict-tag :options="dict.type.ssj_kx" :value="scope.row.kx"/> <dict-tag :options="dict.type.ssj_kx" :value="scope.row.kx"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" prop="exception"> <el-table-column label="状态" prop="sszt">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.ssj_ex" :value="scope.row.exception"/> <dict-tag :options="dict.type.ssj_ex" :value="scope.row.sszt"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="托盘码" prop="trayCode" width="600"/> <el-table-column label="托盘码" prop="trayCode" width="600"/>
@@ -237,9 +242,9 @@
<dict-tag :options="dict.type.ssj_kx" :value="scope.row.kx"/> <dict-tag :options="dict.type.ssj_kx" :value="scope.row.kx"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" prop="exception"> <el-table-column label="状态" prop="sszt">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.ssj_ex" :value="scope.row.exception"/> <dict-tag :options="dict.type.ssj_ex" :value="scope.row.sszt"/>
</template> </template>
</el-table-column> </el-table-column>
@@ -268,9 +273,9 @@
<dict-tag :options="dict.type.ssj_kx" :value="scope.row.kx"/> <dict-tag :options="dict.type.ssj_kx" :value="scope.row.kx"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" prop="exception"> <el-table-column label="状态" prop="sszt">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.ssj_ex" :value="scope.row.exception"/> <dict-tag :options="dict.type.ssj_ex" :value="scope.row.sszt"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -291,7 +296,7 @@ import { listDeviceCar, getDeviceCar, delDeviceCar, addDeviceCar, updateDeviceCa
export default { export default {
name: "deviceMonitor", name: "deviceMonitor",
dicts: ['ddj_task_status', 'ddj_sbzt', 'ddj_czfs', 'ddj_yxxf', 'ddj_hczt', 'ssj_dw', 'ssj_kx', 'ssj_ex','ssj_allow_put','tray_size'], dicts: ['ddj_task_status', 'ddj_sbzt', 'ddj_czfs', 'ddj_yxxf', 'ddj_hczt', 'ssj_dw', 'ssj_kx', 'ssj_ex','ssj_allow_put','tray_size','ssj_rkqq'],
data() { data() {
return { return {
// 查询参数 // 查询参数
@@ -315,7 +320,7 @@ export default {
this.initMockData() this.initMockData()
}, },
mounted() { mounted() {
this.timer = setInterval(() => {x this.timer = setInterval(() => {
this.initMockData(); this.initMockData();
}, 1000); // 每1秒刷新一次 }, 1000); // 每1秒刷新一次
}, },

View File

@@ -19,14 +19,14 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="巷道ID" prop="roadwayId">--> <el-form-item label="巷道ID" prop="roadwayId">
<!-- <el-input--> <el-input
<!-- v-model="queryParams.roadwayId"--> v-model="queryParams.roadwayId"
<!-- placeholder="请输入巷道ID"--> placeholder="请输入巷道ID"
<!-- clearable--> clearable
<!-- @keyup.enter.native="handleQuery"--> @keyup.enter.native="handleQuery"
<!-- />--> />
<!-- </el-form-item>--> </el-form-item>
<!-- <el-form-item label="货位ID" prop="cargoSpaceId">--> <!-- <el-form-item label="货位ID" prop="cargoSpaceId">-->
<!-- <el-input--> <!-- <el-input-->
<!-- v-model="queryParams.cargoSpaceId"--> <!-- v-model="queryParams.cargoSpaceId"-->
@@ -155,8 +155,8 @@
<el-table-column label="任务号" align="center" prop="taskNo" /> <el-table-column label="任务号" align="center" prop="taskNo" />
<el-table-column label="巷道ID" align="center" prop="roadwayId" /> <el-table-column label="巷道ID" align="center" prop="roadwayId" />
<el-table-column label="货位ID" align="center" prop="cargoSpaceId" /> <el-table-column label="货位ID" align="center" prop="cargoSpaceId" />
<el-table-column label="去向" align="center" prop="targetRoadwayId" /> <el-table-column label="序列号" align="center" prop="trayCode" />
<!-- <el-table-column label="优先级" align="center" prop="priority" />--> <el-table-column label="优先级" align="center" prop="priority" />
<el-table-column label="执行阶段" align="center" prop="executionPhase" > <el-table-column label="执行阶段" align="center" prop="executionPhase" >
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.job_ep" :value="scope.row.executionPhase"/> <dict-tag :options="dict.type.job_ep" :value="scope.row.executionPhase"/>
@@ -198,50 +198,34 @@
/> />
<!-- 添加或修改作业信息对话框 --> <!-- 添加或修改作业信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="400px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="任务号" prop="taskNo"> <el-form-item label="任务号" prop="taskNo">
<el-input v-model="form.taskNo" placeholder="请输入任务号" /> <el-input v-model="form.taskNo" placeholder="请输入任务号" style="width: 220px"/>
</el-form-item> </el-form-item>
<!-- <el-form-item label="巷道ID" prop="roadwayId">-->
<!-- <el-input v-model="form.roadwayId" placeholder="请输入巷道ID" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="货位ID" prop="cargoSpaceId">-->
<!-- <el-input v-model="form.cargoSpaceId" placeholder="请输入货位ID" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="去向" prop="targetRoadwayId">-->
<!-- <el-input v-model="form.targetRoadwayId" placeholder="请输入去向" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="目标货位ID" prop="targetCargoSpaceId">
<el-input v-model="form.targetCargoSpaceId" placeholder="请输入目标货位ID" />
</el-form-item>-->
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-input v-model="form.priority" placeholder="请修改状态" /> <el-select v-model="form.status" placeholder="请修改状态" >
<el-option
v-for="dict in dict.type.job_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="执行阶段" prop="executionPhase"> <el-form-item label="执行阶段" prop="executionPhase">
<el-input v-model="form.executionPhase" placeholder="请修改执行阶段" /> <el-select v-model="form.executionPhase" placeholder="请修改执行阶段">
<el-option
v-for="dict in dict.type.job_ep"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="优先级" prop="priority">
<el-input v-model="form.priority" placeholder="请输入优先级" type="number" style="width: 220px"/>
</el-form-item> </el-form-item>
<!-- <el-form-item label="任务类型" prop="inOrOut">-->
<!-- <el-input v-model="form.inOrOut" placeholder="请输入任务类型" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="开始时间" prop="startTime">-->
<!-- <el-input v-model="form.startTime" placeholder="请输入开始时间" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="结束时间" prop="finishTime">-->
<!-- <el-input v-model="form.finishTime" placeholder="请输入结束时间" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="入口ID" prop="entranceId">-->
<!-- <el-input v-model="form.entranceId" placeholder="请输入入口ID" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="出口ID" prop="exitId">-->
<!-- <el-input v-model="form.exitId" placeholder="请输入出口ID" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="仓库ID" prop="warehouseId">-->
<!-- <el-input v-model="form.warehouseId" placeholder="请输入仓库ID" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="重分标志" prop="faultFlag">-->
<!-- <el-input v-model="form.faultFlag" placeholder="请输入重分标志" />-->
<!-- </el-form-item>-->
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button> <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -295,7 +279,8 @@ export default {
entranceId: null, entranceId: null,
exitId: null, exitId: null,
warehouseId: null, warehouseId: null,
faultFlag: null faultFlag: null,
trayCode: null
}, },
// 表单参数 // 表单参数
form: {}, form: {},
@@ -356,7 +341,8 @@ export default {
entranceId: null, entranceId: null,
exitId: null, exitId: null,
warehouseId: null, warehouseId: null,
faultFlag: null faultFlag: null,
trayCode: null
} }
this.resetForm("form") this.resetForm("form")
}, },