Commit 75a9c0ae zshaohui

手动pk发料修改

1 个父辈 d9958636
......@@ -357,11 +357,11 @@ public class OutLineController {
code = code.toUpperCase();
//判断是否整箱出库
if (isBoxPartition(code) && (code.endsWith("A") || code.endsWith("B"))) {
return finishTask(code, OP.CHECKOUT, null, OP_STATUS.FINISHED.name(), INOUT_TYPE.OUT_BOX.name());
return ResultBean.newErrorResult(-1,"","请扫描料盘进行出库");
}
//判断是否隔口出库
else if (isBoxPartition(code) && code.indexOf("-") != -1) {
return finishTask(code, OP.CHECKOUT, null, OP_STATUS.FINISHED.name(), INOUT_TYPE.OUT_PARTITION.name());
return ResultBean.newErrorResult(-1,"","请扫描料盘进行出库");
}
//判断是否属于料盘出库
else {
......@@ -372,125 +372,10 @@ public class OutLineController {
private synchronized ResultBean finishTask(String boxStr, int opType,
Barcode barcode, String opStatus,
String inoutType) {
ResultBean resultBean = ResultBean.newOkResult("");
//判断是否为整箱出库
if (INOUT_TYPE.OUT_BOX.name().equals(inoutType)) {
//根据箱子号 找到barcode
boxStr = getBoxStrbyBoxPartition(boxStr);
Barcode pidBarcode = barcodeManager.findByBarcode(boxStr);
//根据料箱获取到全部的物料
List<Barcode> subCodes = pidBarcode.getSubCodeList();
if (subCodes == null || subCodes.isEmpty()) {
return ResultBean.newErrorResult(-1, "", "料箱:" + pidBarcode.getBarcode() + ",没有可出库的物料");
}
//判断是否全部出库
for (Barcode subCode : subCodes) {
if (!subCode.isOut()) {
return ResultBean.newErrorResult(-1, "", pidBarcode.getBarcode() + "不允许全部取出,请核实");
}
}
for (int index = 0; index < subCodes.size(); ) {
Barcode subCode = subCodes.get(index);
//manualCheckOut(subCode);
//生成任务
String orderItemId = subCode.getOrderItemId();
int amount = subCode.getAmount();
subCode.setAmount(0);
pidBarcode.UpdateSubCode(subCode);
pidBarcode.setReelAmount(pidBarcode.getReelAmount() - 1);
pidBarcode.setAmount(pidBarcode.getAmount() - amount);
int extendType = StringUtils.isNotBlank(subCode.getOrderItemId()) ? ExtendType.VIRTUAL_PICKING_DETAIL : ExtendType.VIRTUAL_CHECKOUT;
DataLog dataLog = generateTask(subCode, opStatus, amount, opType, orderItemId, extendType, true);
log.info("整箱出库,生成出库任务,barcode:" + subCode.getBarcode() + ",料箱号为:" + pidBarcode.getBarcode());
if (subCode.getAmount() <= 0) {
subCode.setAmount(amount);
subCode.setSelectMsg(null);
subCode.setOut(false);
subCode.setOrderItemId(null);
subCode.setPosName(null);
subCode.setHostBarcodeId(null);
subCode.setStorageId(null);
barcodeManager.save(subCode);
}
}
barcodeManager.save(pidBarcode);
StoragePos pos = BoxHandleUtil.locOnePos(pidBarcode);
if (pos != null){
pos.setBarcode(pidBarcode);
storagePosManager.save(pos);
}
resultBean.setData(getBoxInfo(boxStr));
}
//判断是否隔口出库
else if (INOUT_TYPE.OUT_PARTITION.name().equals(inoutType)) {
String newboxStr = getBoxStrbyBoxPartition(boxStr);
String orderItemIdStr = "";
Barcode pidBarcode = barcodeManager.findByBarcode(newboxStr);
//获取到需要出库的隔口信息
List<Barcode> needOutBarcodes = new ArrayList<>();
List<Barcode> subCodes = pidBarcode.getSubCodeList();
if (subCodes != null && !subCodes.isEmpty()) {
for (Barcode subCode : subCodes) {
if (boxStr.equals(subCode.getPosName())) {
needOutBarcodes.add(subCode);
}
}
}
if (needOutBarcodes == null || needOutBarcodes.isEmpty()) {
return ResultBean.newErrorResult(-1, "", "料箱隔口:" + boxStr + "扫描错误");
}
//判断是否全部出库
for (Barcode subCode : needOutBarcodes) {
if (!subCode.isOut()) {
return ResultBean.newErrorResult(-1, "", boxStr + "不允许全部出库,请核实");
}
}
for (int index = 0; index < needOutBarcodes.size(); index++) {
Barcode subCode = needOutBarcodes.get(index);
//manualCheckOut(subCode);
String orderItemId = subCode.getOrderItemId();
int amount = subCode.getAmount();
subCode.setAmount(0);
pidBarcode.UpdateSubCode(subCode);
pidBarcode.setReelAmount(pidBarcode.getReelAmount() - 1);
pidBarcode.setAmount(pidBarcode.getAmount() - amount);
generateTask(subCode, opStatus, amount, opType, orderItemId, 0, true);
log.info("隔口出库,生成出库任务,barcode:" + subCode.getBarcode() + ",料箱号为:" + subCode.getPosName());
log.info("箱子数量为:" + pidBarcode.getAmount() + ",物料数量为:" + pidBarcode.getReelAmount() + "箱号为:" + pidBarcode.getBarcode());
if (subCode.getAmount() <= 0) {
subCode.setAmount(amount);
subCode.setSelectMsg(null);
subCode.setOut(false);
subCode.setOrderItemId(null);
subCode.setPosName(null);
subCode.setHostBarcodeId(null);
subCode.setStorageId(null);
barcodeManager.save(subCode);
}
}
barcodeManager.save(pidBarcode);
StoragePos pos = BoxHandleUtil.locOnePos(pidBarcode);
if (pos != null){
pos.setBarcode(pidBarcode);
storagePosManager.save(pos);
}
resultBean.setData(getBoxInfo(boxStr));
}
ResultBean resultBean = ResultBean.newOkResult("");
//判断是否为单盘出库
else if (INOUT_TYPE.OUT_ONE.name().equals(inoutType)) {
if (INOUT_TYPE.OUT_ONE.name().equals(inoutType)) {
CodeBean code = codeResolve.resolveSingleCode(boxStr);
if (!code.isValid()) {
return ResultBean.newErrorResult(-1, "smfcore.error.barcode.noValidCode", "条码无效");
......@@ -528,7 +413,7 @@ public class OutLineController {
boolean isOut = false;
if (barcode.isOut()) {
//manualCheckOut(barcode);
manualCheckOut(barcode);
isOut = true;
String orderItemId = barcode.getOrderItemId();
......@@ -583,12 +468,11 @@ public class OutLineController {
pidBarcode.setAmount(pidBarcode.getAmount() - amount);
pidBarcode.UpdateSubCode(barcode);
//manualCheckOut(barcode);
manualCheckOut(barcode);
barcodeByOut = barcodeManager.save(barcodeByOut);
int extendType = StringUtils.isNotBlank(barcode.getOrderItemId()) ? ExtendType.VIRTUAL_PICKING_DETAIL : ExtendType.VIRTUAL_CHECKOUT;
generateTask(barcode, opStatus, amount, opType, orderItemId, extendType, false);
log.info(barcode.getBarcode() + "不是出库任务," + barcodeByOut.getBarcode() + "需更改out为false");
......@@ -653,35 +537,17 @@ public class OutLineController {
public void manualCheckOut(Barcode barcode){
public void manualCheckOut(Barcode barcode) {
String itemId = barcode.getOrderItemId();
if (StringUtils.isNotEmpty(itemId)){
if (StringUtils.isNotEmpty(itemId)) {
LiteOrderItem orderItem = liteOrderItemManager.get(itemId);
LiteOrder liteOrder = liteOrderManager.get(orderItem.getOrderId());
if (liteOrder == null){
throw new ValidateException("",barcode.getBarcode()+"未找到对应的工单出库信息");
}
if (liteOrder.getCheckType() == LiteorderCheckType.TICKET_CHECKOUT){
TicketPickRequest request = new TicketPickRequest();
request.setPLANT_CODE(CommonUtil.plantCode);
request.setTICKET_CODE(orderItem.getTicketCode());
request.setTICKET_ITEM(orderItem.getTicketItem());
request.setQTY(barcode.getAmount());
request.setBIN_CODE("");
List<TicketPickLabelList> labelList = new ArrayList<>();
TicketPickLabelList tickPick = new TicketPickLabelList();
tickPick.setREEL_LIST(Arrays.asList(barcode.getBarcode()));
tickPick.setLABEL_ID(barcode.getLabelId());
labelList.add(tickPick);
request.setLABEL_LIST(labelList);
LuxsanApi.ticketPick(request);
//LuxsanApi.ticketPost(new TicketPostRequest(CommonUtil.plantCode,orderItem.getTicketCode()));
}
else if (liteOrder.getCheckType() == LiteorderCheckType.PICKING_CHECKOUT){
if (liteOrder == null) {
throw new ValidateException("", barcode.getBarcode() + "未找到对应的工单出库信息");
}
if (liteOrder.getCheckType() == LiteorderCheckType.PICKING_CHECKOUT) {
String batchCode = "";
if (!"N/A".equals(orderItem.getBatchCode())){
if (!"N/A".equals(orderItem.getBatchCode())) {
batchCode = orderItem.getBatchCode();
}
LuxsanApi.pickingIssue(new PickingIssueRequest(CommonUtil.plantCode, liteOrder.getOrderNo(), orderItem.getItemId(), barcode.getPartNumber()
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!