Browse Source

售后增加包条码字段 完善搜索功能

visual
汤建军 4 months ago
parent
commit
dc5d13aa98
  1. 7
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java
  2. 76
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  3. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

7
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java

@ -277,6 +277,13 @@ public class AftersalesWorkOrderEntity extends TenantEntity {
@ApiModelProperty(value = "标识 1订单 2 零担 3库存品 ") @ApiModelProperty(value = "标识 1订单 2 零担 3库存品 ")
@TableField(exist = false) @TableField(exist = false)
private String identifying; private String identifying;
/**
* 标识 1订单 2 零担 3库存品
*/
@ApiModelProperty(value = "标识 1订单 2 零担 3库存品 ")
@TableField(exist = false)
private String packageCode;
/** /**
* 处理仓库ID * 处理仓库ID
*/ */

76
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml

@ -59,12 +59,13 @@
lawo.work_order_type, lawo.work_order_type,
lawo.discovery_node, lawo.discovery_node,
lawo.work_order_number, lawo.work_order_number,
laap.waybill_number,
lawo.order_code, lawo.order_code,
lawo.train_number, lawo.train_number,
GROUP_CONCAT(DISTINCT laap.`first` separator ',') as `first`, t.`first` AS `first`,
GROUP_CONCAT(DISTINCT laap.secondary separator ',') as secondary, t.secondary AS secondary,
group_concat( DISTINCT laap.brand_name SEPARATOR ',' ) AS brandName, t.brand_name AS brandName,
t.waybill_number AS waybillNumber,
t.package_code AS packageCode,
lawo.vehicle_route, lawo.vehicle_route,
lawo.deliver_goods_time, lawo.deliver_goods_time,
lawo.discovery_time, lawo.discovery_time,
@ -96,7 +97,21 @@
AND lap.conditions IN ( 1, 2 ) AND lap.conditions IN ( 1, 2 )
LEFT JOIN logpm_aftersales_completion_record lacr ON lacr.work_order_id = lawo.id LEFT JOIN logpm_aftersales_completion_record lacr ON lacr.work_order_id = lawo.id
AND lacr.is_deleted = '0' AND lacr.is_deleted = '0'
left join logpm_aftersales_abnormal_package laap on lawo.id = laap.work_order_id LEFT JOIN (SELECT
a.id,
group_concat( DISTINCT b.`first` SEPARATOR ',' ) AS `first`,
group_concat( DISTINCT b.secondary SEPARATOR ',' ) AS secondary,
group_concat( DISTINCT b.brand_name SEPARATOR ',' ) AS brand_name,
group_concat( DISTINCT b.package_code SEPARATOR ',' ) AS package_code,
group_concat( DISTINCT b.waybill_number SEPARATOR ',' ) AS waybill_number
FROM
logpm_aftersales_work_order AS a
LEFT JOIN logpm_aftersales_abnormal_package AS b ON a.id = b.work_order_id
WHERE
a.is_deleted = 0
AND b.is_deleted = 0
GROUP BY
a.id) AS t ON t.id = lawo.id
<where> <where>
lawo.is_deleted = 0 lawo.is_deleted = 0
<if test="param.workOrderStatusNameS != null and param.workOrderStatusNameS != '' ">and lawo.work_order_status = #{param.workOrderStatusNameS } </if> <if test="param.workOrderStatusNameS != null and param.workOrderStatusNameS != '' ">and lawo.work_order_status = #{param.workOrderStatusNameS } </if>
@ -108,17 +123,13 @@
<if test="param.waybillNumber != null and param.waybillNumber != '' ">and lawo.waybill_number like concat('%', #{param.waybillNumber },'%') </if> <if test="param.waybillNumber != null and param.waybillNumber != '' ">and lawo.waybill_number like concat('%', #{param.waybillNumber },'%') </if>
<if test="param.orderCode != null and param.orderCode != '' ">and lawo.order_code like concat('%', #{param.orderCode },'%') </if> <if test="param.orderCode != null and param.orderCode != '' ">and lawo.order_code like concat('%', #{param.orderCode },'%') </if>
<if test="param.trainNumber != null and param.trainNumber != '' ">and lawo.train_number like concat('%', #{param.trainNumber },'%') </if> <if test="param.trainNumber != null and param.trainNumber != '' ">and lawo.train_number like concat('%', #{param.trainNumber },'%') </if>
<if test="param.first != null and param.first != '' ">and lawo.first like concat('%', #{param.first },'%') </if>
<if test="param.secondary != null and param.secondary != '' ">and lawo.secondary like concat('%', #{param.secondary },'%') </if>
<if test="param.vehicleRoute != null and param.vehicleRoute != '' ">and lawo.vehicle_route like concat('%', #{param.vehicleRoute },'%') </if> <if test="param.vehicleRoute != null and param.vehicleRoute != '' ">and lawo.vehicle_route like concat('%', #{param.vehicleRoute },'%') </if>
<if test="param.brandName !=null and param.brandName !='' " >and lawo.brand_name like concat('%', #{param.brandName },'%') </if>
<if test="param.deliverGoodsTime != null ">and date_format(from_unixtime( lawo.deliver_goods_time),'%Y-%m-%d') = date_format(#{param.deliverGoodsTime },'%Y-%m-%d') </if> <if test="param.deliverGoodsTime != null ">and date_format(from_unixtime( lawo.deliver_goods_time),'%Y-%m-%d') = date_format(#{param.deliverGoodsTime },'%Y-%m-%d') </if>
<if test="param.discoveryTime != null ">and date_format(from_unixtime(lawo.discovery_time),'%Y-%m-%d') = date_format( #{param.discoveryTime},'%Y-%m-%d') </if> <if test="param.discoveryTime != null ">and date_format(from_unixtime(lawo.discovery_time),'%Y-%m-%d') = date_format( #{param.discoveryTime},'%Y-%m-%d') </if>
<if test="param.warehousingTime != null "> and date_format(from_unixtime(lawo.warehousing_time),'%Y-%m-%d') = date_format( #{param.warehousingTime},'%Y-%m-%d') </if> <if test="param.warehousingTime != null "> and date_format(from_unixtime(lawo.warehousing_time),'%Y-%m-%d') = date_format( #{param.warehousingTime},'%Y-%m-%d') </if>
<if test="param.deliveryTime != null ">and date_format(from_unixtime( lawo.delivery_time),'%Y-%m-%d') = date_format(#{param.deliveryTime} param.deliveryTime,'%Y-%m-%d') </if> <if test="param.deliveryTime != null ">and date_format(from_unixtime( lawo.delivery_time),'%Y-%m-%d') = date_format(#{param.deliveryTime} param.deliveryTime,'%Y-%m-%d') </if>
<if test="param.auditTime != null ">and date_format(from_unixtime(lawo.audit_time),'%Y-%m-%d') = date_format(#{param.auditTime},'%Y-%m-%d') </if> <if test="param.auditTime != null ">and date_format(from_unixtime(lawo.audit_time),'%Y-%m-%d') = date_format(#{param.auditTime},'%Y-%m-%d') </if>
<if test="param.entryTime != null ">and date_format(from_unixtime(lawo.entry_time),'%Y-%m-%d') = date_format(#{param.entryTime},'%Y-%m-%d') </if> <if test="param.entryTime != null ">and date_format(from_unixtime(lawo.entry_time),'%Y-%m-%d') = date_format(#{param.entryTime},'%Y-%m-%d') </if>
<if test="param.overTime != null ">and date_format(from_unixtime(lawo.over_time),'%Y-%m-%d') = date_format(#{param.overTime}),'%Y-%m-%d') </if> <if test="param.overTime != null ">and date_format(from_unixtime(lawo.over_time),'%Y-%m-%d') = date_format(#{param.overTime}),'%Y-%m-%d') </if>
<if test="param.waybillMall != null and param.waybillMall != '' ">and lawo.waybill_mall like concat('%', #{param.waybillMall },'%') </if> <if test="param.waybillMall != null and param.waybillMall != '' ">and lawo.waybill_mall like concat('%', #{param.waybillMall },'%') </if>
<if test="param.deliveryDriver != null and param.deliveryDriver != '' ">and lawo.delivery_driver = #{param.deliveryDriver } </if> <if test="param.deliveryDriver != null and param.deliveryDriver != '' ">and lawo.delivery_driver = #{param.deliveryDriver } </if>
@ -152,15 +163,15 @@
<if test="param.workOrderType != null and param.workOrderType != '' ">and lawo.work_order_type = #{param.workOrderType } </if> <if test="param.workOrderType != null and param.workOrderType != '' ">and lawo.work_order_type = #{param.workOrderType } </if>
<if test="param.discoveryNode != null and param.discoveryNode != '' ">and lawo.discovery_node = #{param.discoveryNode } </if> <if test="param.discoveryNode != null and param.discoveryNode != '' ">and lawo.discovery_node = #{param.discoveryNode } </if>
<if test="param.workOrderNumber != null and param.workOrderNumber != '' ">and lawo.work_order_number like concat('%',#{param.workOrderNumber },'%') </if> <if test="param.workOrderNumber != null and param.workOrderNumber != '' ">and lawo.work_order_number like concat('%',#{param.workOrderNumber },'%') </if>
<if test="param.waybillNumber != null and param.waybillNumber != '' ">and lawo.waybill_number like concat('%', #{param.waybillNumber },'%') </if>
<if test="param.orderCode != null and param.orderCode != '' ">and lawo.order_code like concat('%', #{param.orderCode },'%') </if>
<if test="param.trainNumber != null and param.trainNumber != '' ">and lawo.train_number like concat('%', #{param.trainNumber },'%') </if> <if test="param.trainNumber != null and param.trainNumber != '' ">and lawo.train_number like concat('%', #{param.trainNumber },'%') </if>
<if test="param.first != null and param.first != '' ">and lawo.first like concat('%', #{param.first },'%') </if>
<if test="param.secondary != null and param.secondary != '' ">and lawo.secondary like concat('%', #{param.secondary },'%') </if>
<if test="param.vehicleRoute != null and param.vehicleRoute != '' ">and lawo.vehicle_route like concat('%', #{param.vehicleRoute },'%') </if> <if test="param.vehicleRoute != null and param.vehicleRoute != '' ">and lawo.vehicle_route like concat('%', #{param.vehicleRoute },'%') </if>
<if test="param.workOrderStatus != null and param.workOrderStatus != '' and param.handleStatus != 40 "> and lawo.work_order_status in ( #{param.workOrderStatus }) </if> <if test="param.workOrderStatus != null and param.workOrderStatus != '' and param.handleStatus != 40 "> and lawo.work_order_status in ( #{param.workOrderStatus }) </if>
<if test="param.customerServiceState!= null and param.customerServiceState == 80 ">and lawo.work_order_status in ('10') </if> <if test="param.customerServiceState!= null and param.customerServiceState == 80 ">and lawo.work_order_status in ('10') </if>
<if test="param.first != null and param.first != '' ">and t.first like concat('%',#{param.first},'%') </if>
<if test="param.secondary != null and param.secondary != '' ">and t.secondary like concat('%',#{param.secondary},'%') </if>
<if test="param.brandName != null and param.brandName != '' ">and t.brand_name like concat('%',#{param.brandName},'%') </if>
<if test="param.waybillNumber != null and param.waybillNumber != ''">and t.waybill_number like concat('%',#{param.waybillNumber},'%') </if>
<if test="param.packageCode != null and param.packageCode != ''">and t.package_code like concat('%',#{param.packageCode},'%') </if>
</where> </where>
group by lawo.id group by lawo.id
ORDER BY lawo.create_time DESC ORDER BY lawo.create_time DESC
@ -320,11 +331,8 @@
law.initiation_identification, law.initiation_identification,
law.discovery_node, law.discovery_node,
law.work_order_number, law.work_order_number,
law.waybill_number,
law.order_code, law.order_code,
law.train_number, law.train_number,
laap.FIRST,
laap.secondary,
law.vehicle_route, law.vehicle_route,
law.deliver_goods_time, law.deliver_goods_time,
law.discovery_time, law.discovery_time,
@ -346,26 +354,41 @@
law.audit_time, law.audit_time,
law.entry_time, law.entry_time,
law.operator, law.operator,
laap.brand_name t.`first` AS `first`,
t.secondary AS secondary,
t.brand_name AS brandName,
t.waybill_number AS waybillNumber,
t.package_code AS packageCode
FROM FROM
logpm_aftersales_processor lap logpm_aftersales_processor lap
LEFT JOIN logpm_aftersales_work_order law ON lap.work_order_id = law.id LEFT JOIN logpm_aftersales_work_order law ON lap.work_order_id = law.id
left join logpm_aftersales_abnormal_package laap on laap.work_order_id=law.id LEFT JOIN (SELECT
a.id,
group_concat( DISTINCT b.`first` SEPARATOR ',' ) AS `first`,
group_concat( DISTINCT b.secondary SEPARATOR ',' ) AS secondary,
group_concat( DISTINCT b.brand_name SEPARATOR ',' ) AS brand_name,
group_concat( DISTINCT b.package_code SEPARATOR ',' ) AS package_code,
group_concat( DISTINCT b.waybill_number SEPARATOR ',' ) AS waybill_number
FROM
logpm_aftersales_work_order AS a
LEFT JOIN logpm_aftersales_abnormal_package AS b ON a.id = b.work_order_id
WHERE
a.is_deleted = 0
AND b.is_deleted = 0
GROUP BY
a.id) AS t ON t.id = law.id
<where> <where>
lap.conditions != '3' and lap.is_deleted = 0 and law.id is not null and lap.processing_status in ('1','3') and lap.types_of = '2' and law.work_order_status in ('10','20','30') lap.conditions != '3' and lap.is_deleted = 0 and law.id is not null and lap.processing_status in ('1','3') and lap.types_of = '2' and law.work_order_status in ('10','20','30')
<if test="param.workOrderStatusNameS != null and param.workOrderStatusNameS != '' ">and law.work_order_status = #{param.workOrderStatusNameS } </if> <if test="param.workOrderStatusNameS != null and param.workOrderStatusNameS != '' ">and law.work_order_status = #{param.workOrderStatusNameS } </if>
<if test="param.operator != null and param.operator != '' ">and law.operator = #{param.operator } </if>
<if test="param.workOrderStatus != null and param.workOrderStatus != ''">and law.work_order_status = #{param.workOrderStatus}</if> <if test="param.workOrderStatus != null and param.workOrderStatus != ''">and law.work_order_status = #{param.workOrderStatus}</if>
<if test="param.warehouseId != null and param.warehouseId != ''">and lap.business_id = #{param.warehouseId}</if> <if test="param.warehouseId != null and param.warehouseId != ''">and lap.business_id = #{param.warehouseId}</if>
<if test="param.workOrderType != null and param.workOrderType != ''">and law.work_order_type = #{param.workOrderType}</if> <if test="param.workOrderType != null and param.workOrderType != ''">and law.work_order_type = #{param.workOrderType}</if>
<if test="param.discoveryNode != null and param.discoveryNode != ''">and law.discovery_node = #{param.discoveryNode}</if> <if test="param.discoveryNode != null and param.discoveryNode != ''">and law.discovery_node = #{param.discoveryNode}</if>
<if test="param.workOrderNumber != null and param.workOrderNumber != ''">and law.work_order_number like concat('%',#{param.workOrderNumber},'%')</if> <if test="param.workOrderNumber != null and param.workOrderNumber != ''">and law.work_order_number like concat('%',#{param.workOrderNumber},'%')</if>
<if test="param.waybillNumber != null and param.waybillNumber != ''">and law.waybill_number like concat('%',#{param.waybillNumber},'%')</if>
<if test="param.orderCode != null and param.orderCode != ''">and law.order_code like concat('%',#{param.orderCode},'%')</if> <if test="param.orderCode != null and param.orderCode != ''">and law.order_code like concat('%',#{param.orderCode},'%')</if>
<if test="param.first != null and param.first != ''">and laap.first like concat('%',#{param.first},'%')</if>
<if test="param.secondary != null and param.secondary != ''">and laap.secondary like concat('%',#{param.secondary},'%')</if>
<if test="param.waybillMall != null and param.waybillMall != ''">and law.waybill_mall like concat('%',#{param.waybillMall},'%')</if> <if test="param.waybillMall != null and param.waybillMall != ''">and law.waybill_mall like concat('%',#{param.waybillMall},'%')</if>
<if test="param.brandName != null and param.brandName != ''">and law.brand_name like concat('%',#{param.brandName},'%')</if>
<if test="param.customerServiceName != null and param.customerServiceName != ''">and law.customer_service_name like concat('%',#{param.customerServiceName},'%')</if> <if test="param.customerServiceName != null and param.customerServiceName != ''">and law.customer_service_name like concat('%',#{param.customerServiceName},'%')</if>
<if test="param.deliveryDriver != null and param.deliveryDriver != '' ">and law.delivery_driver like concat('%',#{param.deliveryDriver},'%') </if> <if test="param.deliveryDriver != null and param.deliveryDriver != '' ">and law.delivery_driver like concat('%',#{param.deliveryDriver},'%') </if>
<if test="param.trainNumber != null and param.trainNumber != '' ">and law.train_number like concat('%', #{param.trainNumber },'%') </if> <if test="param.trainNumber != null and param.trainNumber != '' ">and law.train_number like concat('%', #{param.trainNumber },'%') </if>
@ -380,7 +403,11 @@
<if test="param.auditTime != null ">and date_format(from_unixtime(law.audit_time),'%Y-%m-%d') = date_format(#{param.auditTime},'%Y-%m-%d') </if> <if test="param.auditTime != null ">and date_format(from_unixtime(law.audit_time),'%Y-%m-%d') = date_format(#{param.auditTime},'%Y-%m-%d') </if>
<if test="param.entryTime != null ">and date_format(from_unixtime(law.entry_time),'%Y-%m-%d') = date_format(#{param.entryTime},'%Y-%m-%d') </if> <if test="param.entryTime != null ">and date_format(from_unixtime(law.entry_time),'%Y-%m-%d') = date_format(#{param.entryTime},'%Y-%m-%d') </if>
<if test="param.overTime != null ">and date_format(from_unixtime(law.over_time),'%Y-%m-%d') = date_format(#{param.overTime}),'%Y-%m-%d') </if> <if test="param.overTime != null ">and date_format(from_unixtime(law.over_time),'%Y-%m-%d') = date_format(#{param.overTime}),'%Y-%m-%d') </if>
<if test="param.brandName != null and param.brandName != '' ">and laap.brand_name like concat('%',#{param.brandName},'%') </if> <if test="param.first != null and param.first != '' ">and t.first like concat('%',#{param.first},'%') </if>
<if test="param.secondary != null and param.secondary != '' ">and t.secondary like concat('%',#{param.secondary},'%') </if>
<if test="param.brandName != null and param.brandName != '' ">and t.brand_name like concat('%',#{param.brandName},'%') </if>
<if test="param.waybillNumber != null and param.waybillNumber != ''">and t.waybill_number like concat('%',#{param.waybillNumber},'%') </if>
<if test="param.packageCode != null and param.packageCode != ''">and t.package_code like concat('%',#{param.packageCode},'%') </if>
</where> </where>
</select> </select>
@ -477,7 +504,6 @@
left join logpm_aftersales_abnormal_package laap on laap.work_order_id=lawo.id left join logpm_aftersales_abnormal_package laap on laap.work_order_id=lawo.id
LEFT JOIN `logpm_distribution_parcel_list` `ldpl` ON `ldpl`.`order_package_code` = `laap`.`package_code` LEFT JOIN `logpm_distribution_parcel_list` `ldpl` ON `ldpl`.`order_package_code` = `laap`.`package_code`
LEFT JOIN `logpm_distribution_stock_article` `ldsa` ON `ldsa`.`id` = `ldpl`.`stock_article_id` LEFT JOIN `logpm_distribution_stock_article` `ldsa` ON `ldsa`.`id` = `ldpl`.`stock_article_id`
LEFT JOIN `logpm_aftersales_processing_results` `lapr` ON `lapr`.`work_order_id` = `lap`.`work_order_id` LEFT JOIN `logpm_aftersales_processing_results` `lapr` ON `lapr`.`work_order_id` = `lap`.`work_order_id`
LEFT JOIN `logpm_aftersales_completion_record` `lacr` ON `lacr`.`work_order_id` = `lapr`.`work_order_id` LEFT JOIN `logpm_aftersales_completion_record` `lacr` ON `lacr`.`work_order_id` = `lapr`.`work_order_id`
<where> <where>

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -4681,7 +4681,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return null; return null;
} }
// List<DistributionParcelListVO> parcelListVOIPage = new ArrayList<>(); // List<DistributionParcelListVO> parcelListVOIPage = new ArrayList<>();
List<DistributionLoadscanEntity> loadscanEntities = distributionLoadscanMapper.selectList(Wrappers.<DistributionLoadscanEntity>query().lambda().eq(DistributionLoadscanEntity::getDeliveryId, deliveryId).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); List<DistributionLoadscanEntity> loadscanEntities = distributionLoadscanMapper.selectList(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, deliveryId)
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
Map<Long, DistributionLoadscanEntity> loadingDataMap = null; Map<Long, DistributionLoadscanEntity> loadingDataMap = null;
if (Func.isNotEmpty(loadscanEntities)) { if (Func.isNotEmpty(loadscanEntities)) {
loadingDataMap = loadscanEntities.stream().collect(Collectors.toMap(DistributionLoadscanEntity::getPackageId, Function.identity(), (k1, k2) -> k2)); loadingDataMap = loadscanEntities.stream().collect(Collectors.toMap(DistributionLoadscanEntity::getPackageId, Function.identity(), (k1, k2) -> k2));

Loading…
Cancel
Save