|
|
@ -43,6 +43,7 @@ import lombok.extern.log4j.Log4j2; |
|
|
|
import org.redisson.api.RLock; |
|
|
|
import org.redisson.api.RLock; |
|
|
|
import org.springblade.common.constant.DictBizConstant; |
|
|
|
import org.springblade.common.constant.DictBizConstant; |
|
|
|
import org.springblade.common.constant.RabbitConstant; |
|
|
|
import org.springblade.common.constant.RabbitConstant; |
|
|
|
|
|
|
|
import org.springblade.common.constant.pda.PdaAudioLingoStatus; |
|
|
|
import org.springblade.common.constant.stockup.StockupStatusConstant; |
|
|
|
import org.springblade.common.constant.stockup.StockupStatusConstant; |
|
|
|
import org.springblade.common.constant.stockup.StockupTypeStatusConstant; |
|
|
|
import org.springblade.common.constant.stockup.StockupTypeStatusConstant; |
|
|
|
import org.springblade.common.utils.CommonUtil; |
|
|
|
import org.springblade.common.utils.CommonUtil; |
|
|
@ -534,8 +535,8 @@ public class DistributionStockupAppController extends BladeController { |
|
|
|
String lockKey = stockupDTO.getPacketBarCode()+stockupDTO.getStockupId(); |
|
|
|
String lockKey = stockupDTO.getPacketBarCode()+stockupDTO.getStockupId(); |
|
|
|
RLock lock = new RedissonConfig().redisson().getLock(lockKey); |
|
|
|
RLock lock = new RedissonConfig().redisson().getLock(lockKey); |
|
|
|
if(lock.isLocked()){ |
|
|
|
if(lock.isLocked()){ |
|
|
|
String audioValue2 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "2"); |
|
|
|
String audioValue2 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.chongfusaomiao.getValue()); |
|
|
|
return Resp.scanFail("重复扫描!", audioValue2); |
|
|
|
return Resp.scanFail(PdaAudioLingoStatus.chongfusaomiao.getName(), audioValue2); |
|
|
|
} |
|
|
|
} |
|
|
|
lock.lock(5, TimeUnit.SECONDS); |
|
|
|
lock.lock(5, TimeUnit.SECONDS); |
|
|
|
if (scanType == 1) { |
|
|
|
if (scanType == 1) { |
|
|
@ -629,31 +630,31 @@ public class DistributionStockupAppController extends BladeController { |
|
|
|
//将消息携带绑定键值
|
|
|
|
//将消息携带绑定键值
|
|
|
|
rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_STATE_UPDATE_EXCHANGE, RabbitConstant.STOCKUP_STATE_UPDATE_ROUTING, mapState); |
|
|
|
rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_STATE_UPDATE_EXCHANGE, RabbitConstant.STOCKUP_STATE_UPDATE_ROUTING, mapState); |
|
|
|
|
|
|
|
|
|
|
|
String audioValue = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "1"); |
|
|
|
String audioValue = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.saomiaochenggong.getValue()); |
|
|
|
|
|
|
|
|
|
|
|
//查询是否货位数据是否该下架
|
|
|
|
//查询是否货位数据是否该下架
|
|
|
|
// distributionAsyncService.stockupSelfOffShelf(stockupDTO);
|
|
|
|
// distributionAsyncService.stockupSelfOffShelf(stockupDTO);
|
|
|
|
return Resp.scanSuccess("扫描成功!", audioValue); |
|
|
|
return Resp.scanSuccess(PdaAudioLingoStatus.saomiaochenggong.getName(), audioValue); |
|
|
|
case 2: |
|
|
|
case 2: |
|
|
|
//重复扫描
|
|
|
|
//重复扫描
|
|
|
|
String audioValue2 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "2"); |
|
|
|
String audioValue2 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.chongfusaomiao.getValue()); |
|
|
|
return Resp.scanFail("重复扫描!", audioValue2); |
|
|
|
return Resp.scanFail(PdaAudioLingoStatus.chongfusaomiao.getName(), audioValue2); |
|
|
|
case 3: |
|
|
|
case 3: |
|
|
|
//包件不存在
|
|
|
|
//包件不存在
|
|
|
|
String audioValue3 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "3"); |
|
|
|
String audioValue3 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.baotiaomabucunzai.getValue()); |
|
|
|
return Resp.scanFail("包件不存在!", audioValue3); |
|
|
|
return Resp.scanFail(PdaAudioLingoStatus.baotiaomabucunzai.getName(), audioValue3); |
|
|
|
|
|
|
|
|
|
|
|
case 4: |
|
|
|
case 4: |
|
|
|
//操作失败
|
|
|
|
//操作失败
|
|
|
|
String audioValue4 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "4"); |
|
|
|
String audioValue4 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.caozuoshibai.getValue()); |
|
|
|
return Resp.scanFail("操作失败!", audioValue4); |
|
|
|
return Resp.scanFail(PdaAudioLingoStatus.caozuoshibai.getName(), audioValue4); |
|
|
|
case 5: |
|
|
|
case 5: |
|
|
|
//窜货
|
|
|
|
//窜货
|
|
|
|
String audioValue5 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "5"); |
|
|
|
String audioValue5 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.buzai.getValue()); |
|
|
|
return Resp.scanFail("窜货!", audioValue5); |
|
|
|
return Resp.scanFail(PdaAudioLingoStatus.buzai.getName(), audioValue5); |
|
|
|
default: |
|
|
|
default: |
|
|
|
log.warn("###备货扫描:未知错误"); |
|
|
|
log.warn("###备货扫描:未知错误"); |
|
|
|
return Resp.scanFail("未知错误!", "未知错误"); |
|
|
|
return Resp.scanFail(PdaAudioLingoStatus.weizhicuowu.getName(), PdaAudioLingoStatus.weizhicuowu.getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else if (scanType == 2) { |
|
|
|
} else if (scanType == 2) { |
|
|
@ -752,7 +753,7 @@ public class DistributionStockupAppController extends BladeController { |
|
|
|
R r = warehouseUpdownTypeClient.downStock(list); |
|
|
|
R r = warehouseUpdownTypeClient.downStock(list); |
|
|
|
log.debug("下架状态:{}",r.getMsg()); |
|
|
|
log.debug("下架状态:{}",r.getMsg()); |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
return R.fail(3002,"本货位的物料已为0,请更换货位继续!!"); |
|
|
|
return Resp.scanFail("本货位的物料已为0,请更换货位继续!!","本货位的物料已为0,请更换货位继续!!"); |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
return Resp.scanFail("物料信息查询失败,请联系管理员!!", "物料信息查询失败,请联系管理员!!"); |
|
|
|
return Resp.scanFail("物料信息查询失败,请联系管理员!!", "物料信息查询失败,请联系管理员!!"); |
|
|
@ -770,49 +771,50 @@ public class DistributionStockupAppController extends BladeController { |
|
|
|
map.put("createTime", new Date().getTime()); |
|
|
|
map.put("createTime", new Date().getTime()); |
|
|
|
//将消息携带绑定键值
|
|
|
|
//将消息携带绑定键值
|
|
|
|
rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_SCAN_EXCHANGE, RabbitConstant.STOCKUP_SCAN_ROUTING, map); |
|
|
|
rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_SCAN_EXCHANGE, RabbitConstant.STOCKUP_SCAN_ROUTING, map); |
|
|
|
String audioValue = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "1"); |
|
|
|
String audioValue = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.saomiaochenggong.getValue()); |
|
|
|
return Resp.scanSuccess("扫描成功!",audioValue); |
|
|
|
//扫码成功
|
|
|
|
|
|
|
|
return Resp.scanSuccess(PdaAudioLingoStatus.saomiaochenggong.getName(),audioValue); |
|
|
|
case 2: |
|
|
|
case 2: |
|
|
|
//扫码失败
|
|
|
|
//重复扫描
|
|
|
|
String audioValue2 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "2"); |
|
|
|
String audioValue2 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.chongfusaomiao.getValue()); |
|
|
|
return Resp.scanFail("重复扫描!",audioValue2); |
|
|
|
return Resp.scanFail(PdaAudioLingoStatus.chongfusaomiao.getName(),audioValue2); |
|
|
|
case 3: |
|
|
|
case 3: |
|
|
|
//重复扫码
|
|
|
|
//包件不存在
|
|
|
|
String audioValue3 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "3"); |
|
|
|
String audioValue3 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO,PdaAudioLingoStatus.baojianbucunzai.getValue() ); |
|
|
|
return Resp.scanFail("包件不存在!",audioValue3); |
|
|
|
return Resp.scanFail(PdaAudioLingoStatus.baojianbucunzai.getName(),audioValue3); |
|
|
|
|
|
|
|
|
|
|
|
case 4: |
|
|
|
case 4: |
|
|
|
//重复扫码
|
|
|
|
//操作失败
|
|
|
|
String audioValue4 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "4"); |
|
|
|
String audioValue4 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.caozuoshibai.getValue()); |
|
|
|
return Resp.scanFail("操作失败!", audioValue4); |
|
|
|
return Resp.scanFail(PdaAudioLingoStatus.caozuoshibai.getName(), audioValue4); |
|
|
|
case 5: |
|
|
|
case 5: |
|
|
|
//重复扫码
|
|
|
|
//窜货
|
|
|
|
String audioValue5 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "5"); |
|
|
|
String audioValue5 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.cuanhuo.getValue()); |
|
|
|
return Resp.scanFail("窜货!", audioValue5); |
|
|
|
return Resp.scanFail(PdaAudioLingoStatus.cuanhuo.getName(), audioValue5); |
|
|
|
case 6: |
|
|
|
case 6: |
|
|
|
//重复扫码
|
|
|
|
//已完成
|
|
|
|
String audioValue6 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "6"); |
|
|
|
String audioValue6 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.yiwancheng.getValue()); |
|
|
|
return Resp.scanFail("已完成!", audioValue6); |
|
|
|
return Resp.scanFail(PdaAudioLingoStatus.yiwancheng.getName(), audioValue6); |
|
|
|
case 7: |
|
|
|
case 7: |
|
|
|
//重复扫码
|
|
|
|
//包条码不存在
|
|
|
|
String audioValue7 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "7"); |
|
|
|
String audioValue7 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.baotiaomabucunzai.getValue()); |
|
|
|
return Resp.scanFail("包条码不存在!", audioValue7); |
|
|
|
return Resp.scanFail(PdaAudioLingoStatus.baotiaomabucunzai.getName(), audioValue7); |
|
|
|
default: |
|
|
|
default: |
|
|
|
log.warn("###备货扫描:未知错误"); |
|
|
|
log.warn("###备货扫描:未知错误"); |
|
|
|
return Resp.scanFail("未知错误!", "未知错误"); |
|
|
|
return Resp.scanFail(PdaAudioLingoStatus.weizhicuowu.getName(), PdaAudioLingoStatus.weizhicuowu.getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
case 7: |
|
|
|
case 7: |
|
|
|
//重复扫码
|
|
|
|
//包条码不存在
|
|
|
|
String audioValue7 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "7"); |
|
|
|
String audioValue7 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.baotiaomabucunzai.getValue()); |
|
|
|
return Resp.scanFail("包条码不存在!", audioValue7); |
|
|
|
return Resp.scanFail(PdaAudioLingoStatus.baotiaomabucunzai.getName(), audioValue7); |
|
|
|
case 8: |
|
|
|
case 8: |
|
|
|
//重复扫码
|
|
|
|
//条码已使用
|
|
|
|
String audioValue8 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "8"); |
|
|
|
String audioValue8 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.baotiaomayishiyong.getValue()); |
|
|
|
return Resp.scanFail("条码已使用!", audioValue8); |
|
|
|
return Resp.scanFail(PdaAudioLingoStatus.baotiaomayishiyong.getName(), audioValue8); |
|
|
|
case 9: |
|
|
|
case 9: |
|
|
|
//重复扫码
|
|
|
|
//"没有待绑定的库存品信息!"
|
|
|
|
String audioValue9 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "9"); |
|
|
|
String audioValue9 = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, PdaAudioLingoStatus.meiyou.getValue()); |
|
|
|
return Resp.scanFail("没有待绑定的库存品信息!", audioValue9); |
|
|
|
return Resp.scanFail(PdaAudioLingoStatus.meiyou.getName(), audioValue9); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|