Browse Source

Merge remote-tracking branch 'origin/dev' into dev

visual
zhaoqiaobo 5 months ago
parent
commit
9ad76c54d6
  1. 7
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesWorkOrderEntity.java
  2. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadOrderInfoVO.java
  3. 76
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  4. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  5. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
  6. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml
  7. 31
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  8. 84
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  9. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml

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库存品 ")
@TableField(exist = false)
private String identifying;
/**
* 标识 1订单 2 零担 3库存品
*/
@ApiModelProperty(value = "标识 1订单 2 零担 3库存品 ")
@TableField(exist = false)
private String packageCode;
/**
* 处理仓库ID
*/

1
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadOrderInfoVO.java

@ -9,6 +9,7 @@ import java.math.BigDecimal;
public class CarsLoadOrderInfoVO implements Serializable {
private String orderCode;
private String waybillNo;
private Integer orderNum;
private Integer planNum;
private Integer loadingNum;

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

@ -59,12 +59,13 @@
lawo.work_order_type,
lawo.discovery_node,
lawo.work_order_number,
laap.waybill_number,
lawo.order_code,
lawo.train_number,
GROUP_CONCAT(DISTINCT laap.`first` separator ',') as `first`,
GROUP_CONCAT(DISTINCT laap.secondary separator ',') as secondary,
group_concat( DISTINCT laap.brand_name SEPARATOR ',' ) AS brandName,
t.`first` AS `first`,
t.secondary AS secondary,
t.brand_name AS brandName,
t.waybill_number AS waybillNumber,
t.package_code AS packageCode,
lawo.vehicle_route,
lawo.deliver_goods_time,
lawo.discovery_time,
@ -96,7 +97,21 @@
AND lap.conditions IN ( 1, 2 )
LEFT JOIN logpm_aftersales_completion_record lacr ON lacr.work_order_id = lawo.id
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>
lawo.is_deleted = 0
<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.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.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.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.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.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.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.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>
@ -152,15 +163,15 @@
<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.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.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.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.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>
group by lawo.id
ORDER BY lawo.create_time DESC
@ -320,11 +331,8 @@
law.initiation_identification,
law.discovery_node,
law.work_order_number,
law.waybill_number,
law.order_code,
law.train_number,
laap.FIRST,
laap.secondary,
law.vehicle_route,
law.deliver_goods_time,
law.discovery_time,
@ -346,26 +354,41 @@
law.audit_time,
law.entry_time,
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
logpm_aftersales_processor lap
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>
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.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.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.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.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.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.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.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>
@ -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.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.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>
</select>
@ -477,7 +504,6 @@
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_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_completion_record` `lacr` ON `lacr`.`work_order_id` = `lapr`.`work_order_id`
<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;
}
// 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;
if (Func.isNotEmpty(loadscanEntities)) {
loadingDataMap = loadscanEntities.stream().collect(Collectors.toMap(DistributionLoadscanEntity::getPackageId, Function.identity(), (k1, k2) -> k2));

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml

@ -845,8 +845,9 @@
IFNULL(sum(ltcls.num),0) loadingNum,
IFNULL(sum(ltcls.unload_num),0) unloadNum
from logpm_trunkline_cars_load_scan ltcls
left join logpm_trunkline_cars_order ltco on ltco.waybill_id = ltcls.waybill_id and ltco.order_code = ltcls.order_code
left join logpm_trunkline_cars_order ltco on ltco.waybill_no = ltcls.waybill_no and ltco.order_code = ltcls.order_code
where ltcls.load_id = #{loadId}
and ltco.id is null
GROUP BY IFNULL(ltcls.waybill_no,'--'),
ltcls.order_code
order by IFNULL(ltcls.waybill_no,'--') desc, ltcls.order_code desc

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml

@ -173,10 +173,11 @@
<select id="findCarsLoadOrderInfoListPlan" resultType="com.logpm.trunkline.vo.CarsLoadOrderInfoVO">
select ltco.order_code orderCode,
ltco.waybill_no waybillNo,
ltco.plan_num planNum,
ltco.real_num loadingNum,
IFNULL(sum(ltcls.num),0) loadingNum,
lww.check_user_name checkUserName,
IFNULL(ltco.unload_num,0) unloadNum,
IFNULL(sum(ltcls.unload_num),0) unloadNum,
IFNULL(lww.total_freight/lww.total_count*ltwo.total_number,0) orderFreight,
IFNULL(lww.total_freight/lww.total_count*ltco.unload_num,0) unloadIncome,
IFNULL(lww.total_freight/lww.total_count*ltco.plan_num,0) orderLineCost,

31
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -3027,7 +3027,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
Map<String, Long> orderCodeCounts = importOrderNoPackageExcelDTOS.stream()
.collect(Collectors.groupingBy(a->(a.getOrderCode()+"&"+a.getFirsts()), Collectors.counting()));
.collect(Collectors.groupingBy(a->(a.getOrderCode()+"&"+a.getMaterialName()), Collectors.counting()));
Set<String> duplicateOrderCodes = orderCodeCounts.entrySet().stream()
.filter(entry -> entry.getValue() > 1)
@ -3035,8 +3035,8 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
.collect(Collectors.toSet());
if(!duplicateOrderCodes.isEmpty()){
log.warn("#################importCustomizedOuPai: 订单号品类重复 {}",duplicateOrderCodes);
return R.fail(405, "包条码重复"+duplicateOrderCodes);
log.warn("#################importCustomizedOuPai: 订单号物料重复 {}",duplicateOrderCodes);
return R.fail(405, "订单号物料重复"+duplicateOrderCodes);
}
@ -3044,7 +3044,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
// Set<String> orderCodes = importOrderNoPackageExcelDTOS.parallelStream().map(ImportOrderNoPackageExcelDTO::getOrderCode).collect(Collectors.toSet());
//把importOrderNoPackageExcelDTOS的每个元素提取成一个key为orderCode和trainNumber的拼接,value为元素本身的map
Map<String, ImportOrderNoPackageExcelDTO> importOrderNoPackageExcelDTOMap = importOrderNoPackageExcelDTOS.parallelStream().collect(Collectors.toMap(a -> a.getOrderCode() + "&" + a.getFirsts(), a -> a));
Map<String, ImportOrderNoPackageExcelDTO> importOrderNoPackageExcelDTOMap = importOrderNoPackageExcelDTOS.parallelStream().collect(Collectors.toMap(a -> a.getOrderCode() + "&" + a.getMaterialName(), a -> a));
importOrderNoPackageExcelDTOMap.remove("null&null");
@ -3092,6 +3092,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
advanceEntity.setBrand("其他");
}
advanceEntity.setTotalNum(Integer.parseInt(importOrderNoPackageExcelDTO.getCount()));
advanceEntity.setReserve1(importOrderNoPackageExcelDTO.getMaterialName());
advanceEntity.setPackName(importOrderNoPackageExcelDTO.getFirsts());
advanceEntity.setDealerCode(importOrderNoPackageExcelDTO.getDealerCode());
advanceEntity.setDealerName(importOrderNoPackageExcelDTO.getDealerName());
@ -3123,7 +3124,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
List<TrunklineAdvanceDetailEntity> advanceDetailEntities = new ArrayList<>();
for (TrunklineAdvanceEntity advanceEntity : list) {
String orderCode = advanceEntity.getOrderCode();
String packName = advanceEntity.getPackName();
String packName = advanceEntity.getReserve1();
ImportOrderNoPackageExcelDTO importOrderNoPackageExcelDTO = importOrderNoPackageExcelDTOMap.get(orderCode + "&" + (StringUtil.isBlank(packName) ? "null" : packName));
if(!Objects.isNull(importOrderNoPackageExcelDTO)){
String firsts = importOrderNoPackageExcelDTO.getFirsts();
@ -3205,14 +3206,18 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
//发送报表基础数据广播
//把advanceDetailEntities通过advanceId进行分组
Map<Long, List<TrunklineAdvanceDetailEntity>> advanceDetailEntityMap = advanceDetailEntities.stream().collect(Collectors.groupingBy(TrunklineAdvanceDetailEntity::getAdvanceId));
list.forEach(advanceEntity -> {
Long advanceId = advanceEntity.getId();
String dealerCode = advanceEntity.getDealerCode();
String dealerName = advanceEntity.getDealerName();
List<TrunklineAdvanceDetailEntity> advanceDetailEntities1 = advanceDetailEntityMap.get(advanceId);
advanceDetailService.sendReportBasicdataFanout(AuthUtil.getNickName(),AuthUtil.getUserId(),warehouseId,warehouseName,new Date(),advanceDetailEntities1,dealerCode,dealerName);
});
try{
Map<Long, List<TrunklineAdvanceDetailEntity>> advanceDetailEntityMap = advanceDetailEntities.stream().collect(Collectors.groupingBy(TrunklineAdvanceDetailEntity::getAdvanceId));
list.forEach(advanceEntity -> {
Long advanceId = advanceEntity.getId();
String dealerCode = advanceEntity.getDealerCode();
String dealerName = advanceEntity.getDealerName();
List<TrunklineAdvanceDetailEntity> advanceDetailEntities1 = advanceDetailEntityMap.get(advanceId);
advanceDetailService.sendReportBasicdataFanout(AuthUtil.getNickName(),AuthUtil.getUserId(),warehouseId,warehouseName,new Date(),advanceDetailEntities1,dealerCode,dealerName);
});
}catch (Exception e){
log.error("############importCustomizedOuPai:发送广播异常");
}
return R.success("添加成功");

84
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -1637,19 +1637,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
List<TrunklineCarsOrderEntity> carsOrderList = trunklineCarsOrderService.findListByLoadId(loadId);
List<TrunklineCarsOrderEntity> updateOrderList = new ArrayList<>();
carsOrderList.forEach(carsOrderEntity -> {
Long carsOrderId = carsOrderEntity.getId();
Long nodeId = carsOrderEntity.getNodeId();
String orderCode = carsOrderEntity.getOrderCode();
String waybillNo = carsOrderEntity.getWaybillNo();
Integer carsOrderRealLoadingNum = scanList.stream().filter(scan -> !Objects.isNull(scan.getWarehouseId()) && NumberUtil.equals(nodeId,scan.getWarehouseId()) && StringUtil.equals(orderCode,scan.getOrderCode()) && StringUtil.equals(waybillNo,scan.getWaybillNo())).mapToInt(TrunklineCarsLoadScanEntity::getNum).sum();
Integer carsOrderRealUnloadingNum = scanList.stream().filter(scan -> !Objects.isNull(scan.getScanStatus()) && !scan.getScanStatus().equals("1") && !Objects.isNull(scan.getUnloadNodeId()) && NumberUtil.equals(nodeId,scan.getUnloadNodeId()) && StringUtil.equals(orderCode,scan.getOrderCode()) && StringUtil.equals(waybillNo,scan.getWaybillNo())).mapToInt(TrunklineCarsLoadScanEntity::getUnloadNum).sum();
Integer carsOrderRealSignNum = scanList.stream().filter(scan -> !Objects.isNull(scan.getScanStatus()) && scan.getScanStatus().equals("3") && StringUtil.equals(orderCode,scan.getOrderCode()) && StringUtil.equals(waybillNo,scan.getWaybillNo())).mapToInt(TrunklineCarsLoadScanEntity::getUnloadNum).sum();
TrunklineCarsOrderEntity updateCarsOrderEntity = new TrunklineCarsOrderEntity();
updateCarsOrderEntity.setId(carsOrderId);
updateCarsOrderEntity.setRealNum(carsOrderRealLoadingNum);
updateCarsOrderEntity.setUnloadNum(carsOrderRealUnloadingNum);
updateCarsOrderEntity.setSignNum(carsOrderRealSignNum);
updateOrderList.add(updateCarsOrderEntity);
carsOrderEntity.setRealNum(carsOrderRealLoadingNum);
carsOrderEntity.setUnloadNum(carsOrderRealUnloadingNum);
carsOrderEntity.setSignNum(carsOrderRealSignNum);
updateOrderList.add(carsOrderEntity);
});
if(CollUtil.isNotEmpty(updateOrderList)){
@ -4529,69 +4526,41 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineCarsLoadVO.setCarsLoadLineList(loadLineList);
List<CarsLoadWaybillInfoVO> carsLoadWaybillInfoList = trunklineCarsOrderService.findWaybillOrderByloadId(loadId);
// 得到集合中的运单号集合
// List<String> waybillNoList = carsLoadWaybillInfoList.stream().map(CarsLoadWaybillInfoVO::getWaybillNo).collect(Collectors.toList());
// 查询运单号的总量、体积
// List<WaybillOrderTotalWeightAndVolumeVO> waybillOrderTotalList = warehouseWaybillDetailClient.findWaybillOrderTotalWeightAndVolumeByWaybillNoList(waybillNoList);
for (CarsLoadWaybillInfoVO carsLoadWaybillInfoVO : carsLoadWaybillInfoList) {
// 获取运单对应的总体积和总重量
// WaybillOrderTotalWeightAndVolumeVO waybillOrderTotalWeightAndVolumeVO = getWaybillOrderTotalWeighAndVolume(carsLoadWaybillInfoVO, waybillOrderTotalList);
String waybillNo = carsLoadWaybillInfoVO.getWaybillNo();
// 查询 明细上的总量和体积
List<WarehouseWayBillDetail> wayBillDetails = warehouseWaybillDetailClient.findListByWaybillNo(waybillNo);
String openPrice = null;
String productNames = null;
BigDecimal oneWeight = BigDecimal.ZERO;
BigDecimal oneVolume = BigDecimal.ZERO;
if(!StringUtil.isBlank(waybillNo)){
List<WarehouseWayBillDetail> wayBillDetails = warehouseWaybillDetailClient.findListByWaybillNo(waybillNo);
for (WarehouseWayBillDetail wayBillDetail : wayBillDetails) {
String productName = wayBillDetail.getProductName();
Integer num = wayBillDetail.getNum();
BigDecimal volume = wayBillDetail.getVolume();
BigDecimal weight = wayBillDetail.getWeight();
BigDecimal price = wayBillDetail.getPrice();
if (StringUtil.isBlank(openPrice)) {
openPrice = price.toPlainString();
} else {
openPrice = openPrice + "," + price.toPlainString();
}
if (StringUtil.isBlank(productNames)) {
productNames = productName + "(" + num + ")";
} else {
productNames = productNames + "," + productName + "(" + num + ")";
}
for (WarehouseWayBillDetail wayBillDetail : wayBillDetails) {
String productName = wayBillDetail.getProductName();
Integer num = wayBillDetail.getNum();
BigDecimal price = wayBillDetail.getPrice();
if (StringUtil.isBlank(openPrice)) {
openPrice = price.toPlainString();
} else {
openPrice = openPrice + "," + price.toPlainString();
}
if (StringUtil.isBlank(productNames)) {
productNames = productName + "(" + num + ")";
} else {
productNames = productNames + "," + productName + "(" + num + ")";
}
List<CarsLoadOrderInfoVO> carsLoadOrderInfoListPlan = trunklineCarsOrderService.findCarsLoadOrderInfoListPlan(loadId, waybillNo);
carsLoadOrderInfoListPlan.forEach(carsLoadOrderInfoVO -> {
carsLoadOrderInfoVO.setUnloadIncome(carsLoadOrderInfoVO.getUnloadIncome().setScale(2, BigDecimal.ROUND_HALF_UP));
carsLoadOrderInfoVO.setOrderFreight(carsLoadOrderInfoVO.getOrderFreight().setScale(2, BigDecimal.ROUND_HALF_UP));
});
carsLoadWaybillInfoVO.setCarsLoadOrderInfoList(carsLoadOrderInfoListPlan);
}
carsLoadWaybillInfoVO.setOpenPrice(openPrice);
carsLoadWaybillInfoVO.setGoodsName(productNames);
// List<CarsLoadOrderInfoVO> carsLoadOrderInfoList = trunklineCarsOrderService.findCarsLoadOrderInfoList(loadId, waybillNo);
if(!StringUtil.isBlank(waybillNo)){
}
List<CarsLoadOrderInfoVO> carsLoadOrderInfoListPlan = trunklineCarsOrderService.findCarsLoadOrderInfoListPlan(loadId, waybillNo);
carsLoadOrderInfoListPlan.forEach(carsLoadOrderInfoVO -> {
carsLoadOrderInfoVO.setUnloadIncome(carsLoadOrderInfoVO.getUnloadIncome().setScale(2, BigDecimal.ROUND_HALF_UP));
carsLoadOrderInfoVO.setOrderFreight(carsLoadOrderInfoVO.getOrderFreight().setScale(2, BigDecimal.ROUND_HALF_UP));
});
carsLoadWaybillInfoVO.setCarsLoadOrderInfoList(carsLoadOrderInfoListPlan);
// carsLoadWaybillInfoVO.setCarsLoadOrderInfoListPlan(carsLoadOrderInfoListPlan);
TrunklineCostShareRecordEntity costShareRecordEntity = trunklineCostShareRecordService.findTotalUnloadNumByLoadAndWaybillNo(loadId, waybillNo);
@ -4600,6 +4569,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadWaybillInfoVO.setCostNum(costShareRecordEntity.getNum());
}
//查询异常的数据
List<CarsLoadScanAbnormalVO> carsLoadScanAbnormalList = trunklineCarsLoadScanService.findAbnormalData(loadId);
if(!carsLoadScanAbnormalList.isEmpty()){

6
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml

@ -184,7 +184,8 @@
lww.cancle_check_time cancleCheckTime,
lww.waybill_status waybillStatus,
lww.waybill_type waybillType,
lww.document_making_time openTime,
lww.document_making_time documentMakingTime,
lww.create_time createTime,
GROUP_CONCAT(lwwd.product_name) goodsName,
lww.total_count totalCount,
sum(lwwd.weight) totalWeight,
@ -955,7 +956,8 @@
lww.cancle_check_time cancleCheckTime,
lww.waybill_status waybillStatus,
lww.waybill_type waybillType,
lww.document_making_time openTime,
lww.document_making_time documentMakingTime,
lww.create_time createTime,
GROUP_CONCAT(lwwd.product_name) goodsName,
lww.total_count totalCount,
sum(lwwd.weight) totalWeight,

Loading…
Cancel
Save