Compare commits
3 Commits
a799e83553
...
6983786067
| Author | SHA1 | Date |
|---|---|---|
|
|
6983786067 | |
|
|
5738a4309e | |
|
|
afd319a086 |
|
|
@ -9,6 +9,7 @@ import com.nflg.wms.admin.repository.InventoryForOutRepository;
|
|||
import com.nflg.wms.admin.repository.OutMaterialScanRecordRespository;
|
||||
import com.nflg.wms.admin.service.ComponentOutboundControllerService;
|
||||
import com.nflg.wms.admin.service.SapService;
|
||||
import com.nflg.wms.common.constant.BarCodeProcessStage;
|
||||
import com.nflg.wms.common.pojo.ApiResult;
|
||||
import com.nflg.wms.common.pojo.PageData;
|
||||
import com.nflg.wms.common.pojo.document.OutMaterialScanRecord;
|
||||
|
|
@ -358,6 +359,42 @@ public class ComponentOutboundController extends BaseController {
|
|||
if (qo.isPass()) {
|
||||
List<OutMaterialScanRecord> records = outMaterialScanRecordRespository.findByTicketId(ticket.getId());
|
||||
VUtil.trueThrowBusinessError(CollectionUtil.isEmpty(records)).throwMessage("未找到扫码记录");
|
||||
List<WmsQrCodeMaster> qrCodeMasters = qrCodeMasterService.lambdaQuery()
|
||||
.eq(WmsQrCodeMaster::getProcessStage, BarCodeProcessStage.InBound.getState())
|
||||
.in(WmsQrCodeMaster::getBarcodeCode, records.stream().map(OutMaterialScanRecord::getUniqNo).toList())
|
||||
.list();
|
||||
qrCodeMasters.stream()
|
||||
.forEach(p -> {
|
||||
OutMaterialScanRecord record = records.stream()
|
||||
.filter(r -> r.getUniqNo().equals(p.getBarcodeCode()))
|
||||
.findFirst()
|
||||
.get();
|
||||
p.setFactoryCode(record.getFactoryNo());
|
||||
p.setStorageLocation(record.getWarehouseNo());
|
||||
p.setBinLocation(record.getBinNo());
|
||||
p.setProcessStage(BarCodeProcessStage.OutBound.getState());
|
||||
p.setLastScanBy(UserUtil.getUserId());
|
||||
p.setLastScanByname(UserUtil.getUserName());
|
||||
p.setLastScanTime(LocalDateTime.now());
|
||||
if (p.getPackagingType() == 1) {
|
||||
List<WmsQrCodeMaster> children = qrCodeMasterService.lambdaQuery()
|
||||
.eq(WmsQrCodeMaster::getParentBarcodeId, p.getId())
|
||||
.list();
|
||||
if (CollectionUtil.isNotEmpty(children)) {
|
||||
children.forEach(c -> {
|
||||
c.setProcessStage(p.getProcessStage());
|
||||
c.setFactoryCode(p.getFactoryCode());
|
||||
c.setStorageLocation(p.getStorageLocation());
|
||||
c.setBinLocation(p.getBinLocation());
|
||||
c.setProcessStage(p.getProcessStage());
|
||||
c.setLastScanBy(p.getLastScanBy());
|
||||
c.setLastScanByname(p.getLastScanByname());
|
||||
c.setLastScanTime(p.getLastScanTime());
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
qrCodeMasterService.updateBarCode(qrCodeMasters);
|
||||
inventoryService.out(records.stream()
|
||||
.collect(Collectors.groupingBy(OutMaterialScanRecord::getKey))
|
||||
.values()
|
||||
|
|
@ -368,7 +405,12 @@ public class ComponentOutboundController extends BaseController {
|
|||
.setSerialNo(list.get(0).getSerialNo())
|
||||
.setFactoryNo(list.get(0).getFactoryNo())
|
||||
.setWarehouseNo(list.get(0).getWarehouseNo())
|
||||
.setBinLocation(list.get(0).getBinNo())
|
||||
.setBinLocation(qrCodeMasters.stream()
|
||||
.filter(qr -> StrUtil.equals(qr.getBarcodeCode(), list.get(0).getUniqNo()))
|
||||
.findFirst()
|
||||
.get()
|
||||
.getBinLocation()
|
||||
)
|
||||
.setNum(list.stream().map(OutMaterialScanRecord::getNum).reduce(BigDecimal.ZERO, BigDecimal::add))
|
||||
).toList()
|
||||
);
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import com.nflg.wms.common.pojo.dto.*;
|
|||
import com.nflg.wms.common.pojo.qo.*;
|
||||
import com.nflg.wms.common.pojo.vo.InProduceOrderItemVO;
|
||||
import com.nflg.wms.common.pojo.vo.InProduceOrderMaterialVO;
|
||||
import com.nflg.wms.common.pojo.vo.InProduceOrderVO;
|
||||
import com.nflg.wms.common.util.DateTimeUtil;
|
||||
import com.nflg.wms.common.util.UserUtil;
|
||||
import com.nflg.wms.common.util.VUtil;
|
||||
|
|
@ -353,11 +354,12 @@ public class InProduceOrderController extends BaseController {
|
|||
* @param no 报工单号
|
||||
*/
|
||||
@GetMapping("getOrderInfo")
|
||||
public ApiResult<List<InProduceOrderItemVO>> getOrderInfo(@Valid @RequestParam @NotBlank String no) {
|
||||
public ApiResult<InProduceOrderVO> getOrderInfo(@Valid @RequestParam @NotBlank String no) {
|
||||
WmsInProduceOrder order = produceOrderService.getByNo(no);
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(order)).throwMessage("订单不存在");
|
||||
VUtil.trueThrowBusinessError(!Objects.equals(order.getState(), (short) 0))
|
||||
.throwMessage("该订单非待收货状态");
|
||||
InProduceOrderVO vo=Convert.convert(InProduceOrderVO.class,order);
|
||||
List<InProduceOrderItemVO> list = produceOrderItemService.getVOByOrderId(order.getId());
|
||||
if (order.getList()) {
|
||||
List<InProduceOrderItemVO> datas = new ArrayList<>();
|
||||
|
|
@ -376,14 +378,15 @@ public class InProduceOrderController extends BaseController {
|
|||
});
|
||||
datas.addAll(children);
|
||||
});
|
||||
return ApiResult.success(datas);
|
||||
vo.setItems(datas);
|
||||
} else {
|
||||
list.forEach(it -> {
|
||||
it.setBinNo(binService.getBinNo(it.getMaterialNo(), it.getFactoryNo(), it.getWarehouseNo()));
|
||||
it.setIsDisableLocation(warehouseService.isEnableLocation(it.getFactoryNo(), it.getWarehouseNo()));
|
||||
});
|
||||
return ApiResult.success(list);
|
||||
vo.setItems(list);
|
||||
}
|
||||
return ApiResult.success(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -391,7 +394,7 @@ public class InProduceOrderController extends BaseController {
|
|||
* @param request 请求参数
|
||||
*/
|
||||
@Transactional
|
||||
@PostMapping("receive")
|
||||
@PostMapping("")
|
||||
public ApiResult<Void> receive(@Valid @RequestBody InventoryIn1QO request) {//InProduceOrderReceiveQO
|
||||
WmsInProduceOrder order = produceOrderService.getById(request.getId());
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(order)).throwMessage("订单不存在");
|
||||
|
|
|
|||
|
|
@ -136,8 +136,6 @@ public class LocationTransferController extends BaseController {
|
|||
.collect(Collectors.toList()).size();
|
||||
VUtil.trueThrowBusinessError(count2 > 0).throwMessage("存在不同仓库的二维码");
|
||||
|
||||
|
||||
|
||||
// boolean hasDuplicates1 = allQcMasters.stream()
|
||||
// .map(WmsQrCodeMaster::getBarcodeCode)
|
||||
// .collect(Collectors.toSet())
|
||||
|
|
|
|||
|
|
@ -474,7 +474,7 @@ public class NormalPGIController extends BaseController {
|
|||
if (CollectionUtil.isNotEmpty(qo.getItems())) {
|
||||
InCostCenterBackSubmitItemQRQO qrqo = qo.getItems()
|
||||
.stream()
|
||||
.filter(iit -> iit.getQrCodes().contains(code.getCodeId()))
|
||||
.filter(iit -> iit.getQrCode().contains(code.getCodeId()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(qrqo)).throwMessage("条码" + code.getCodeId() + "已收货但不在本次扫码列表中");
|
||||
|
|
@ -1254,21 +1254,15 @@ public class NormalPGIController extends BaseController {
|
|||
.setId(item.getId())
|
||||
.setReceivedWarehouse(item.getReceivedWarehouse())
|
||||
.setItems(
|
||||
new ArrayList<>() {
|
||||
{
|
||||
add(new InCostCenterBackSubmitItemQRQO()
|
||||
qrCodeMasters.stream()
|
||||
.filter(qit -> qit.getReceiptItemId().equals(item.getId()))
|
||||
.toList()
|
||||
.stream()
|
||||
.map(qit->new InCostCenterBackSubmitItemQRQO()
|
||||
.setBinNo(item.getStorageLocation())
|
||||
.setQrCodes(
|
||||
qrCodeMasters.stream()
|
||||
.filter(qit -> qit.getReceiptItemId().equals(item.getId()))
|
||||
.toList()
|
||||
.stream()
|
||||
.map(WmsQrCodeMaster::getBarcodeCode)
|
||||
.toList()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
.setQrCode(qit.getBarcodeCode())
|
||||
)
|
||||
.toList()
|
||||
)
|
||||
);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -281,17 +281,15 @@ public class NormalQMController extends BaseController {
|
|||
request.forEach(rit -> {
|
||||
if (CollectionUtil.isNotEmpty(rit.getItems())) {
|
||||
rit.getItems().forEach(item -> {
|
||||
item.getQrCodes().forEach(qrCode -> {
|
||||
qrCodeMasters.add(
|
||||
new WmsQrCodeMaster()
|
||||
.setBarcodeCode(qrCode)
|
||||
.setProcessStage(BarCodeProcessStage.InBound.getState())
|
||||
.setBinLocation(item.getBinNo())
|
||||
.setLastScanBy(UserUtil.getUserId())
|
||||
.setLastScanByname(UserUtil.getUserName())
|
||||
.setLastScanTime(LocalDateTime.now())
|
||||
);
|
||||
});
|
||||
qrCodeMasters.add(
|
||||
new WmsQrCodeMaster()
|
||||
.setBarcodeCode(item.getQrCode())
|
||||
.setProcessStage(BarCodeProcessStage.InBound.getState())
|
||||
.setBinLocation(item.getBinNo())
|
||||
.setLastScanBy(UserUtil.getUserId())
|
||||
.setLastScanByname(UserUtil.getUserName())
|
||||
.setLastScanTime(LocalDateTime.now())
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -348,7 +348,7 @@ public class OutAssistanceController extends BaseController {
|
|||
}
|
||||
});
|
||||
qrCodeMasterService.updateBarCode(qrCodeMasters);
|
||||
submitSap(order, ticket, records, datas);
|
||||
submitSap(order, ticket, records, datas, qrCodeMasters);
|
||||
} else {
|
||||
inventoryForOutRepository.saveAll(request.getRecommendBatch()
|
||||
.stream()
|
||||
|
|
@ -365,9 +365,8 @@ public class OutAssistanceController extends BaseController {
|
|||
return ApiResult.success();
|
||||
}
|
||||
|
||||
private void submitSap(WmsOutAssistance order, WmsOutAssistanceTicket
|
||||
ticket, List<OutMaterialScanRecord> records
|
||||
, List<WmsOutAssistanceItem> datas) {
|
||||
private void submitSap(WmsOutAssistance order, WmsOutAssistanceTicket ticket, List<OutMaterialScanRecord> records
|
||||
, List<WmsOutAssistanceItem> datas, List<WmsQrCodeMaster> qrCodeMasters) {
|
||||
inventoryService.out(records.stream()
|
||||
.collect(Collectors.groupingBy(OutMaterialScanRecord::getKey))
|
||||
.values()
|
||||
|
|
@ -378,7 +377,12 @@ public class OutAssistanceController extends BaseController {
|
|||
.setSerialNo(list.get(0).getSerialNo())
|
||||
.setFactoryNo(list.get(0).getFactoryNo())
|
||||
.setWarehouseNo(list.get(0).getWarehouseNo())
|
||||
.setBinLocation(list.get(0).getBinNo())
|
||||
.setBinLocation(qrCodeMasters.stream()
|
||||
.filter(qr -> StrUtil.equals(qr.getBarcodeCode(), list.get(0).getUniqNo()))
|
||||
.findFirst()
|
||||
.get()
|
||||
.getBinLocation()
|
||||
)
|
||||
.setNum(list.stream().map(OutMaterialScanRecord::getNum).reduce(BigDecimal.ZERO, BigDecimal::add))
|
||||
).toList()
|
||||
);
|
||||
|
|
@ -460,7 +464,7 @@ public class OutAssistanceController extends BaseController {
|
|||
.list();
|
||||
qrCodeMasters.stream()
|
||||
.forEach(p -> {
|
||||
OutMaterialScanRecord record=records.stream()
|
||||
OutMaterialScanRecord record = records.stream()
|
||||
.filter(r -> r.getUniqNo().equals(p.getBarcodeCode()))
|
||||
.findFirst()
|
||||
.get();
|
||||
|
|
@ -471,7 +475,7 @@ public class OutAssistanceController extends BaseController {
|
|||
p.setLastScanBy(UserUtil.getUserId());
|
||||
p.setLastScanByname(UserUtil.getUserName());
|
||||
p.setLastScanTime(LocalDateTime.now());
|
||||
if (p.getPackagingType() == 1){
|
||||
if (p.getPackagingType() == 1) {
|
||||
List<WmsQrCodeMaster> children = qrCodeMasterService.lambdaQuery()
|
||||
.eq(WmsQrCodeMaster::getParentBarcodeId, p.getId())
|
||||
.list();
|
||||
|
|
@ -490,9 +494,7 @@ public class OutAssistanceController extends BaseController {
|
|||
}
|
||||
});
|
||||
qrCodeMasterService.updateBarCode(qrCodeMasters);
|
||||
submitSap(order, ticket
|
||||
, records
|
||||
, outAssistanceItemService.getList(order.getId())
|
||||
submitSap(order, ticket, records, outAssistanceItemService.getList(order.getId()), qrCodeMasters
|
||||
);
|
||||
} else {
|
||||
List<OutAssistanceItemVO> items = outAssistanceTicketItemService.getList(qo.getId());
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ public class OutCostCenterController extends BaseController {
|
|||
}
|
||||
});
|
||||
qrCodeMasterService.updateBarCode(qrCodeMasters);
|
||||
submitSap(order, ticket, records, datas);
|
||||
submitSap(order, ticket, records, datas,qrCodeMasters);
|
||||
} else {
|
||||
inventoryForOutRepository.saveAll(request.getRecommendBatch()
|
||||
.stream()
|
||||
|
|
@ -357,7 +357,7 @@ public class OutCostCenterController extends BaseController {
|
|||
}
|
||||
|
||||
private void submitSap(WmsOutCostcenter order, WmsOutCostcenterTicket ticket, List<OutMaterialScanRecord> records
|
||||
, List<WmsOutCostcenterItem> datas) {
|
||||
, List<WmsOutCostcenterItem> datas,List<WmsQrCodeMaster> qrCodeMasters) {
|
||||
inventoryService.out(records.stream()
|
||||
.collect(Collectors.groupingBy(OutMaterialScanRecord::getKey))
|
||||
.values()
|
||||
|
|
@ -368,7 +368,12 @@ public class OutCostCenterController extends BaseController {
|
|||
.setSerialNo(list.get(0).getSerialNo())
|
||||
.setFactoryNo(list.get(0).getFactoryNo())
|
||||
.setWarehouseNo(list.get(0).getWarehouseNo())
|
||||
.setBinLocation(list.get(0).getBinNo())
|
||||
.setBinLocation(qrCodeMasters.stream()
|
||||
.filter(qr -> StrUtil.equals(qr.getBarcodeCode(), list.get(0).getUniqNo()))
|
||||
.findFirst()
|
||||
.get()
|
||||
.getBinLocation()
|
||||
)
|
||||
.setNum(list.stream().map(OutMaterialScanRecord::getNum).reduce(BigDecimal.ZERO, BigDecimal::add))
|
||||
).toList()
|
||||
);
|
||||
|
|
@ -480,8 +485,7 @@ public class OutCostCenterController extends BaseController {
|
|||
}
|
||||
});
|
||||
qrCodeMasterService.updateBarCode(qrCodeMasters);
|
||||
submitSap(order, ticket, records, outCostcenterItemService.getList(order.getId())
|
||||
);
|
||||
submitSap(order, ticket, records, outCostcenterItemService.getList(order.getId()),qrCodeMasters);
|
||||
} else {
|
||||
List<OutCostcenterInfoItemVO> items = outCostcenterTicketItemService.getList(qo.getId());
|
||||
items.forEach(it -> {
|
||||
|
|
|
|||
|
|
@ -463,7 +463,7 @@ public class OutProduceController extends BaseController {
|
|||
}
|
||||
});
|
||||
qrCodeMasterService.updateBarCode(qrCodeMasters);
|
||||
submitSap(order, ticket, records, datas);
|
||||
submitSap(order, ticket, records, datas,qrCodeMasters);
|
||||
} else {
|
||||
inventoryForOutRepository.saveAll(request.getRecommendBatch()
|
||||
.stream()
|
||||
|
|
@ -481,7 +481,7 @@ public class OutProduceController extends BaseController {
|
|||
}
|
||||
|
||||
private void submitSap(WmsOutProduce order, WmsOutProduceTicket ticket, List<OutMaterialScanRecord> records
|
||||
, List<WmsOutProduceItem> datas) {
|
||||
, List<WmsOutProduceItem> datas,List<WmsQrCodeMaster> qrCodeMasters) {
|
||||
inventoryService.out(records.stream()
|
||||
.collect(Collectors.groupingBy(OutMaterialScanRecord::getKey))
|
||||
.values()
|
||||
|
|
@ -492,7 +492,12 @@ public class OutProduceController extends BaseController {
|
|||
.setSerialNo(list.get(0).getSerialNo())
|
||||
.setFactoryNo(list.get(0).getFactoryNo())
|
||||
.setWarehouseNo(list.get(0).getWarehouseNo())
|
||||
.setBinLocation(list.get(0).getBinNo())
|
||||
.setBinLocation(qrCodeMasters.stream()
|
||||
.filter(qr -> StrUtil.equals(qr.getBarcodeCode(), list.get(0).getUniqNo()))
|
||||
.findFirst()
|
||||
.get()
|
||||
.getBinLocation()
|
||||
)
|
||||
.setNum(list.stream().map(OutMaterialScanRecord::getNum).reduce(BigDecimal.ZERO, BigDecimal::add))
|
||||
).toList()
|
||||
);
|
||||
|
|
@ -601,8 +606,7 @@ public class OutProduceController extends BaseController {
|
|||
}
|
||||
});
|
||||
qrCodeMasterService.updateBarCode(qrCodeMasters);
|
||||
submitSap(order, ticket, records, outProduceItemService.getList(order.getId())
|
||||
);
|
||||
submitSap(order, ticket, records, outProduceItemService.getList(order.getId()),qrCodeMasters);
|
||||
} else {
|
||||
List<OutProduceInfoItemVO> items = outProduceTicketItemService.getList(qo.getId());
|
||||
items.forEach(it -> {
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ public class OutPurchaseController extends BaseController {
|
|||
* @param no 退料申请单编号
|
||||
*/
|
||||
@GetMapping("search")
|
||||
public ApiResult<List<ZWM3A05VO>> search(@RequestParam String no) {
|
||||
public ApiResult<ZWM3A05VO> search(@RequestParam String no) {
|
||||
WmsReturnRequest order = returnRequestService.lambdaQuery()
|
||||
.eq(WmsReturnRequest::getApprovalStatus, 1)
|
||||
.ne(WmsReturnRequest::getOutStatus, 1)
|
||||
|
|
@ -122,7 +122,7 @@ public class OutPurchaseController extends BaseController {
|
|||
)
|
||||
.toList()
|
||||
);
|
||||
return ApiResult.success(List.of(vo));
|
||||
return ApiResult.success(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -280,7 +280,12 @@ public class OutPurchaseController extends BaseController {
|
|||
.setSerialNo(list.get(0).getSerialNo())
|
||||
.setFactoryNo(list.get(0).getFactoryNo())
|
||||
.setWarehouseNo(list.get(0).getWarehouseNo())
|
||||
.setBinLocation(list.get(0).getBinNo())
|
||||
.setBinLocation(qrCodeMasters.stream()
|
||||
.filter(qr -> StrUtil.equals(qr.getBarcodeCode(), list.get(0).getUniqNo()))
|
||||
.findFirst()
|
||||
.get()
|
||||
.getBinLocation()
|
||||
)
|
||||
.setNum(list.stream().map(OutMaterialScanRecord::getNum).reduce(BigDecimal.ZERO, BigDecimal::add))
|
||||
).toList()
|
||||
);
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ public class TransferCompanyController extends BaseController {
|
|||
}
|
||||
});
|
||||
qrCodeMasterService.updateBarCode(qrCodeMasters);
|
||||
submitSap(order, ticket, records, datas, ticketItems);
|
||||
submitSap(order, ticket, records, datas, ticketItems,qrCodeMasters);
|
||||
} else {
|
||||
inventoryForOutRepository.saveAll(request.getRecommendBatch()
|
||||
.stream()
|
||||
|
|
@ -402,7 +402,7 @@ public class TransferCompanyController extends BaseController {
|
|||
}
|
||||
|
||||
private void submitSap(WmsTransferCompany order, WmsTransferCompanyTicket ticket, List<OutMaterialScanRecord> records
|
||||
, List<WmsTransferCompanyItem> datas, List<WmsTransferCompanyTicketItem> ticketItems) {
|
||||
, List<WmsTransferCompanyItem> datas, List<WmsTransferCompanyTicketItem> ticketItems,List<WmsQrCodeMaster> qrCodeMasters) {
|
||||
inventoryService.out(records.stream()
|
||||
.collect(Collectors.groupingBy(OutMaterialScanRecord::getKey))
|
||||
.values()
|
||||
|
|
@ -413,7 +413,12 @@ public class TransferCompanyController extends BaseController {
|
|||
.setSerialNo(list.get(0).getSerialNo())
|
||||
.setFactoryNo(list.get(0).getFactoryNo())
|
||||
.setWarehouseNo(list.get(0).getWarehouseNo())
|
||||
.setBinLocation(list.get(0).getBinNo())
|
||||
.setBinLocation(qrCodeMasters.stream()
|
||||
.filter(qr -> StrUtil.equals(qr.getBarcodeCode(), list.get(0).getUniqNo()))
|
||||
.findFirst()
|
||||
.get()
|
||||
.getBinLocation()
|
||||
)
|
||||
.setNum(list.stream().map(OutMaterialScanRecord::getNum).reduce(BigDecimal.ZERO, BigDecimal::add))
|
||||
).toList()
|
||||
);
|
||||
|
|
@ -520,6 +525,7 @@ public class TransferCompanyController extends BaseController {
|
|||
, records
|
||||
, transferCompanyItemService.getList(order.getId())
|
||||
, transferCompanyTicketItemService.lambdaQuery().eq(WmsTransferCompanyTicketItem::getTicketId, ticket.getId()).list()
|
||||
,qrCodeMasters
|
||||
);
|
||||
} else {
|
||||
List<TransferCompanyItemVO> items = transferCompanyTicketItemService.getList(qo.getId());
|
||||
|
|
|
|||
|
|
@ -405,7 +405,12 @@ public class TransferFactoryController extends BaseController {
|
|||
.setSerialNo(list.get(0).getSerialNo())
|
||||
.setFactoryNo(list.get(0).getFactoryNo())
|
||||
.setWarehouseNo(list.get(0).getWarehouseNo())
|
||||
.setBinLocation(list.get(0).getBinNo())
|
||||
.setBinLocation(qrCodeMasters.stream()
|
||||
.filter(qr -> StrUtil.equals(qr.getBarcodeCode(), list.get(0).getUniqNo()))
|
||||
.findFirst()
|
||||
.get()
|
||||
.getBinLocation()
|
||||
)
|
||||
.setNum(list.stream().map(OutMaterialScanRecord::getNum).reduce(BigDecimal.ZERO, BigDecimal::add))
|
||||
).toList()
|
||||
);
|
||||
|
|
@ -492,7 +497,12 @@ public class TransferFactoryController extends BaseController {
|
|||
.setSerialNo(list.get(0).getSerialNo())
|
||||
.setFactoryNo(list.get(0).getFactoryNo())
|
||||
.setWarehouseNo(list.get(0).getWarehouseNo())
|
||||
.setBinLocation(list.get(0).getBinNo())
|
||||
.setBinLocation(qrCodeMasters.stream()
|
||||
.filter(qr -> StrUtil.equals(qr.getBarcodeCode(), list.get(0).getUniqNo()))
|
||||
.findFirst()
|
||||
.get()
|
||||
.getBinLocation()
|
||||
)
|
||||
.setNum(list.stream().map(OutMaterialScanRecord::getNum).reduce(BigDecimal.ZERO, BigDecimal::add))
|
||||
).toList()
|
||||
);
|
||||
|
|
|
|||
|
|
@ -954,7 +954,7 @@ public class SapService {
|
|||
public SubcontractedOrderConfirmDTO zwm3a04(SubcontractedOrderConfirmQO query) {
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(query)).throwMessage("查询内容不可以为空");
|
||||
VUtil.trueThrowBusinessError(CollectionUtil.isEmpty(query.getIItems())).throwMessage("物料明细不能为空");
|
||||
|
||||
log.debug("SAP预请求数据:" + JSONUtil.toJsonStr(query));
|
||||
// 构造函数调用所需的输入参数
|
||||
Map<String, Object> parameters = new HashMap<>();
|
||||
parameters.put("I_EBELN", query.getIEbeln());
|
||||
|
|
@ -1290,7 +1290,7 @@ public class SapService {
|
|||
|
||||
/**
|
||||
* 退换货
|
||||
* @param head 批次信息头
|
||||
* @param head 批次信息头
|
||||
* @param itemList 批次信息列表
|
||||
* @return 批次信息返回结果,每个元素为 {@link ZWM3A24ReturnDTO} 类型
|
||||
*/
|
||||
|
|
@ -1339,7 +1339,7 @@ public class SapService {
|
|||
if (CollectionUtil.isNotEmpty(itemList)) {
|
||||
tables.put("ITEM", JCoUtil.toMapList(itemList));
|
||||
}
|
||||
JCoFunction function = exec("ZWM3A25", "HEAD",parameters, tables);
|
||||
JCoFunction function = exec("ZWM3A25", "HEAD", parameters, tables);
|
||||
JCoStructure structure = function.getExportParameterList().getStructure("ET_RETURN");
|
||||
print("OUTPUT", structure);
|
||||
VUtil.trueThrowBusinessError(!StrUtil.equals(structure.getString("TYPE"), "S"))
|
||||
|
|
|
|||
|
|
@ -54,8 +54,13 @@ public class JCoUtil {
|
|||
public static <T> List<Map<String, Object>> toMapList(List<T> datas) {
|
||||
return datas.stream().map(BeanUtil::toMap)
|
||||
.map(list -> list.entrySet().stream()
|
||||
.collect(Collectors.toMap(entry -> entry.getKey().toUpperCase(),
|
||||
Map.Entry::getValue)))
|
||||
.collect(Collectors.toMap(
|
||||
entry -> entry.getKey().toUpperCase(),
|
||||
entry -> entry.getValue() != null ? entry.getValue() : "",
|
||||
(v1, v2) -> v1
|
||||
)
|
||||
)
|
||||
)
|
||||
.toList();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import org.springframework.data.mongodb.core.mapping.Document;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
|
|
@ -43,11 +44,19 @@ public class OutMaterialScanRecord {
|
|||
*/
|
||||
private String batchNo;
|
||||
|
||||
public String getBatchNo() {
|
||||
return Objects.isNull(batchNo) ? "" : batchNo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 序列号
|
||||
*/
|
||||
private String serialNo;
|
||||
|
||||
public String getSerialNo() {
|
||||
return Objects.isNull(serialNo) ? "" : serialNo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 工厂编号
|
||||
*/
|
||||
|
|
@ -63,6 +72,10 @@ public class OutMaterialScanRecord {
|
|||
*/
|
||||
private String binNo;
|
||||
|
||||
public String getBinNo() {
|
||||
return Objects.isNull(binNo) ? "" : binNo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
|
|
@ -125,62 +138,62 @@ public class OutMaterialScanRecord {
|
|||
private String key;
|
||||
|
||||
public String getKey() {
|
||||
return this.materialNo + "|" + this.batchNo + "|" + this.serialNo + "|" + this.factoryNo + "|" + this.warehouseNo;
|
||||
return this.materialNo + "|" + this.getBatchNo() + "|" + this.getSerialNo() + "|" + this.factoryNo + "|" + this.warehouseNo;
|
||||
}
|
||||
|
||||
@Transient
|
||||
private String key1;
|
||||
|
||||
public String getKey1() {
|
||||
return this.materialNo + "|" + this.serialNo;
|
||||
return this.materialNo + "|" + this.getSerialNo();
|
||||
}
|
||||
|
||||
@Transient
|
||||
private String key3;
|
||||
|
||||
public String getKey3() {
|
||||
return this.serialNo + "|" + this.ext;
|
||||
return this.getSerialNo() + "|" + this.ext;
|
||||
}
|
||||
|
||||
@Transient
|
||||
private String key4;
|
||||
|
||||
public String getKey4() {
|
||||
return ebelp + "|" + this.materialNo + "|" + this.batchNo;
|
||||
return ebelp + "|" + this.materialNo + "|" + this.getBatchNo();
|
||||
}
|
||||
|
||||
@Transient
|
||||
private String key5;
|
||||
|
||||
public String getKey5() {
|
||||
return this.ebelp + "|" + this.serialNo;
|
||||
return this.ebelp + "|" + this.getSerialNo();
|
||||
}
|
||||
|
||||
@Transient
|
||||
private String key6;
|
||||
|
||||
public String getKey6() {
|
||||
return this.rspos + "|" + this.serialNo;
|
||||
return this.rspos + "|" + this.getSerialNo();
|
||||
}
|
||||
|
||||
@Transient
|
||||
private String key7;
|
||||
|
||||
public String getKey7() {
|
||||
return materialNo + "|" + batchNo;
|
||||
return materialNo + "|" + getBatchNo();
|
||||
}
|
||||
|
||||
@Transient
|
||||
private String key8;
|
||||
|
||||
public String getKey8() {
|
||||
return materialNo + "|" + batchNo + "|" + this.serialNo;
|
||||
return materialNo + "|" + getBatchNo() + "|" + this.getSerialNo();
|
||||
}
|
||||
|
||||
@Transient
|
||||
private String key9;
|
||||
|
||||
public String getKey9() {
|
||||
return materialNo + "|" + batchNo + "|" + this.serialNo + "|" + this.binNo;
|
||||
return materialNo + "|" + getBatchNo() + "|" + this.getSerialNo() + "|" + this.getBinNo();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import lombok.Data;
|
|||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Objects;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
|
|
@ -29,11 +30,19 @@ public class InventoryOutDTO {
|
|||
*/
|
||||
private String batchNo;
|
||||
|
||||
public String getBatchNo() {
|
||||
return Objects.isNull(batchNo) ? "" : batchNo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 序列号
|
||||
*/
|
||||
private String serialNo;
|
||||
|
||||
public String getSerialNo() {
|
||||
return Objects.isNull(serialNo) ? "" : serialNo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
|
|
@ -44,9 +53,13 @@ public class InventoryOutDTO {
|
|||
*/
|
||||
private String binLocation;
|
||||
|
||||
public String geBbinLocation() {
|
||||
return Objects.isNull(binLocation) ? "" : binLocation;
|
||||
}
|
||||
|
||||
private String key;
|
||||
|
||||
public String getKey() {
|
||||
return materialNo + "|" + factoryNo + "|" + warehouseNo + "|" + batchNo + "|" + serialNo + "|" + binLocation;
|
||||
return materialNo + "|" + factoryNo + "|" + warehouseNo + "|" + getBatchNo() + "|" + getSerialNo() + "|" + getBinLocation();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.nflg.wms.common.pojo.qo;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
|
@ -16,8 +17,8 @@ public class InCostCenterBackSubmitItemQRQO {
|
|||
private String binNo;
|
||||
|
||||
/**
|
||||
* 二维码唯一码列表
|
||||
* 二维码唯一码
|
||||
*/
|
||||
@NotEmpty
|
||||
private List<String> qrCodes;
|
||||
@NotBlank
|
||||
private String qrCode;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,71 @@
|
|||
package com.nflg.wms.common.pojo.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class InProduceOrderVO {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 单据号
|
||||
*/
|
||||
private String no;
|
||||
|
||||
/**
|
||||
* 生产订单号
|
||||
*/
|
||||
private String orderNo;
|
||||
|
||||
/**
|
||||
* 是否清单件
|
||||
*/
|
||||
private Boolean list;
|
||||
|
||||
/**
|
||||
* 状态,0:待收货;1:已收货;
|
||||
*/
|
||||
private Short state;
|
||||
|
||||
/**
|
||||
* 数据类型,0:半成品;1:成品
|
||||
*/
|
||||
@TableField("data_type")
|
||||
private Integer dataType;
|
||||
|
||||
/**
|
||||
* 物料凭证编号
|
||||
*/
|
||||
private String mblnr;
|
||||
|
||||
/**
|
||||
* 物料凭证年度
|
||||
*/
|
||||
private String mjahr;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 最后更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 最后更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
private List<InProduceOrderItemVO> items;
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.nflg.wms.repository.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Getter;
|
||||
|
|
@ -80,6 +81,7 @@ public class WmsReturnRequestItem implements Serializable {
|
|||
/**
|
||||
* 剩余数量
|
||||
*/
|
||||
@TableField(value = "\"left\"")
|
||||
private BigDecimal left;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.nflg.wms.repository.service.impl;
|
|||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
|
@ -16,6 +17,7 @@ import com.nflg.wms.common.util.VUtil;
|
|||
import com.nflg.wms.repository.entity.WmsInventory;
|
||||
import com.nflg.wms.repository.mapper.WmsInventoryMapper;
|
||||
import com.nflg.wms.repository.service.IWmsInventoryService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.retry.annotation.Backoff;
|
||||
import org.springframework.retry.annotation.Retryable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -33,6 +35,7 @@ import java.util.stream.Collectors;
|
|||
* @author 代码生成器生成
|
||||
* @since 2025
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class WmsInventoryServiceImpl extends ServiceImpl<WmsInventoryMapper, WmsInventory> implements IWmsInventoryService {
|
||||
|
||||
|
|
@ -49,6 +52,8 @@ public class WmsInventoryServiceImpl extends ServiceImpl<WmsInventoryMapper, Wms
|
|||
List<WmsInventory> dbInventories = group.values().stream()
|
||||
.map(inventory -> {
|
||||
InventoryOutDTO item = inventory.get(0);
|
||||
log.info("预出库信息:" + JSONUtil.toJsonStr(item));
|
||||
item.setNum(inventory.stream().map(InventoryOutDTO::getNum).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
List<WmsInventory> list = lambdaQuery()
|
||||
.eq(WmsInventory::getMaterialNo, item.getMaterialNo())
|
||||
.eq(WmsInventory::getBatchNo, item.getBatchNo())
|
||||
|
|
@ -63,7 +68,7 @@ public class WmsInventoryServiceImpl extends ServiceImpl<WmsInventoryMapper, Wms
|
|||
if (CollectionUtil.isEmpty(list)) {
|
||||
errorMaterialNos.add(item.getMaterialNo());
|
||||
} else {
|
||||
BigDecimal left = inventory.stream().map(InventoryOutDTO::getNum).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal left = item.getNum();
|
||||
for (WmsInventory info : list) {
|
||||
BigDecimal sub = NumberUtil.min(info.getNum(), left);
|
||||
left = left.subtract(sub);
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@
|
|||
|
||||
<select id="getVOByReceiveId" resultType="com.nflg.wms.common.pojo.vo.PoReceiveTaskItemVO">
|
||||
SELECT qri.*,qr.factory_code,wh.is_disable_location
|
||||
FROM wms_qc_receive qr
|
||||
INNER JOIN wms_qc_receive_item qri ON qr."id"=qri.receive_id
|
||||
FROM wms_po_receipt qr
|
||||
INNER JOIN wms_po_receipt_item qri ON qr."id"=qri.receive_id
|
||||
LEFT JOIN dictionary_item di ON qr.factory_code=di.code
|
||||
LEFT JOIN wms_warehouse wh ON wh.factory_id=di."id" AND wh."no"=qri.received_warehouse
|
||||
where qr.id=#{taskId}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
create_time,
|
||||
factory_code
|
||||
from wms_qc_receive
|
||||
where is_completed !=2 and is_check = true and source_type=0
|
||||
where is_completed !=2 and is_check = 1 and source_type=0
|
||||
<if test="orderNo != null and orderNo != ''">
|
||||
and ( in_no like concat( '%',#{orderNo},'%')
|
||||
or order_no like concat( '%',#{orderNo},'%')
|
||||
|
|
|
|||
Loading…
Reference in New Issue