出库下发并发问题及地图显示问题

main
judy 11 months ago
parent bd98b21694
commit 786dfcc668
  1. 2
      shkj-admin/src/main/resources/logback.xml
  2. 15
      shkj-wms/src/main/java/com/shkj/wcs/third/stacker/StkCallUtil.java
  3. 3
      shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinStockInvServiceImpl.java
  4. 2
      shkj-wms/src/main/java/com/shkj/wms/service/impl/SysThirdExceptionRequestServiceImpl.java
  5. 10
      shkj-wms/src/main/java/com/shkj/wms/utils/WmsCallWcsUtil.java
  6. 2
      shkj-wms/src/main/resources/mapper/wms/BaseLocationMapper.xml
  7. 2
      shkj-wms/src/main/resources/mapper/wms/SysStockDetailMapper.xml

@ -7,7 +7,7 @@
<contextName>logback</contextName> <contextName>logback</contextName>
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 --> <!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 -->
<!--<property name="log.path" value="D:/logs" />--> <!-- <property name="log.path" value="/opt/logs/mjk2" />-->
<property name="log.path" value="E:/wcs/logs" /> <property name="log.path" value="E:/wcs/logs" />
<!-- 彩色日志 --> <!-- 彩色日志 -->

@ -66,7 +66,7 @@ public class StkCallUtil {
* @param stkMoveBo * @param stkMoveBo
* @return * @return
*/ */
public Result<Boolean> outTask(STKMoveBo stkMoveBo) throws InterruptedException { public Result<Boolean> outTask(STKMoveBo stkMoveBo,Integer layer) throws InterruptedException {
//下发任务时,先查询是否有正在执行的入库任务,如果有,则不下发出库任务 //下发任务时,先查询是否有正在执行的入库任务,如果有,则不下发出库任务
Object taskInId = redisTemplate.opsForValue().get(RedisConstant.redisTaskIn); Object taskInId = redisTemplate.opsForValue().get(RedisConstant.redisTaskIn);
if (taskInId !=null ){ if (taskInId !=null ){
@ -75,25 +75,19 @@ public class StkCallUtil {
} }
Object oneTaskOutId = redisTemplate.opsForValue().get(RedisConstant.redisTaskOutOne); Object oneTaskOutId = redisTemplate.opsForValue().get(RedisConstant.redisTaskOutOne);
if (oneTaskOutId !=null ){ if (oneTaskOutId !=null && layer==1){
log.info("1F有出库任务在执行,无法下发出库任务:"+oneTaskOutId); log.info("1F有出库任务在执行,无法下发出库任务:"+oneTaskOutId);
return Result.err().msg("1F有出库任务在执行,无法下发出库任务"); return Result.err().msg("1F有出库任务在执行,无法下发出库任务");
} }
Object twoTaskOutId = redisTemplate.opsForValue().get(RedisConstant.redisTaskOutTwo); Object twoTaskOutId = redisTemplate.opsForValue().get(RedisConstant.redisTaskOutTwo);
if (twoTaskOutId !=null ){ if (twoTaskOutId !=null && layer==2){
log.info("2F有出库任务在执行,无法下发出库任务:"+twoTaskOutId); log.info("2F有出库任务在执行,无法下发出库任务:"+twoTaskOutId);
return Result.err().msg("2F有出库任务在执行,无法下发出库任务"); return Result.err().msg("2F有出库任务在执行,无法下发出库任务");
} }
Long taskId = stkMoveBo.getTaskId(); Long taskId = stkMoveBo.getTaskId();
SysThirdExceptionRequest one = sysThirdExceptionRequestService.getOneByOrderNo(taskId.toString()); 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 fromLayer = stkMoveBo.getFromLayer();
String fromColumn = stkMoveBo.getFromColumn(); String fromColumn = stkMoveBo.getFromColumn();
@ -139,7 +133,6 @@ public class StkCallUtil {
twoDpsidle = dpsProperty.getAddress(); twoDpsidle = dpsProperty.getAddress();
} }
} }
if (dpsPointMap.containsKey(oneDpsidle)){ if (dpsPointMap.containsKey(oneDpsidle)){
oneDpsidleV = dpsPointMap.get(oneDpsidle).toString(); oneDpsidleV = dpsPointMap.get(oneDpsidle).toString();
} }
@ -151,7 +144,7 @@ public class StkCallUtil {
log.info(taskId+"1楼是否允许出库::"+oneDpsidle+" 出库的值:"+oneDpsidleV); log.info(taskId+"1楼是否允许出库::"+oneDpsidle+" 出库的值:"+oneDpsidleV);
log.info(taskId+"2楼是否允许出库::"+twoDpsidle+" 出库的值:"+twoDpsidleV); log.info(taskId+"2楼是否允许出库::"+twoDpsidle+" 出库的值:"+twoDpsidleV);
//出库的站台 //出库的站台
Integer layer =stkMoveBo.getLayer(); layer =stkMoveBo.getLayer();
if (layer==1){ if (layer==1){
//false不允许出库 //false不允许出库
if (!Boolean.valueOf(oneDpsidleV)){ if (!Boolean.valueOf(oneDpsidleV)){

@ -224,7 +224,7 @@ public class BusinStockInvServiceImpl extends ServiceImpl<BusinStockInvMapper, B
inv.setInvQty(stockLot.getQty()); inv.setInvQty(stockLot.getQty());
inv.setInvStatus(InvStatusEnum.init.getValue()); inv.setInvStatus(InvStatusEnum.init.getValue());
inv.setInvType(bo.getInvType()); inv.setInvType(bo.getInvType());
//inv.setInvWay(bo.getInvWay()); inv.setLayer(bo.getLayer());
inv.setInvWay(InvWayEnum.open.getValue()); inv.setInvWay(InvWayEnum.open.getValue());
inv.setBranchId(stockLot.getBranchId()); inv.setBranchId(stockLot.getBranchId());
addList.add(inv); addList.add(inv);
@ -498,7 +498,6 @@ public class BusinStockInvServiceImpl extends ServiceImpl<BusinStockInvMapper, B
for (BusinStockInv businStockInv : list) { for (BusinStockInv businStockInv : list) {
businStockInv.setInvStatus(InvStatusEnum.exec.getValue()); businStockInv.setInvStatus(InvStatusEnum.exec.getValue());
businStockInv.setExecTime(DateUtils.getNowDate()); businStockInv.setExecTime(DateUtils.getNowDate());
businStockInv.setLayer(layer);
} }
//更新盘点的状态为确认执行 //更新盘点的状态为确认执行

@ -90,7 +90,7 @@ public class SysThirdExceptionRequestServiceImpl extends ServiceImpl<SysThirdExc
log.info("下发出库任务时,完成出库状态不是带出库,不需要修改"); log.info("下发出库任务时,完成出库状态不是带出库,不需要修改");
} }
} else { } else {
result = stkCallUtil.outTask(vo); result = stkCallUtil.outTask(vo,request.getLayer());
if (Result.isOk(result)) { if (Result.isOk(result)) {
Result<BusinOutInPlan> businOutInPlanResult = businOutInPlanService.wcsGetPlanByOrderNo(taskCode); Result<BusinOutInPlan> businOutInPlanResult = businOutInPlanService.wcsGetPlanByOrderNo(taskCode);
if(Result.isOk(businOutInPlanResult)){ if(Result.isOk(businOutInPlanResult)){

@ -1,6 +1,7 @@
package com.shkj.wms.utils; package com.shkj.wms.utils;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.shkj.common.constant.RedisConstant;
import com.shkj.common.core.domain.Result; import com.shkj.common.core.domain.Result;
import com.shkj.wcs.third.stacker.StkCallUtil; import com.shkj.wcs.third.stacker.StkCallUtil;
import com.shkj.wms.bo.LocationMoveBo; import com.shkj.wms.bo.LocationMoveBo;
@ -13,6 +14,7 @@ import com.shkj.wms.vo.OutStockDetailVo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/** /**
@ -30,7 +32,7 @@ public class WmsCallWcsUtil {
private StkCallUtil stkCallUtil; private StkCallUtil stkCallUtil;
@Autowired @Autowired
private IBusinTaskService taskService; private RedisTemplate redisTemplate;
@Autowired @Autowired
private ISysThirdExceptionRequestService thirdExceptionRequestService; private ISysThirdExceptionRequestService thirdExceptionRequestService;
@ -52,8 +54,6 @@ public class WmsCallWcsUtil {
* @param call * @param call
* @return {@link Result} * @return {@link Result}
*/ */
// @Async
// @Retryable(recover = "outStockRecover", maxAttempts = 3, backoff = @Backoff(value = 2000, multiplier = 2))
public Result outStock(OutStockDetailVo vo, boolean call,Integer layer) { public Result outStock(OutStockDetailVo vo, boolean call,Integer layer) {
try { try {
STKMoveBo moveBo = getStkMoveBo(vo); STKMoveBo moveBo = getStkMoveBo(vo);
@ -69,7 +69,7 @@ public class WmsCallWcsUtil {
log.info("runTask 结果 = {}", runTask); log.info("runTask 结果 = {}", runTask);
return runTask; return runTask;
} }
result = stkCallUtil.outTask(moveBo); result = stkCallUtil.outTask(moveBo,layer);
} }
thirdExceptionRequestService.addException(vo.getOrderNo().toString(), ThirdApiTypeEnum.wcsOutTask, JSONObject.toJSONString(moveBo), thirdExceptionRequestService.addException(vo.getOrderNo().toString(), ThirdApiTypeEnum.wcsOutTask, JSONObject.toJSONString(moveBo),
@ -90,7 +90,7 @@ public class WmsCallWcsUtil {
moveBo.setLayer(layer); moveBo.setLayer(layer);
log.info("callOutStock 调用入参 = {}", moveBo); log.info("callOutStock 调用入参 = {}", moveBo);
//给堆垛机下搬运命令 //给堆垛机下搬运命令
Result<Boolean> result = stkCallUtil.outTask(moveBo); Result<Boolean> result = stkCallUtil.outTask(moveBo,layer);
//记录结果到是否正常,异常要轮询执行 //记录结果到是否正常,异常要轮询执行
thirdExceptionRequestService.addException(vo.getOrderNo().toString(), ThirdApiTypeEnum.wcsCallOutStock, JSONObject.toJSONString(moveBo), thirdExceptionRequestService.addException(vo.getOrderNo().toString(), ThirdApiTypeEnum.wcsCallOutStock, JSONObject.toJSONString(moveBo),
JSONObject.toJSONString(result), Result.isOk(result),null,layer); JSONObject.toJSONString(result), Result.isOk(result),null,layer);

@ -389,7 +389,7 @@
select select
1 as w, 1 as w,
1 as h, 1 as h,
loc.location_column as x, loc.extend1 as x,
loc.layer as y, loc.layer as y,
loc.location_code as i, loc.location_code as i,
loc.tunnel as warehouse, loc.tunnel as warehouse,

@ -321,7 +321,7 @@
FROM FROM
busin_out_in_plan busin_out_in_plan
WHERE WHERE
create_time >= CURDATE() create_time >=CURDATE()
AND plan_status = 2 AND plan_status = 2
AND type = 'in' AND type = 'in'
UNION UNION

Loading…
Cancel
Save