|
|
|
@ -95,7 +95,7 @@ public class IoSplitCodeService extends ServiceImpl<IoSplitCodeMapper, IoSplitCo
|
|
|
|
|
.eq(IoSplitCodeEntity::getCode, code).last("limit 1"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void splitRemove(IoCollectOrderBiz collectOrderBiz, IoCollectOrder collectOrder, Long putWorkPlaceCode) {
|
|
|
|
|
public void splitRemove(IoCollectOrderBiz collectOrderBiz, IoCollectOrder collectOrder, Long putWorkPlaceCode, Boolean isAuto) {
|
|
|
|
|
//1.按照先进先出原则,查询拆零表,获取拆零表ID
|
|
|
|
|
List<IoSplitCodeEntity> ioSplitCodeEntities = findSplitCodes(collectOrderBiz.getRelId(), collectOrderBiz.getBatchNo(), putWorkPlaceCode);
|
|
|
|
|
|
|
|
|
@ -146,8 +146,10 @@ public class IoSplitCodeService extends ServiceImpl<IoSplitCodeMapper, IoSplitCo
|
|
|
|
|
//预出库队列数量不足
|
|
|
|
|
collectOrderBiz.setTagStatus(2);
|
|
|
|
|
collectOrderBiz.setTagMsg("预出库队列码数量不足,赋码失败!");
|
|
|
|
|
return;
|
|
|
|
|
// throw new JsonException(500, "提交失败,工位库存数量不足!");
|
|
|
|
|
if (isAuto)
|
|
|
|
|
throw new JsonException(500, "提交失败,工位库存数量不足!");
|
|
|
|
|
else return;
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
//再次执行赋码
|
|
|
|
|
ioSplitCodeEntities = findSplitCodes(collectOrderBiz.getRelId(), collectOrderBiz.getBatchNo(), putWorkPlaceCode);
|
|
|
|
@ -185,8 +187,9 @@ public class IoSplitCodeService extends ServiceImpl<IoSplitCodeMapper, IoSplitCo
|
|
|
|
|
if (unCount > 0) {
|
|
|
|
|
collectOrderBiz.setTagStatus(2);
|
|
|
|
|
collectOrderBiz.setTagMsg("预出库队列码数量不足,赋码失败!");
|
|
|
|
|
return;
|
|
|
|
|
// throw new JsonException(500, "提交失败,工位库存数量不足!");
|
|
|
|
|
if (isAuto)
|
|
|
|
|
throw new JsonException(500, "提交失败,工位库存数量不足!");
|
|
|
|
|
else return;
|
|
|
|
|
} else {
|
|
|
|
|
collectOrderBiz.setTagStatus(3);
|
|
|
|
|
collectOrderBiz.setTagMsg("赋码完成!");
|
|
|
|
@ -210,7 +213,7 @@ public class IoSplitCodeService extends ServiceImpl<IoSplitCodeMapper, IoSplitCo
|
|
|
|
|
IoCollectOrderBizBackupService ioCollectOrderBizBackupService;
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public void finishAutoTagCode(IoCollectOrder collectOrder) {
|
|
|
|
|
public void finishAutoTagCode(IoCollectOrder collectOrder, Boolean isAuto) {
|
|
|
|
|
|
|
|
|
|
SysWorkplacePutRel sysWorkplacePutRel = workplacePutRelService.findPutWorkPlace(collectOrder.getWorkPlaceCode(), collectOrder.getBusType());
|
|
|
|
|
Long putWorkPlaceCode = null;
|
|
|
|
@ -333,8 +336,9 @@ public class IoSplitCodeService extends ServiceImpl<IoSplitCodeMapper, IoSplitCo
|
|
|
|
|
if (quotient > 0) {
|
|
|
|
|
List<IoSplitFifoCodeEntity> ioSplitFifoCodeEntities = splitFifoCodeService.findByRelId(putWorkPlaceCode, collectOrderBiz.getRelId(), collectOrderBiz.getBatchNo());
|
|
|
|
|
if (ioSplitFifoCodeEntities.size() < quotient) {
|
|
|
|
|
return;
|
|
|
|
|
// throw new JsonException(500, "提交失败,工位库存数量不足!");
|
|
|
|
|
if (isAuto)
|
|
|
|
|
throw new JsonException(500, "提交失败,工位库存数量不足!");
|
|
|
|
|
else return;
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < quotient; i++) {
|
|
|
|
|
IoSplitFifoCodeEntity splitFifoCodeEntity = ioSplitFifoCodeEntities.get(i);
|
|
|
|
@ -368,7 +372,7 @@ public class IoSplitCodeService extends ServiceImpl<IoSplitCodeMapper, IoSplitCo
|
|
|
|
|
}
|
|
|
|
|
//.如果拆零,拆零表扣除
|
|
|
|
|
if (remainder > 0) {
|
|
|
|
|
splitRemove(collectOrderBiz, collectOrder, putWorkPlaceCode);
|
|
|
|
|
splitRemove(collectOrderBiz, collectOrder, putWorkPlaceCode, isAuto);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ArrayList<IoCollectOrderBizBackup> ioCollectOrderBizBackups = new ArrayList<>();
|
|
|
|
@ -441,7 +445,7 @@ public class IoSplitCodeService extends ServiceImpl<IoSplitCodeMapper, IoSplitCo
|
|
|
|
|
}
|
|
|
|
|
//.如果拆零,拆零表扣除
|
|
|
|
|
if (remainder > 0) {
|
|
|
|
|
splitRemove(collectOrderBiz, collectOrder, putWorkPlaceCode);
|
|
|
|
|
splitRemove(collectOrderBiz, collectOrder, putWorkPlaceCode, false);
|
|
|
|
|
}
|
|
|
|
|
if (collectOrderBiz.getTagStatus() == 2) {
|
|
|
|
|
throw new JsonException(500, "确认失败,工位库存数量不足!");
|
|
|
|
|