feat(crm): 添加根据钢卷ID查询订单信息功能
- 在CrmOrderController中新增getOrderByCoilId接口 - 实现钢卷ID到订单信息的查询链路:钢卷ID -> 发货明细 -> 发货单 -> 订单 - 添加WMS发货单和发货明细相关依赖注入 - 优化CrmOrderMapper.xml中的SQL字段对齐格式 - 提供null值检查和错误响应处理
This commit is contained in:
@@ -37,6 +37,12 @@ public interface ICrmOrderService {
|
||||
*/
|
||||
List<CrmOrderVo> queryList(CrmOrderBo bo);
|
||||
|
||||
/**
|
||||
* 根据钢卷ID查询对应的订单信息(含客户信息)
|
||||
* 查询链路:钢卷ID -> 发货明细 -> 发货单 -> 订单
|
||||
*/
|
||||
CrmOrderVo getOrderByCoilId(Long coilId);
|
||||
|
||||
/**
|
||||
* 新增正式订单主
|
||||
*/
|
||||
|
||||
@@ -23,6 +23,10 @@ import com.klp.domain.bo.WmsMaterialCoilBo;
|
||||
import com.klp.domain.vo.WmsMaterialCoilVo;
|
||||
import com.klp.service.IWmsCoilContractRelService;
|
||||
import com.klp.service.IWmsMaterialCoilService;
|
||||
import com.klp.domain.WmsDeliveryWaybill;
|
||||
import com.klp.domain.WmsDeliveryWaybillDetail;
|
||||
import com.klp.mapper.WmsDeliveryWaybillDetailMapper;
|
||||
import com.klp.mapper.WmsDeliveryWaybillMapper;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -45,6 +49,10 @@ public class CrmOrderServiceImpl implements ICrmOrderService {
|
||||
|
||||
private final IWmsMaterialCoilService materialCoilService;
|
||||
|
||||
private final WmsDeliveryWaybillDetailMapper wmsDeliveryWaybillDetailMapper;
|
||||
|
||||
private final WmsDeliveryWaybillMapper wmsDeliveryWaybillMapper;
|
||||
|
||||
/**
|
||||
* 查询正式订单主
|
||||
*/
|
||||
@@ -66,6 +74,27 @@ public class CrmOrderServiceImpl implements ICrmOrderService {
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据钢卷ID查询对应的订单信息(含客户信息)
|
||||
*/
|
||||
@Override
|
||||
public CrmOrderVo getOrderByCoilId(Long coilId) {
|
||||
LambdaQueryWrapper<WmsDeliveryWaybillDetail> detailQuery = Wrappers.lambdaQuery();
|
||||
detailQuery.eq(WmsDeliveryWaybillDetail::getCoilId, coilId);
|
||||
detailQuery.eq(WmsDeliveryWaybillDetail::getDelFlag, 0);
|
||||
WmsDeliveryWaybillDetail detail = wmsDeliveryWaybillDetailMapper.selectOne(detailQuery);
|
||||
if (detail == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
WmsDeliveryWaybill waybill = wmsDeliveryWaybillMapper.selectById(detail.getWaybillId());
|
||||
if (waybill == null || waybill.getOrderId() == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return queryById(String.valueOf(waybill.getOrderId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询正式订单主列表
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user