diff --git a/shkj-admin/src/main/resources/logback.xml b/shkj-admin/src/main/resources/logback.xml index 0d655da..e4a1813 100644 --- a/shkj-admin/src/main/resources/logback.xml +++ b/shkj-admin/src/main/resources/logback.xml @@ -7,7 +7,7 @@ logback - + diff --git a/shkj-wms/src/main/java/com/shkj/wcs/third/stacker/StkCallUtil.java b/shkj-wms/src/main/java/com/shkj/wcs/third/stacker/StkCallUtil.java index 2d7d305..7535c8c 100644 --- a/shkj-wms/src/main/java/com/shkj/wcs/third/stacker/StkCallUtil.java +++ b/shkj-wms/src/main/java/com/shkj/wcs/third/stacker/StkCallUtil.java @@ -66,7 +66,7 @@ public class StkCallUtil { * @param stkMoveBo * @return */ - public Result outTask(STKMoveBo stkMoveBo) throws InterruptedException { + public Result outTask(STKMoveBo stkMoveBo,Integer layer) throws InterruptedException { //下发任务时,先查询是否有正在执行的入库任务,如果有,则不下发出库任务 Object taskInId = redisTemplate.opsForValue().get(RedisConstant.redisTaskIn); if (taskInId !=null ){ @@ -75,25 +75,19 @@ public class StkCallUtil { } Object oneTaskOutId = redisTemplate.opsForValue().get(RedisConstant.redisTaskOutOne); - if (oneTaskOutId !=null ){ + if (oneTaskOutId !=null && layer==1){ log.info("1F有出库任务在执行,无法下发出库任务:"+oneTaskOutId); return Result.err().msg("1F有出库任务在执行,无法下发出库任务"); } Object twoTaskOutId = redisTemplate.opsForValue().get(RedisConstant.redisTaskOutTwo); - if (twoTaskOutId !=null ){ + if (twoTaskOutId !=null && layer==2){ log.info("2F有出库任务在执行,无法下发出库任务:"+twoTaskOutId); return Result.err().msg("2F有出库任务在执行,无法下发出库任务"); } Long taskId = stkMoveBo.getTaskId(); SysThirdExceptionRequest one = sysThirdExceptionRequestService.getOneByOrderNo(taskId.toString()); -// if (one != null){ -// if (!one.getCode().equals(taskId.toString())){ -// log.info("有更早未执行的任务,排队执行:"+JsonUtil.toJSONString(one)); -// return Result.err().msg("有更早未执行的任务,排队执行"); -// } -// } String fromLayer = stkMoveBo.getFromLayer(); String fromColumn = stkMoveBo.getFromColumn(); @@ -139,7 +133,6 @@ public class StkCallUtil { twoDpsidle = dpsProperty.getAddress(); } } - if (dpsPointMap.containsKey(oneDpsidle)){ oneDpsidleV = dpsPointMap.get(oneDpsidle).toString(); } @@ -151,7 +144,7 @@ public class StkCallUtil { log.info(taskId+"1楼是否允许出库::"+oneDpsidle+" 出库的值:"+oneDpsidleV); log.info(taskId+"2楼是否允许出库::"+twoDpsidle+" 出库的值:"+twoDpsidleV); //出库的站台 - Integer layer =stkMoveBo.getLayer(); + layer =stkMoveBo.getLayer(); if (layer==1){ //false不允许出库 if (!Boolean.valueOf(oneDpsidleV)){ diff --git a/shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinStockInvServiceImpl.java b/shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinStockInvServiceImpl.java index 29d01cf..e3322b5 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinStockInvServiceImpl.java +++ b/shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinStockInvServiceImpl.java @@ -224,7 +224,7 @@ public class BusinStockInvServiceImpl extends ServiceImpl businOutInPlanResult = businOutInPlanService.wcsGetPlanByOrderNo(taskCode); if(Result.isOk(businOutInPlanResult)){ diff --git a/shkj-wms/src/main/java/com/shkj/wms/utils/WmsCallWcsUtil.java b/shkj-wms/src/main/java/com/shkj/wms/utils/WmsCallWcsUtil.java index a4d9913..54679b7 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/utils/WmsCallWcsUtil.java +++ b/shkj-wms/src/main/java/com/shkj/wms/utils/WmsCallWcsUtil.java @@ -1,6 +1,7 @@ package com.shkj.wms.utils; import com.alibaba.fastjson.JSONObject; +import com.shkj.common.constant.RedisConstant; import com.shkj.common.core.domain.Result; import com.shkj.wcs.third.stacker.StkCallUtil; import com.shkj.wms.bo.LocationMoveBo; @@ -13,6 +14,7 @@ import com.shkj.wms.vo.OutStockDetailVo; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; +import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Component; /** @@ -30,7 +32,7 @@ public class WmsCallWcsUtil { private StkCallUtil stkCallUtil; @Autowired - private IBusinTaskService taskService; + private RedisTemplate redisTemplate; @Autowired private ISysThirdExceptionRequestService thirdExceptionRequestService; @@ -52,8 +54,6 @@ public class WmsCallWcsUtil { * @param call * @return {@link Result} */ -// @Async -// @Retryable(recover = "outStockRecover", maxAttempts = 3, backoff = @Backoff(value = 2000, multiplier = 2)) public Result outStock(OutStockDetailVo vo, boolean call,Integer layer) { try { STKMoveBo moveBo = getStkMoveBo(vo); @@ -69,7 +69,7 @@ public class WmsCallWcsUtil { log.info("runTask 结果 = {}", runTask); return runTask; } - result = stkCallUtil.outTask(moveBo); + result = stkCallUtil.outTask(moveBo,layer); } thirdExceptionRequestService.addException(vo.getOrderNo().toString(), ThirdApiTypeEnum.wcsOutTask, JSONObject.toJSONString(moveBo), @@ -90,7 +90,7 @@ public class WmsCallWcsUtil { moveBo.setLayer(layer); log.info("callOutStock 调用入参 = {}", moveBo); //给堆垛机下搬运命令 - Result result = stkCallUtil.outTask(moveBo); + Result result = stkCallUtil.outTask(moveBo,layer); //记录结果到是否正常,异常要轮询执行 thirdExceptionRequestService.addException(vo.getOrderNo().toString(), ThirdApiTypeEnum.wcsCallOutStock, JSONObject.toJSONString(moveBo), JSONObject.toJSONString(result), Result.isOk(result),null,layer); diff --git a/shkj-wms/src/main/resources/mapper/wms/BaseLocationMapper.xml b/shkj-wms/src/main/resources/mapper/wms/BaseLocationMapper.xml index f7fa455..6586812 100644 --- a/shkj-wms/src/main/resources/mapper/wms/BaseLocationMapper.xml +++ b/shkj-wms/src/main/resources/mapper/wms/BaseLocationMapper.xml @@ -389,7 +389,7 @@ select 1 as w, 1 as h, - loc.location_column as x, + loc.extend1 as x, loc.layer as y, loc.location_code as i, loc.tunnel as warehouse, diff --git a/shkj-wms/src/main/resources/mapper/wms/SysStockDetailMapper.xml b/shkj-wms/src/main/resources/mapper/wms/SysStockDetailMapper.xml index fb9007e..beac3b2 100644 --- a/shkj-wms/src/main/resources/mapper/wms/SysStockDetailMapper.xml +++ b/shkj-wms/src/main/resources/mapper/wms/SysStockDetailMapper.xml @@ -321,7 +321,7 @@ FROM busin_out_in_plan WHERE - create_time >= CURDATE() + create_time >=CURDATE() AND plan_status = 2 AND type = 'in' UNION