fix(order): 修复合同ID查询逻辑错误
- 修正了销售异议查询中的订单ID参数错误 - 修正了应收账款查询中的订单ID参数错误 - 修正了运单查询中的订单ID参数错误 - 简化了合同ID直接查询逻辑,移除冗余订单查询步骤 - 修复了线圈材料查询中的订单ID条件错误
This commit is contained in:
@@ -259,30 +259,18 @@ public class CrmOrderItemServiceImpl implements ICrmOrderItemService {
|
||||
public CrmContractOrderFinanceVo queryFinanceAndObjectionByContractId(Long contractId) {
|
||||
CrmContractOrderFinanceVo result = new CrmContractOrderFinanceVo();
|
||||
|
||||
LambdaQueryWrapper<CrmOrder> orderWrapper = new LambdaQueryWrapper<>();
|
||||
orderWrapper.eq(CrmOrder::getContractId, contractId);
|
||||
List<CrmOrder> orders = crmOrderMapper.selectList(orderWrapper);
|
||||
|
||||
if (orders == null || orders.isEmpty()) {
|
||||
return result;
|
||||
}
|
||||
|
||||
List<Long> orderIds = orders.stream()
|
||||
.map(CrmOrder::getOrderId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
LambdaQueryWrapper<CrmSalesObjection> objectionWrapper = new LambdaQueryWrapper<>();
|
||||
objectionWrapper.in(CrmSalesObjection::getOrderId, orderIds);
|
||||
objectionWrapper.in(CrmSalesObjection::getOrderId, contractId);
|
||||
List<CrmSalesObjectionVo> objectionList = crmSalesObjectionMapper.selectVoList(objectionWrapper);
|
||||
result.setObjectionList(objectionList);
|
||||
|
||||
LambdaQueryWrapper<com.klp.domain.WmsReceivable> receivableWrapper = new LambdaQueryWrapper<>();
|
||||
receivableWrapper.in(WmsReceivable::getOrderId, orderIds);
|
||||
receivableWrapper.in(WmsReceivable::getOrderId, contractId);
|
||||
List<WmsReceivableVo> receivableList = wmsReceivableMapper.selectVoList(receivableWrapper);
|
||||
result.setReceivableList(receivableList);
|
||||
|
||||
LambdaQueryWrapper<WmsDeliveryWaybill> waybillWrapper = new LambdaQueryWrapper<>();
|
||||
waybillWrapper.in(WmsDeliveryWaybill::getOrderId, orderIds);
|
||||
waybillWrapper.in(WmsDeliveryWaybill::getOrderId, contractId);
|
||||
List<WmsDeliveryWaybillVo> wmsDeliveryWaybills = wmsDeliveryWaybillMapper.selectVoList(waybillWrapper);
|
||||
result.setWmsDeliveryWaybills(wmsDeliveryWaybills);
|
||||
|
||||
@@ -442,18 +430,9 @@ public class CrmOrderItemServiceImpl implements ICrmOrderItemService {
|
||||
|
||||
@Override
|
||||
public List<WmsMaterialCoilVo> queryCoilsByContractId(Long contractId) {
|
||||
LambdaQueryWrapper<CrmOrder> orderWrapper = new LambdaQueryWrapper<>();
|
||||
orderWrapper.eq(CrmOrder::getContractId, contractId);
|
||||
List<CrmOrder> orders = crmOrderMapper.selectList(orderWrapper);
|
||||
if (orders == null || orders.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<Long> orderIds = orders.stream()
|
||||
.map(CrmOrder::getOrderId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
LambdaQueryWrapper<WmsDeliveryWaybill> waybillWrapper = new LambdaQueryWrapper<>();
|
||||
waybillWrapper.in(WmsDeliveryWaybill::getOrderId, orderIds);
|
||||
waybillWrapper.eq(WmsDeliveryWaybill::getOrderId, contractId);
|
||||
List<WmsDeliveryWaybill> waybills = wmsDeliveryWaybillMapper.selectList(waybillWrapper);
|
||||
if (waybills == null || waybills.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
|
||||
Reference in New Issue
Block a user