|
|
|
@ -769,14 +769,26 @@ public class BusinPickupServiceImpl extends ServiceImpl<BusinPickupMapper, Busin |
|
|
|
businPickupAddBo.setDtlAddBos(pickupDtlAddBos); |
|
|
|
businPickupAddBo.setDtlAddBos(pickupDtlAddBos); |
|
|
|
|
|
|
|
|
|
|
|
//取货流程
|
|
|
|
//取货流程
|
|
|
|
Result<Boolean> pickupRecordesult = this.saveBusinPickupRecord(businPickupAddBo); |
|
|
|
//Result<Boolean> pickupRecordesult = this.saveBusinPickupRecord(businPickupAddBo);
|
|
|
|
if (Result.isOk(pickupRecordesult)){ |
|
|
|
BusinDataTask DataTask = businDataTaskService.getOne(new LambdaQueryWrapper<BusinDataTask>() |
|
|
|
//取货成功
|
|
|
|
.eq(BusinDataTask::getId, businPickupAddBo.getTaskCode()) |
|
|
|
//减去任务数
|
|
|
|
.last("limit 1")); |
|
|
|
// 判断是前杠还是后杠,进行处理 redis 中的任务数
|
|
|
|
String agvno=DataTask.getAgvNo(); |
|
|
|
//小组装等待点位为一个
|
|
|
|
String point = DataTask.getTaskPath(); |
|
|
|
//String assemblePointType = RedisConstant.assemblePointBeforeTaskCount;
|
|
|
|
log.info("调用空治具流向接口传入agv号为"+agvno+"任务号为:"+DataTask.getId()); |
|
|
|
|
|
|
|
log.info("传入的起点为:"+point); |
|
|
|
|
|
|
|
if (ObjectUtils.isNotEmpty(redisTemplate.opsForValue().get("xzz:" + DataTask.getId())) |
|
|
|
|
|
|
|
&& redisTemplate.opsForValue().get("xzz:" + DataTask.getId()).toString().equals(agvno)){ |
|
|
|
|
|
|
|
log.info("任务号为:"+DataTask.getId()+"agv号为"+agvno+"小组装已经释放,不允许重复释放"); |
|
|
|
|
|
|
|
return Result.ok(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (ObjectUtils.isEmpty(businPickupAddBo.getContainerId())){ |
|
|
|
|
|
|
|
businPickupAddBo.setContainerId(0L); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
iBusinEnptyContainerService.emptyContainerFlowDir(point, businPickupAddBo.getContainerId(), agvno, null); |
|
|
|
|
|
|
|
redisTemplate.opsForValue().set("xzz:"+DataTask.getId(),agvno); |
|
|
|
|
|
|
|
DataTask.setTaskStatus("2"); |
|
|
|
|
|
|
|
businDataTaskService.updateById(DataTask); |
|
|
|
String assemblePointType = RedisConstant.assemblePointAfterTaskCount; |
|
|
|
String assemblePointType = RedisConstant.assemblePointAfterTaskCount; |
|
|
|
if (buttonType.equals("front")) { |
|
|
|
if (buttonType.equals("front")) { |
|
|
|
assemblePointType = RedisConstant.assemblePointBeforeTaskCount; |
|
|
|
assemblePointType = RedisConstant.assemblePointBeforeTaskCount; |
|
|
|
@ -787,20 +799,52 @@ public class BusinPickupServiceImpl extends ServiceImpl<BusinPickupMapper, Busin |
|
|
|
redisTemplate.opsForValue().set(assemblePointType, --temp); |
|
|
|
redisTemplate.opsForValue().set(assemblePointType, --temp); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if ("4".equals(DataTask.getTaskType())||"14".equals(DataTask.getTaskType())) { |
|
|
|
|
|
|
|
//查询任务对应的产品数量
|
|
|
|
|
|
|
|
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.selectBusinTaskGoodsByTaskCode(DataTask.getId()); |
|
|
|
|
|
|
|
//根据过点时间,回填出库队列中的状态为已出库
|
|
|
|
|
|
|
|
BusinDataTaskGoodsVo goodsVo = businDataTaskGoodsVos.get(0); |
|
|
|
|
|
|
|
if (goodsVo != null) { |
|
|
|
|
|
|
|
Date traverseDate = goodsVo.getTraverseDate(); |
|
|
|
|
|
|
|
BaseBarcodesOut baseBarcodesOut = iBaseBarcodesOutService.getOne(new LambdaQueryWrapper<BaseBarcodesOut>() |
|
|
|
|
|
|
|
.eq(BaseBarcodesOut::getTraverseDate, traverseDate) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
baseBarcodesOut.setOutStatus("3"); |
|
|
|
|
|
|
|
baseBarcodesOut.setOutDate(DateUtils.getDate()); |
|
|
|
|
|
|
|
iBaseBarcodesOutService.updateById(baseBarcodesOut); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// if (Result.isOk(pickupRecordesult)){
|
|
|
|
|
|
|
|
// //取货成功
|
|
|
|
|
|
|
|
// //减去任务数
|
|
|
|
|
|
|
|
// // 判断是前杠还是后杠,进行处理 redis 中的任务数
|
|
|
|
|
|
|
|
// //小组装等待点位为一个
|
|
|
|
|
|
|
|
// //String assemblePointType = RedisConstant.assemblePointBeforeTaskCount;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// String assemblePointType = RedisConstant.assemblePointAfterTaskCount;
|
|
|
|
// if (buttonType.equals("front")) {
|
|
|
|
// if (buttonType.equals("front")) {
|
|
|
|
// redisTemplate.delete(RedisConstant.redisAssemblyLineFront);
|
|
|
|
// assemblePointType = RedisConstant.assemblePointBeforeTaskCount;
|
|
|
|
// TaskwriteMap.put(frontType, "False");
|
|
|
|
// }
|
|
|
|
// taskidMap.put(frontAddress, TaskwriteMap);
|
|
|
|
// if (ObjectUtils.isNotEmpty(redisTemplate.opsForValue().get(assemblePointType))) {
|
|
|
|
// } else {
|
|
|
|
// int temp = Integer.parseInt(redisTemplate.opsForValue().get(assemblePointType).toString());
|
|
|
|
// redisTemplate.delete(RedisConstant.redisAssemblyLineAfter);
|
|
|
|
// if (temp > 0) {
|
|
|
|
// TaskwriteMap.put(rearType, "False");
|
|
|
|
// redisTemplate.opsForValue().set(assemblePointType, --temp);
|
|
|
|
// taskidMap.put(rearAddress, TaskwriteMap);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Boolean aBoolean = plcReadAndWrite.execWrite(plcOperate, JSON.toJSONString(taskidMap));
|
|
|
|
//// if (buttonType.equals("front")) {
|
|
|
|
// log.error("出库放行点写入是否成功:" + aBoolean + "写入的相关数据为:" + taskidMap.toString());
|
|
|
|
//// redisTemplate.delete(RedisConstant.redisAssemblyLineFront);
|
|
|
|
} |
|
|
|
//// TaskwriteMap.put(frontType, "False");
|
|
|
|
|
|
|
|
//// taskidMap.put(frontAddress, TaskwriteMap);
|
|
|
|
|
|
|
|
//// } else {
|
|
|
|
|
|
|
|
//// redisTemplate.delete(RedisConstant.redisAssemblyLineAfter);
|
|
|
|
|
|
|
|
//// TaskwriteMap.put(rearType, "False");
|
|
|
|
|
|
|
|
//// taskidMap.put(rearAddress, TaskwriteMap);
|
|
|
|
|
|
|
|
//// }
|
|
|
|
|
|
|
|
////
|
|
|
|
|
|
|
|
//// Boolean aBoolean = plcReadAndWrite.execWrite(plcOperate, JSON.toJSONString(taskidMap));
|
|
|
|
|
|
|
|
//// log.error("出库放行点写入是否成功:" + aBoolean + "写入的相关数据为:" + taskidMap.toString());
|
|
|
|
|
|
|
|
// }
|
|
|
|
return Result.err().msg("出库取货失败"); |
|
|
|
return Result.err().msg("出库取货失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|