Browse Source

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

dist.1.3.0
zhaoqiaobo 10 months ago
parent
commit
e8815bf95c
  1. 4
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersaleSurveyRecordEntity.java
  2. 2
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesProcessorVO.java
  3. 3
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IWayBillClient.java
  4. 2
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/ChangesRecordDTO.java
  5. 3
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsChangesRecordEntity.java
  6. 3
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsDistributionPackageEntity.java
  7. 3
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java
  8. 3
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadScanEntity.java
  9. 21
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklinePackageTrackLogClient.java
  10. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/OpenOrderVO.java
  11. 4
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/SignOrderDetailVO.java
  12. 6
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/ExportWarehouseWaybillVO.java
  13. 10
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java
  14. 43
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderListExcelDTO.java
  15. 7
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.java
  16. 115
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  17. 5
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java
  18. 25
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java
  19. 6
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java
  20. 5
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/WayBillClient.java
  21. 2
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WayBillMapper.java
  22. 6
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WayBillMapper.xml
  23. 2
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IWayBillService.java
  24. 5
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/WayBillServiceImpl.java
  25. 6
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java
  26. 51
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/aspect/AsyncAnnotationAspect.java
  27. 48
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/aspect/RabbitAnnotationAspect.java
  28. 10
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java
  29. 28
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantStatisticsController.java
  30. 1
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/PackageFanoutListener.java
  31. 72
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillFanoutListener.java
  32. 2
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java
  33. 4
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml
  34. 2
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java
  35. 11
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java
  36. 34
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java
  37. 33
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklinePackageTrackLogClient.java
  38. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java
  39. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml
  40. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.java
  41. 44
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml
  42. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  43. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
  44. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml
  45. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderService.java
  46. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java
  47. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  48. 56
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java
  49. 34
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  50. 12
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java
  51. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java
  52. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java
  53. 17
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  54. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java
  55. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/config/InterceptorAdapterConfig.java
  56. 66
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/interceptor/ParameterCombinationInterceptor.java
  57. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTaryAllocationServiceImpl.java

4
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersaleSurveyRecordEntity.java

@ -127,5 +127,9 @@ public class AftersaleSurveyRecordEntity extends TenantEntity {
* 处理方ID
*/
private Long processorId;
/**
* 处理方名称
*/
private String processorName;
}

2
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesProcessorVO.java

@ -32,4 +32,6 @@ import lombok.EqualsAndHashCode;
public class AftersalesProcessorVO extends AftersalesProcessorEntity {
private static final long serialVersionUID = 1L;
}

3
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IWayBillClient.java

@ -51,4 +51,7 @@ public interface IWayBillClient {
@GetMapping(API_PREFIX + "/getByWayBillByOrderCode")
WayBillEntity getByWayBillByOrderCode(@RequestParam String orderCode);
@GetMapping(API_PREFIX + "/findAreaCodeByArriveSiteId")
String findAreaCodeByArriveSiteId(@RequestParam Integer arriveSiteId);
}

2
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/ChangesRecordDTO.java

@ -35,6 +35,8 @@ public class ChangesRecordDTO implements Serializable {
private BigDecimal returnFee = BigDecimal.ZERO;//回扣
private BigDecimal thirdOprationFee = BigDecimal.ZERO;//三方操作费
private String changesTimeStr;
private Long statisticsWarehouseId;
private String statisticsWarehouseName;

3
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsChangesRecordEntity.java

@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.math.BigDecimal;
import java.util.Date;
@Data
@TableName("logpm_statistics_changes_record")
@ -67,6 +68,8 @@ public class StatisticsChangesRecordEntity extends TenantEntity {
private BigDecimal returnFee;//回扣
private BigDecimal thirdOprationFee;//三方操作费
private Date changesTime;//异动时间
private Long statisticsWarehouseId;
private String statisticsWarehouseName;

3
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsDistributionPackageEntity.java

@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.math.BigDecimal;
import java.util.Date;
@Data
@TableName("logpm_statistics_distribution_package")
@ -128,5 +129,5 @@ public class StatisticsDistributionPackageEntity extends TenantEntity {
private Long orderInfoId;
private Integer isSign;//是否签收 0否 1是
private Date signTime; //签收时间
}

3
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java

@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.math.BigDecimal;
import java.util.Date;
@Data
@TableName("logpm_trunkline_advance_detail")
@ -198,5 +199,7 @@ public class TrunklineAdvanceDetailEntity extends TenantEntity {
private String carNumber;
@ApiModelProperty(name = "货主")
private String goodsMan;
@ApiModelProperty(name = "入库时间")
private Date incomingTime;
}

3
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadScanEntity.java

@ -109,6 +109,9 @@ public class TrunklineCarsLoadScanEntity extends TenantEntity {
@ApiModelProperty(name = "是否补录 0否 1是",notes = "")
private Integer isSupple ;
@ApiModelProperty(name = "签收人名称",notes = "")
private String signUserName;
/** 签收时间 */
@ApiModelProperty(name = "签收时间",notes = "")
private Date signTime;

21
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklinePackageTrackLogClient.java

@ -0,0 +1,21 @@
package com.logpm.trunkline.feign;
import com.alibaba.fastjson.JSONObject;
import org.springblade.common.constant.ModuleNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(
value = ModuleNameConstant.APPLICATION_TRUNKLINE_NAME
)
public interface ITrunklinePackageTrackLogClient {
String API_PREFIX = "trunklinePackageTrackLog/client";
@PostMapping(API_PREFIX+"/addBatchPackageTrackLog")
void addPackageTrackLog(@RequestParam List<JSONObject> addPackageTrackLogList, List<String> orderPackageCodes, Integer workNode);
}

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

@ -55,6 +55,7 @@ public class OpenOrderVO implements Serializable {
private List<DictBiz> transportTypeList;//运输方式
private String defaultPayWay;
private String defaultDeliveryWay;//默认送货方式
private String openOrderDate;//开单时间
private String openOrderUserName;//开单人

4
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/SignOrderDetailVO.java

@ -3,6 +3,7 @@ package com.logpm.trunkline.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class SignOrderDetailVO implements Serializable {
@ -21,6 +22,9 @@ public class SignOrderDetailVO implements Serializable {
private Integer type;
private Integer num;
private Integer unloadNum;
private String signUserName;
private Date signTime;
private Date unloadTime;
private String remark;
private Long signOrderId;

6
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/ExportWarehouseWaybillVO.java

@ -1,5 +1,6 @@
package com.logpm.warehouse.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
@ -149,10 +150,12 @@ public class ExportWarehouseWaybillVO implements Serializable {
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date documentMakingTime;
@ExcelIgnore
private Integer pickupCompleteOrNot;
@ExcelProperty(value = "提货是否整车")
private String pickupCompleteOrNotStr;
@ExcelIgnore
private Integer trunklineCompleteOrNot;
@ExcelProperty(value = "干线是否整车")
private String trunklineCompleteOrNotStr;
@ -161,6 +164,7 @@ public class ExportWarehouseWaybillVO implements Serializable {
private String waybillStatus;
@ExcelIgnore
private Integer freezeStatus;
@ExcelProperty(value = "是否冻结")
private String freezeStatusStr;
@ -172,7 +176,7 @@ public class ExportWarehouseWaybillVO implements Serializable {
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date freezeTime;
@ExcelIgnore
private Integer abolishStatus;
@ExcelProperty(value = "是否作废")
private String abolishStatusStr;

10
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java

@ -19,6 +19,7 @@ package com.logpm.aftersales.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.logpm.aftersales.dto.AftersalesWorkOrderDTO;
import com.logpm.aftersales.dto.AftersalesWorkOrderListExcelDTO;
import com.logpm.aftersales.entity.AftersaleSurveyRecordEntity;
import com.logpm.aftersales.entity.AftersalesAppealEntity;
import com.logpm.aftersales.entity.AftersalesSettlementEntity;
@ -719,6 +720,15 @@ public class AftersalesWorkOrderController extends BladeController {
ExcelUtil.export(response, "异常工单数据" + DateUtil.time(), "异常工单数据", list, AftersalesWorkOrderExcel.class);
}
@GetMapping("/exportAftersalesWorkOrderList")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "导出数据", notes = "传入aftersalesWorkOrder")
public void exportAftersalesWorkOrderList(HttpServletResponse response) {
AftersalesWorkOrderListExcelDTO aftersalesWorkOrderListExcelDTO = aftersalesWorkOrderService.exportAftersalesWorkOrderList();
// ExcelUtil.export(response, "异常工单数据" + DateUtil.time(), "异常工单数据", list, AftersalesWorkOrderExcel.class);
}
/**
* 导入 批量修改 钉钉流程号审核人审核日期财务理赔入账日期操作人
*/

43
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderListExcelDTO.java

@ -0,0 +1,43 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.aftersales.dto;
import com.logpm.aftersales.entity.*;
import com.logpm.aftersales.excel.AftersalesWorkOrderExcel;
import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.List;
/**
* 客服异常工单 数据传输对象实体类
*
* @author BladeX
* @since 2023-11-17
*/
@Data
public class AftersalesWorkOrderListExcelDTO implements Serializable {
private static final long serialVersionUID = 1L;
private List<AftersalesWorkOrderExcel> aftersalesWorkOrderExcels;
}

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

@ -101,4 +101,11 @@ public interface AftersalesWorkOrderMapper extends BaseMapper<AftersalesWorkOrde
@Param("workOrderType")int workOrderType, @Param("discoveryNode")int discoveryNode);
IPage<AftersalesSettlementEntity> getListSettlementNew(IPage<Object> page,@Param("param") AftersalesSettlementEntity aftersalesSettlementEntity);
List<AftersalesWorkOrderExcel> selectAllAftersalesWorkOrderList(@Param("warehouseIds")List<Long> warehouseListIds);
List<AftersalesWorkOrderExcel> selectWaitAftersalesWorkOrderList(@Param("warehouseIds")List<Long> warehouseListIds);
}

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

@ -52,6 +52,9 @@
</resultMap>
<!--查询完整的异常工单信息-->
<select id="pageListOwn" resultType="com.logpm.aftersales.entity.AftersalesWorkOrderEntity">
SELECT DISTINCT
lawo.id,
lawo.work_order_type,
@ -492,6 +495,118 @@
</where>
</select>
<select id="selectAllAftersalesWorkOrderList"
resultType="com.logpm.aftersales.excel.AftersalesWorkOrderExcel">
SELECT DISTINCT
lawo.id,
lawo.work_order_type,
lawo.discovery_node,
lawo.work_order_number,
lawo.order_code,
lawo.train_number,
GROUP_CONCAT(DISTINCT laap.waybill_number separator ',') as waybillNumber,
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,
lawo.vehicle_route,
lawo.deliver_goods_time,
lawo.discovery_time,
lawo.warehousing_time,
lawo.waybill_mall,
lawo.remarks,
lawo.delivery_time,
lawo.delivery_driver,
lawo.work_order_status,
lawo.problem_description,
lawo.responsible_person,
lawo.processed_by,
lawo.create_time,
lawo.over_time,
lawo.reviewed_by,
lawo.audit_time,
lawo.entry_time,
lawo.operator,
lawo.person_responsible,
lawo.process_number,
lawo.customer_service_name customerServiceName,
lawo.warehouse_id warehouseId,
lawo.customer_service_id customerServiceId
FROM
logpm_aftersales_work_order lawo
LEFT JOIN logpm_aftersales_processor lap ON lawo.id = lap.work_order_id
AND lap.types_of = '2'
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
<where>
<if test="warehouseIds != null">
lawo.warehouse_id in
<foreach collection="warehouseIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
group by lawo.id
ORDER BY lawo.create_time DESC
</select>
<select id="selectWaitAftersalesWorkOrderList"
resultType="com.logpm.aftersales.excel.AftersalesWorkOrderExcel">
SELECT DISTINCT
law.id,
law.work_order_type,
law.initiation_identification,
law.discovery_node,
law.work_order_number,
law.waybill_number,
law.order_code,
law.train_number,
GROUP_CONCAT(DISTINCT laap.waybill_number separator ',') as waybillNumber,
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,
law.FIRST,
law.secondary,
law.vehicle_route,
law.deliver_goods_time,
law.discovery_time,
law.warehousing_time,
law.waybill_mall,
law.remarks,
law.delivery_time,
law.delivery_driver,
law.work_order_status,
law.customer_service_id,
law.customer_service_name,
law.waybill_mall_id,
law.over_time,
law.problem_description,
law.warehouse_id,
law.person_responsible,
law.process_number,
law.reviewed_by,
law.audit_time,
law.entry_time,
law.operator,
law.brand_name
FROM
logpm_aftersales_processor lap
LEFT JOIN logpm_aftersales_work_order law ON lap.work_order_id = law.id
LEFT JOIN logpm_aftersales_completion_record lacr ON lacr.work_order_id = law.id
AND lacr.is_deleted = '0'
left join logpm_aftersales_abnormal_package laap on law.id = laap.work_order_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'
<if test="warehouseIds != null">
AND law.warehouse_id in
<foreach collection="warehouseIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
group by lawo.id
ORDER BY lawo.create_time DESC
</select>
<update id="updateFinanceTime">

5
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java

@ -18,6 +18,7 @@ package com.logpm.aftersales.service;
import com.logpm.aftersales.dto.AftersalesPackageScanDTO;
import com.logpm.aftersales.dto.AftersalesWorkOrderDTO;
import com.logpm.aftersales.dto.AftersalesWorkOrderListExcelDTO;
import com.logpm.aftersales.entity.AftersalesAppealEntity;
import com.logpm.aftersales.entity.AftersalesSettlementEntity;
import com.logpm.aftersales.entity.AftersalesWorkOrderEntity;
@ -295,4 +296,8 @@ public interface IAftersalesWorkOrderService extends BaseService<AftersalesWorkO
* @param packageFinish
*/
void updateWorkOrderPackagFinish(Long warehouseId, String orderPackageCode, Integer packageFinish);
AftersalesWorkOrderListExcelDTO exportAftersalesWorkOrderList();
}

25
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

@ -56,6 +56,7 @@ import org.springblade.system.cache.DictBizCache;
import org.springblade.system.entity.DictBiz;
import org.springblade.system.entity.User;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.feign.IUserClient;
import org.springblade.system.feign.IUserSearchClient;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -101,6 +102,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
private final AftersalesAppealMapper aftersalesAppealService;
private final ISysClient sysClient;
private final IUserClient userClient;
private final AftersalesCustomerMallMapper aftersalesCustomerMallMapper;
private final IUserSearchClient userSearchClient;
@ -588,6 +590,8 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
String collect = deptNames.getData().stream().collect(Collectors.joining(","));
surveyRecordDTO.setAddDepartment(collect);
}
surveyRecordDTO.setProcessorId(user.getUserId());
surveyRecordDTO.setProcessorName(user.getNickName());
return surveyRecordDTO;
}
@ -1541,12 +1545,13 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
surveyRecordEntity.setProcessingResults(surveyRecordEntity.getContent());
} else {
log.info("客服回复!!!{}", user.getUserName());
surveyRecordEntity.setProcessorId(user.getUserId());
R<String> deptName = sysClient.getDeptName(Long.valueOf(user.getDeptId()));
surveyRecordEntity.setAddDepartment(deptName.getData());
surveyRecordEntity.setProcessingResults(surveyRecordEntity.getContent());
}
//添加回复信息
surveyRecordEntity.setProcessorId(user.getUserId());
surveyRecordEntity.setProcessorName(user.getNickName());
surveyRecordEntity.setDifference("1");
surveyRecordEntity.setTypesOf("1");
surveyRecordEntity.setAddPeople(user.getUserName());
@ -2324,5 +2329,23 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
}
@Override
public AftersalesWorkOrderListExcelDTO exportAftersalesWorkOrderList() {
List<BasicdataWarehouseEntity> warehouseList = warehouseClient.getMyWarehouseList();
List<Long> warehouseListIds = null;
if (!warehouseList.isEmpty()){
warehouseListIds = warehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
}
AftersalesWorkOrderListExcelDTO aftersalesWorkOrderListExcelDTO = new AftersalesWorkOrderListExcelDTO();
List<AftersalesWorkOrderExcel> allAftersalesWorkOrderExcels = baseMapper.selectAllAftersalesWorkOrderList(warehouseListIds);
if (!allAftersalesWorkOrderExcels.isEmpty()) {
aftersalesWorkOrderListExcelDTO.setAftersalesWorkOrderExcels(allAftersalesWorkOrderExcels);
}
List<AftersalesWorkOrderExcel> waitAftersalesWorkOrderExcels = baseMapper.selectWaitAftersalesWorkOrderList(warehouseListIds);
return null;
}
}

6
blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java

@ -948,8 +948,10 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
warehouseWaybill.setConsigneeName(wayBillEntity.getTakePerson());
warehouseWaybill.setConsigneeMobile(wayBillEntity.getTakeMobile());
warehouseWaybill.setConsigneeAddress(wayBillEntity.getTakeAddress());
String arriveSite = wayBillEntity.getArriveSite();
String code = regionFeign.getCode(arriveSite);
// String arriveSite = wayBillEntity.getArriveSite();
Integer arriveSiteId = wayBillEntity.getArriveSiteId();
String code = wayBillClient.findAreaCodeByArriveSiteId(arriveSiteId);
// String code = regionFeign.getCode(arriveSite);
warehouseWaybill.setDestinationCode(code);
warehouseWaybill.setDestination(wayBillEntity.getArriveSite());
warehouseWaybill.setGoodsName(packname);

5
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/WayBillClient.java

@ -66,4 +66,9 @@ public class WayBillClient implements IWayBillClient {
public WayBillEntity getByWayBillByOrderCode(String orderCode) {
return wayBillService.getByWayBillByOrderCode(orderCode);
}
@Override
public String findAreaCodeByArriveSiteId(Integer arriveSiteId) {
return wayBillService.findAreaCodeByArriveSiteId(arriveSiteId);
}
}

2
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WayBillMapper.java

@ -14,4 +14,6 @@ public interface WayBillMapper extends BaseMapper<WayBillEntity> {
List<Integer> findAdvanceIdsByWaybillNo(@Param("waybillNo") String waybillNo);
WayBillEntity getByWayBillByOrderCode(@Param("orderCode") String orderCode);
String findAreaCodeByArriveSiteId(@Param("arriveSiteId") Integer arriveSiteId);
}

6
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WayBillMapper.xml

@ -27,4 +27,10 @@ select ht_way_bill.* FROM ht_way_bill LEFT JOIN ht_advance on ht_advance.waybi
limit 1
</select>
<select id="findAreaCodeByArriveSiteId" resultType="String">
select LEFT(area_code,6)
from ht_city
where id = #{arriveSiteId}
</select>
</mapper>

2
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IWayBillService.java

@ -20,4 +20,6 @@ public interface IWayBillService {
List<Integer> findAdvanceIdsByWaybillNo(String waybillNo);
WayBillEntity getByWayBillByOrderCode(String orderCode);
String findAreaCodeByArriveSiteId(Integer arriveSiteId);
}

5
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/WayBillServiceImpl.java

@ -47,4 +47,9 @@ public class WayBillServiceImpl implements IWayBillService {
public WayBillEntity getByWayBillByOrderCode(String orderCode) {
return wayBillMapper.getByWayBillByOrderCode(orderCode);
}
@Override
public String findAreaCodeByArriveSiteId(Integer arriveSiteId) {
return wayBillMapper.findAreaCodeByArriveSiteId(arriveSiteId);
}
}

6
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java

@ -1070,8 +1070,10 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
warehouseWaybill.setConsigneeName(wayBillEntity.getTakePerson());
warehouseWaybill.setConsigneeMobile(wayBillEntity.getTakeMobile());
warehouseWaybill.setConsigneeAddress(wayBillEntity.getTakeAddress());
String arriveSite = wayBillEntity.getArriveSite();
String code = regionFeign.getCode(arriveSite);
// String arriveSite = wayBillEntity.getArriveSite();
Integer arriveSiteId = wayBillEntity.getArriveSiteId();
String code = wayBillClient.findAreaCodeByArriveSiteId(arriveSiteId);
// String code = regionFeign.getCode(arriveSite);
warehouseWaybill.setDestinationCode(code);
warehouseWaybill.setDestination(wayBillEntity.getArriveSite());
warehouseWaybill.setGoodsName(packname);

51
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/aspect/AsyncAnnotationAspect.java

@ -0,0 +1,51 @@
package com.logpm.statistics.aspect;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.springblade.common.annotations.LogpmAsync;
import org.springblade.core.secure.utils.AuthUtil;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import java.lang.reflect.Method;
@Aspect
@Component
@Slf4j
@Order(-1)
public class AsyncAnnotationAspect {
/**
* 定义一个切点匹配所有带有@LogpmAsync("asyncExecutor")注解的方法
* 注意实际上Spring Framework自带对@LogpmAsync("asyncExecutor")的处理直接这样配置可能会导致预期之外的行为
*/
@Around("@annotation(org.springblade.common.annotations.LogpmAsync)")
public Object logAroundAsyncMethods(ProceedingJoinPoint joinPoint) throws Throwable {
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
Method method = signature.getMethod();
LogpmAsync myAsync = method.getAnnotation(LogpmAsync.class);
String annotationValue = myAsync.value();
log.info(">>>>>>>>>>>>>>>>>> annotationValue={}",annotationValue);
log.info("@LogpmAsync注解的值为asyncExecutor,进行数据源切换 ");
// 在方法执行前的操作
String tenantId = AuthUtil.getTenantId();
log.info(">> tenandId {} ",tenantId);
DynamicDataSourceContextHolder.push(tenantId);
// 执行原方法
Object result = joinPoint.proceed();
// 在方法执行后的操作
DynamicDataSourceContextHolder.poll();
return result;
}
}

48
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/aspect/RabbitAnnotationAspect.java

@ -0,0 +1,48 @@
package com.logpm.statistics.aspect;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springblade.core.secure.utils.AuthUtil;
import org.springframework.stereotype.Component;
@Aspect
@Component
@Slf4j
public class RabbitAnnotationAspect {
/**
* 该方法为一个切面用于对标记了@RabbitListener注解的方法进行增强主要增加了日志记录和数据源上下文处理的功能
*
* @param joinPoint 切面的连接点表示当前被拦截的方法
* @return 返回被拦截方法的执行结果
* @throws Throwable 如果执行过程中发生异常则抛出
*/
@Around("@annotation(org.springframework.amqp.rabbit.annotation.RabbitListener)")
public Object rabbitMethods(ProceedingJoinPoint joinPoint) throws Throwable {
// 在方法执行前,获取当前租户ID并设置到数据源上下文中
String tenantId = AuthUtil.getTenantId();
DynamicDataSourceContextHolder.push(tenantId);
// 执行原方法
Object result = joinPoint.proceed();
// 在方法执行后,从数据源上下文中移除租户ID
DynamicDataSourceContextHolder.poll();
return result;
}
@Around("@annotation(org.springframework.amqp.rabbit.annotation.RabbitHandler)")
public Object rabbitHandlerMethods(ProceedingJoinPoint joinPoint) throws Throwable {
// 在方法执行前,获取当前租户ID并设置到数据源上下文中
String tenantId = AuthUtil.getTenantId();
DynamicDataSourceContextHolder.push(tenantId);
// 执行原方法
Object result = joinPoint.proceed();
// 在方法执行后,从数据源上下文中移除租户ID
DynamicDataSourceContextHolder.poll();
return result;
}
}

10
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java

@ -35,11 +35,11 @@ public class MerchantBalanceController {
log.info(method+"请求参数{}",merchantStatisticsDTO);
try{
Integer listType = merchantStatisticsDTO.getListType();
if(Objects.isNull(listType)){
log.warn(method+"请选择正确的列表类型 listType={}",listType);
return R.fail(405,"请选择正确的列表类型");
}
// Integer listType = merchantStatisticsDTO.getListType();
// if(Objects.isNull(listType)){
// log.warn(method+"请选择正确的列表类型 listType={}",listType);
// return R.fail(405,"请选择正确的列表类型");
// }
IPage<StatisticsBalanceOrderInfoVO> pages = balanceOrderInfoService.pageList(merchantStatisticsDTO);

28
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantStatisticsController.java

@ -54,6 +54,34 @@ public class MerchantStatisticsController {
}
}
@ResponseBody
@PostMapping("/findOrderDetail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询订单详情", notes = "传入merchantStatisticsDTO")
public R findOrderDetail(@RequestBody MerchantStatisticsDTO merchantStatisticsDTO) {
String method = "############findOrderDetail: ";
log.info(method+"请求参数{}",merchantStatisticsDTO);
try{
Long orderInfoId = merchantStatisticsDTO.getOrderInfoId();
if(Objects.isNull(orderInfoId)){
log.warn(method+"请选择正确的订单 orderInfoId={}",orderInfoId);
return R.fail(405,"请选择正确的订单");
}
StatisticsOrderInfoVO statisticsOrderInfoVO = statisticsOrderInfoService.findOrderDetail(orderInfoId);
return R.data(statisticsOrderInfoVO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
@ResponseBody
@PostMapping("/findChangesRecordList")
@ApiOperationSupport(order = 1)

1
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/PackageFanoutListener.java

@ -52,6 +52,7 @@ public class PackageFanoutListener {
Set<Long> orderInfoSet = new HashSet<>();
statisticsDistributionList.forEach(statisticsDistributionPackageEntity -> {
statisticsDistributionPackageEntity.setIsSign(1);
statisticsDistributionPackageEntity.setSignTime(new Date());
String typeService = statisticsDistributionPackageEntity.getTypeService();
if("3".equals(typeService)){
statisticsDistributionPackageEntity.setRealDeliveryFee(BigDecimal.ZERO);

72
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillFanoutListener.java

@ -19,9 +19,11 @@ import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
@Slf4j
@ -48,6 +50,7 @@ public class WaybillFanoutListener {
Long waybillId = jsonObject.getLong("waybillId");
String waybillNo = jsonObject.getStr("waybillNo");
String typeService = jsonObject.getStr("typeService");//服务类型
Integer waybillType = jsonObject.getInt("waybillType");
List<StatisticsTrunklinePackageEntity> statisticsTrunklinePackageEntities = new ArrayList<>();
List<StatisticsWarehousePackageEntity> statisticsWarehousePackageEntities = new ArrayList<>();
@ -56,6 +59,14 @@ public class WaybillFanoutListener {
JSONArray orderPackageCodes = jsonObject.getJSONArray("orderPackageCodes");
for (int i = 0; i < orderPackageCodes.size(); i++) {
JSONObject json = orderPackageCodes.getJSONObject(i);
BigDecimal totalWeight = json.getBigDecimal("totalWeight");
if(Objects.isNull(totalWeight)){
totalWeight = BigDecimal.ZERO;
}
BigDecimal totalVolume = json.getBigDecimal("totalVolume");
if(Objects.isNull(totalVolume)){
totalVolume = BigDecimal.ZERO;
}
//干线
StatisticsTrunklinePackageEntity statisticsTrunklinePackageEntity = new StatisticsTrunklinePackageEntity();
@ -64,7 +75,6 @@ public class WaybillFanoutListener {
statisticsTrunklinePackageEntity.setTypeService(typeService);
statisticsTrunklinePackageEntity.setWaybillId(waybillId);
statisticsTrunklinePackageEntity.setWaybillNo(waybillNo);
Integer waybillType = json.getInt("waybillType");
if(waybillType.equals(1)){
statisticsTrunklinePackageEntity.setGoodsType(1);
}else if (waybillType.equals(2)){
@ -76,8 +86,8 @@ public class WaybillFanoutListener {
statisticsTrunklinePackageEntity.setOrderPackageCode(json.getStr("orderPackageCode"));
statisticsTrunklinePackageEntity.setProductName(json.getStr("productName"));
statisticsTrunklinePackageEntity.setTotalNum(json.getInt("totalNum"));
statisticsTrunklinePackageEntity.setTotalWeight(json.getBigDecimal("totalWeight"));
statisticsTrunklinePackageEntity.setTotalVolume(json.getBigDecimal("totalVolume"));
statisticsTrunklinePackageEntity.setTotalWeight(totalWeight);
statisticsTrunklinePackageEntity.setTotalVolume(totalVolume);
statisticsTrunklinePackageEntity.setOpenPrice(json.getBigDecimal("openPrice"));
statisticsTrunklinePackageEntity.setTotalPrice(json.getBigDecimal("openPrice"));
statisticsTrunklinePackageEntity.setPickupFee(json.getBigDecimal("pickupFee"));
@ -124,8 +134,10 @@ public class WaybillFanoutListener {
statisticsWarehousePackageEntity.setOrderPackageCode(json.getStr("orderPackageCode"));
statisticsWarehousePackageEntity.setProductName(json.getStr("productName"));
statisticsWarehousePackageEntity.setTotalNum(json.getInt("totalNum"));
statisticsWarehousePackageEntity.setTotalWeight(json.getBigDecimal("totalWeight"));
statisticsWarehousePackageEntity.setTotalVolume(json.getBigDecimal("totalVolume"));
statisticsWarehousePackageEntity.setTotalWeight(totalWeight);
statisticsWarehousePackageEntity.setTotalVolume(totalVolume);
statisticsWarehousePackageEntity.setOpenPrice(json.getBigDecimal("warehouseServiceFee"));
statisticsWarehousePackageEntity.setTotalPrice(json.getBigDecimal("warehouseServiceFee"));
statisticsWarehousePackageEntity.setWarehouseServiceFee(json.getBigDecimal("warehouseServiceFee"));
statisticsWarehousePackageEntity.setRealWarehouseServiceFee(json.getBigDecimal("warehouseServiceFee"));
statisticsWarehousePackageEntity.setWarehouseFee(json.getBigDecimal("warehouseFee"));
@ -157,8 +169,10 @@ public class WaybillFanoutListener {
statisticsDistributionPackageEntity.setOrderPackageCode(json.getStr("orderPackageCode"));
statisticsDistributionPackageEntity.setProductName(json.getStr("productName"));
statisticsDistributionPackageEntity.setTotalNum(json.getInt("totalNum"));
statisticsDistributionPackageEntity.setTotalWeight(json.getBigDecimal("totalWeight"));
statisticsDistributionPackageEntity.setTotalVolume(json.getBigDecimal("totalVolume"));
statisticsDistributionPackageEntity.setTotalWeight(totalWeight);
statisticsDistributionPackageEntity.setTotalVolume(totalVolume);
statisticsDistributionPackageEntity.setOpenPrice(json.getBigDecimal("deliveryServiceFee"));
statisticsDistributionPackageEntity.setTotalPrice(json.getBigDecimal("deliveryServiceFee"));
statisticsDistributionPackageEntity.setDeliveryServiceFee(json.getBigDecimal("deliveryServiceFee"));
statisticsDistributionPackageEntity.setRealDeliveryServiceFee(json.getBigDecimal("deliveryServiceFee"));
statisticsDistributionPackageEntity.setDeliveryFee(json.getBigDecimal("deliveryFee"));
@ -204,6 +218,9 @@ public class WaybillFanoutListener {
statisticsOrderInfoEntity.setWaybillNo(waybillNo);
statisticsOrderInfoEntity.setOrderCode(key);
statisticsOrderInfoEntity.setTypeService(typeService);
statisticsOrderInfoEntity.setSignStatus(0);
statisticsOrderInfoEntity.setConfirmStatisticsOrder(0);
statisticsOrderInfoEntity.setChangesFee(BigDecimal.ZERO);
orderInfoEntities.add(statisticsOrderInfoEntity);
});
@ -220,33 +237,46 @@ public class WaybillFanoutListener {
statisticsTrunklinePackageEntity.setOrderInfoId(orderInfoId);
});
statisticsTrunklinePackageSaveList.addAll(statisticsTrunklinePackageEntityList);
});
statisticsTrunklinePackageService.saveBatch(statisticsTrunklinePackageSaveList);
orderInfoEntities.forEach(statisticsOrderInfoEntity -> {
String orderCode = statisticsOrderInfoEntity.getOrderCode();
Long orderInfoId = statisticsOrderInfoEntity.getId();
List<StatisticsWarehousePackageEntity> statisticsWarehousePackageEntityList= warehouseMap.get(orderCode);
statisticsWarehousePackageEntityList.forEach(statisticsWarehousePackageEntity -> {
statisticsWarehousePackageEntity.setOrderInfoId(orderInfoId);
});
statisticsWarehousePackageSaveList.addAll(statisticsWarehousePackageEntityList);
});
statisticsWarehousePackageService.saveBatch(statisticsWarehousePackageSaveList);
orderInfoEntities.forEach(statisticsOrderInfoEntity -> {
String orderCode = statisticsOrderInfoEntity.getOrderCode();
Long orderInfoId = statisticsOrderInfoEntity.getId();
List<StatisticsDistributionPackageEntity> statisticsDistributionPackageEntityList= distributionMap.get(orderCode);
statisticsDistributionPackageEntityList.forEach(statisticsDistributionPackageEntity -> {
statisticsDistributionPackageEntity.setOrderInfoId(orderInfoId);
});
statisticsDistributionPackageSaveList.addAll(statisticsDistributionPackageEntityList);
});
});
statisticsTrunklinePackageService.saveBatch(statisticsTrunklinePackageSaveList);
statisticsWarehousePackageService.saveBatch(statisticsWarehousePackageSaveList);
statisticsDistributionPackageService.saveBatch(statisticsDistributionPackageSaveList);
// orderInfoEntities.forEach(statisticsOrderInfoEntity -> {
// String orderCode = statisticsOrderInfoEntity.getOrderCode();
// Long orderInfoId = statisticsOrderInfoEntity.getId();
// List<StatisticsWarehousePackageEntity> statisticsWarehousePackageEntityList= warehouseMap.get(orderCode);
// statisticsWarehousePackageEntityList.forEach(statisticsWarehousePackageEntity -> {
// statisticsWarehousePackageEntity.setOrderInfoId(orderInfoId);
// });
// statisticsWarehousePackageSaveList.addAll(statisticsWarehousePackageEntityList);
// });
//
// statisticsWarehousePackageService.saveBatch(statisticsWarehousePackageSaveList);
//
// orderInfoEntities.forEach(statisticsOrderInfoEntity -> {
// String orderCode = statisticsOrderInfoEntity.getOrderCode();
// Long orderInfoId = statisticsOrderInfoEntity.getId();
// List<StatisticsDistributionPackageEntity> statisticsDistributionPackageEntityList= distributionMap.get(orderCode);
// statisticsDistributionPackageEntityList.forEach(statisticsDistributionPackageEntity -> {
// statisticsDistributionPackageEntity.setOrderInfoId(orderInfoId);
// });
// statisticsDistributionPackageSaveList.addAll(statisticsDistributionPackageEntityList);
// });
//
// statisticsDistributionPackageService.saveBatch(statisticsDistributionPackageSaveList);
log.info("处理完成:{}", msg);
}

2
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.java

@ -16,4 +16,6 @@ public interface StatisticsOrderInfoMapper extends BaseMapper<StatisticsOrderInf
IPage<StatisticsOrderInfoVO> pageList(IPage<Object> page, @Param("param") MerchantStatisticsDTO merchantStatisticsDTO);
List<StatisticsOrderInfoVO> findStatementListByOrderInfoIds(@Param("orderInfoIds") List<Long> orderInfoIds);
StatisticsOrderInfoVO findOrderDetail(@Param("orderInfoId") Long orderInfoId);
}

4
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml

@ -104,7 +104,7 @@
left join (select ltwr.waybill_id from logpm_trunkline_waybill_return ltwr group by ltwr.waybill_id) twr on twr.waybill_id = lww.id
left join logpm_statistics_trunkline_package lstp on lstp.order_info_id = lsoi.id
left join logpm_statistics_warehouse_package lswp on lswp.order_info_id = lstp.order_info_id and lswp.order_package_code = lstp.order_package_code
left join logpm_statistics_distribution_package lsdp on lsdp.order_info_id = lswp.order_info_id = lsdp.order_package_code = lswp.order_package_code
left join logpm_statistics_distribution_package lsdp on lsdp.order_info_id = lswp.order_info_id and lsdp.order_package_code = lswp.order_package_code
left join logpm_statistics_changes_record lscr on lscr.order_info_id = lsoi.id
where 1=1
<if test="param.listType == 1">
@ -224,7 +224,7 @@
left join (select ltwr.waybill_id from logpm_trunkline_waybill_return ltwr group by ltwr.waybill_id) twr on twr.waybill_id = lww.id
left join logpm_statistics_trunkline_package lstp on lstp.order_info_id = lsoi.id
left join logpm_statistics_warehouse_package lswp on lswp.order_info_id = lstp.order_info_id and lswp.order_package_code = lstp.order_package_code
left join logpm_statistics_distribution_package lsdp on lsdp.order_info_id = lswp.order_info_id = lsdp.order_package_code = lswp.order_package_code
left join logpm_statistics_distribution_package lsdp on lsdp.order_info_id = lswp.order_info_id and lsdp.order_package_code = lswp.order_package_code
left join logpm_statistics_changes_record lscr on lscr.order_info_id = lsoi.id
where 1=1
and lsoi.id in

2
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsOrderInfoService.java

@ -24,4 +24,6 @@ public interface IStatisticsOrderInfoService extends BaseService<StatisticsOrder
R addChangesRecord(ChangesRecordDTO changesRecordDTO);
R checkBalance(MerchantStatisticsDTO merchantStatisticsDTO);
StatisticsOrderInfoVO findOrderDetail(Long orderInfoId);
}

11
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java

@ -22,6 +22,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.CodeNumConstant;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
@ -110,7 +111,7 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOr
String itemRecord = verifyValue(changesRecordEntity);
changesRecordEntity.setItemRecord(itemRecord);
changesRecordEntity.setChangesTime(CommonUtil.StringToDate(changesRecordDTO.getChangesTimeStr()));
changesRecordService.save(changesRecordEntity);
List<String> changesPhotoUrls = changesRecordDTO.getChangesPhotoUrls();
@ -371,6 +372,14 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOr
return R.success("确认成功");
}
@Override
public StatisticsOrderInfoVO findOrderDetail(Long orderInfoId) {
List<Long> orderInfoIds = new ArrayList<>();
orderInfoIds.add(orderInfoId);
List<StatisticsOrderInfoVO> statementListByOrderInfoIds = baseMapper.findStatementListByOrderInfoIds(orderInfoIds);
return statementListByOrderInfoIds.get(0);
}
private void updateOrderChangesFee(Long orderInfoId) {
StatisticsOrderInfoEntity statisticsOrderInfoEntity = baseMapper.selectById(orderInfoId);

34
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java

@ -9,7 +9,6 @@ import com.logpm.trunkline.dto.AdvanceDTO;
import com.logpm.trunkline.dto.OpenLabelDTO;
import com.logpm.trunkline.dto.OpenOrderDTO;
import com.logpm.trunkline.dto.WaybillDetailDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.service.ICarsLoadAsyncService;
import com.logpm.trunkline.service.IOpenOrderService;
import com.logpm.trunkline.service.ITrunklineCarsLoadService;
@ -1691,4 +1690,37 @@ public class OpenOrderController {
}
@ResponseBody
@PostMapping("/findWaybillDes")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询运单目的仓", notes = "传入openOrderDTO")
public R findWaybillDes(@RequestBody OpenOrderDTO openOrderDTO) {
String method = "############findWaybillDes: ";
log.info(method + "请求参数{}", openOrderDTO);
Long departureWarehouseId = openOrderDTO.getDepartureWarehouseId();
Long consigneeId = openOrderDTO.getConsigneeId();
try{
if(Objects.isNull(departureWarehouseId)){
log.warn(method+"发站仓id为空 departureWarehouseId={}",departureWarehouseId);
return R.fail(405,"发站仓id为空");
}
if(Objects.isNull(consigneeId)){
log.warn(method+"收货单位id不能为空 consigneeId={}",consigneeId);
return R.fail(405,"收货单位id不能为空");
}
return openOrderService.findWaybillDes(departureWarehouseId,consigneeId);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
}

33
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklinePackageTrackLogClient.java

@ -0,0 +1,33 @@
package com.logpm.trunkline.feign;
import com.alibaba.fastjson.JSONObject;
import com.logpm.trunkline.service.IPackageTrackLogAsyncService;
import com.logpm.warehouse.entity.WarehousePackageTrackLogEntity;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@ApiIgnore()
@RestController
@AllArgsConstructor
public class TrunklinePackageTrackLogClient implements ITrunklinePackageTrackLogClient{
private final IPackageTrackLogAsyncService packageTrackLogAsyncService;
@Override
public void addPackageTrackLog(List<JSONObject> addPackageTrackLogList, List<String> orderPackageCodes, Integer workNode) {
List<WarehousePackageTrackLogEntity> ls = new ArrayList<>();
addPackageTrackLogList.forEach(jsonObject -> {
WarehousePackageTrackLogEntity warehousePackageTrackLogEntity = jsonObject.toJavaObject(WarehousePackageTrackLogEntity.class);
ls.add(warehousePackageTrackLogEntity);
});
packageTrackLogAsyncService.addBatchPackageTrackLog(ls, orderPackageCodes, workNode);
}
}

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

@ -9,6 +9,7 @@ import com.logpm.trunkline.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
@ -16,7 +17,7 @@ import java.util.Set;
@Mapper
public interface TrunklineAdvanceDetailMapper extends BaseMapper<TrunklineAdvanceDetailEntity> {
void updatePackageStatusById(@Param("packageStatus") String packageStatus, @Param("advanceDetailId") Long advanceDetailId, @Param("warehouseId") Long warehouseId,@Param("warehouseName") String warehouseName);
void updatePackageStatusById(@Param("packageStatus") String packageStatus, @Param("advanceDetailId") Long advanceDetailId, @Param("warehouseId") Long warehouseId, @Param("warehouseName") String warehouseName, @Param("incomingTime") Date incomingTime);
List<TrunklineAdvanceDetailVO> findList(@Param("advanceId") Long advanceId);

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

@ -7,7 +7,8 @@
update logpm_trunkline_advance_detail
set package_status = #{packageStatus},
incoming_warehouse_id = #{warehouseId},
incoming_warehouse_name = #{warehouseName}
incoming_warehouse_name = #{warehouseName},
incoming_time = #{incomingTime}
where id = #{advanceDetailId}
</update>
@ -251,7 +252,7 @@
from logpm_trunkline_advance_detail ltad
left join logpm_trunkline_advance lta on lta.id = ltad.advance_id
left join logpm_distribution_parcel_list ldpl on ltad.order_package_code = ldpl.order_package_code
inner join (
left join (
select pl.order_package_code,
max(pl.update_time) updateTime
from logpm_distribution_parcel_list pl

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.java

@ -29,7 +29,7 @@ public interface TrunklineBillladingMapper extends BaseMapper<TrunklineBillladin
List<TrunklineBillladingDetailListVO> findAdvanceDetailList(@Param("orderCode") String orderCode);
Map<String, Integer> billladingNum(@Param("warehouseId") Long warehouseId, @Param("startByDateStr") Date startByDateStr, @Param("endByDateStr") Date endByDateStr);
Map<String, Integer> billladingNum(@Param("warehouseId") Long warehouseId, @Param("startByDateStr") Date startByDateStr, @Param("endByDateStr") Date endByDateStr, @Param("customerTrain") String customerTrain);
List<TrunklineBillladingLogEntity> findBillladingLogList(@Param("billladingId") Long billladingId);
}

44
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml

@ -147,15 +147,21 @@
</select>
<select id="billladingList" resultType="com.logpm.trunkline.vo.TrunklineBillladingDetailVO">
select ldsa.service_number serviceNum,
ldsa.order_code orderCode,
ldsa.total_number totalNum,
IFNULL(ldsa.incoming_num,0) scanNum
from logpm_distribution_stock_article ldsa
where ldsa.is_zero != 1
and ldsa.warehouse_entry_time &gt;= #{startByDateStr}
and ldsa.warehouse_entry_time &lt;= #{endByDateStr}
and warehouse_id = #{warehouseId}
select lta.service_num serviceNum,
lta.order_code orderCode,
lta.total_num totalNum,
t.scanNum scanNum
from (select ltad.advance_id advanceId,
sum(ltad.quantity) scanNum
from logpm_trunkline_advance_detail ltad
where ltad.incoming_time &gt;= #{startByDateStr}
and ltad.incoming_time &lt;= #{endByDateStr}
and ltad.incoming_warehouse_id = #{warehouseId}
<if test="customerTrain != null and customerTrain != ''">
and ltad.customer_train = #{customerTrain}
</if>
group by ltad.advance_id) t
left join logpm_trunkline_advance lta on lta.id = t.advanceId
</select>
<select id="findAdvanceDetailList" resultType="com.logpm.trunkline.vo.TrunklineBillladingDetailListVO">
@ -168,13 +174,19 @@
</select>
<select id="billladingNum" resultType="java.util.Map">
select sum(ldsa.total_number) totalNum,
sum(IFNULL(ldsa.incoming_num,0)) scanNum
from logpm_distribution_stock_article ldsa
where ldsa.is_zero != 1
and ldsa.warehouse_entry_time &gt;= #{startByDateStr}
and ldsa.warehouse_entry_time &lt;= #{endByDateStr}
and warehouse_id = #{warehouseId}
select sum(lta.total_num) totalNum,
sum(t.scanNum) scanNum
from (select ltad.advance_id advanceId,
sum(ltad.quantity) scanNum
from logpm_trunkline_advance_detail ltad
where ltad.incoming_time &gt;= #{startByDateStr}
and ltad.incoming_time &lt;= #{endByDateStr}
and ltad.incoming_warehouse_id = #{warehouseId}
<if test="customerTrain != null and customerTrain != ''">
and ltad.customer_train = #{customerTrain}
</if>
group by ltad.advance_id) t
left join logpm_trunkline_advance lta on lta.id = t.advanceId
</select>

7
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml

@ -391,6 +391,7 @@
from logpm_trunkline_cars_load ltcl
where ltcl.is_deleted = 0
and ltcl.load_type != '4'
and ltcl.load_status != '100'
and ltcl.start_warehouse_id = #{param.warehouseId}
<if test="param.startTime != null ">
and ltcl.create_time &gt;= #{param.startTime}
@ -400,11 +401,11 @@
</if>
<if test="param.type != null and param.type == 1">
and ltcl.load_status = '0'
and ltcl.load_status != '100'
</if>
<if test="param.type != null and param.type == 2">
and ltcl.load_status != '0'
</if>
order by ltcl.create_time desc
</select>
<select id="arriveUnloadPageList" resultType="com.logpm.trunkline.vo.TrunklineCarsLoadVO">
@ -446,8 +447,10 @@
lww.remark remark,
ROUND(lww.total_freight/lww.total_count,2) price
from logpm_distribution_stock_article ldsa
left join logpm_warehouse_waybill lww on lww.waybill_no = ldsa.waybill_number
left join logpm_warehouse_waybill lww on lww.waybill_no = ldsa.waybill_number
where ldsa.is_zero = 1
and lww.destination_warehouse_id != #{param.warehouseId}
and ldsa.hand_quantity > 0
and ldsa.warehouse_id = #{param.warehouseId}
<if test="param.orderCodes != null and param.orderCodes.size() > 0">
and ldsa.order_code not in

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

@ -773,7 +773,7 @@
select ltcls.*,
ltco.sign_order_id signOrderId
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 and ltcls.warehouse_id = ltco.warehouse_id
left join logpm_trunkline_cars_order ltco on ltco.waybill_id = ltcls.waybill_id and ltco.order_code = ltcls.order_code and ltcls.warehouse_id = ltco.node_id
where ltcls.scan_status = '1'
and ltcls.id in
<foreach collection="carsLoadScanIds" item="item" separator="," open="(" close=")">

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

@ -66,6 +66,9 @@
ltcls.unload_num unloadNum,
ltcls.remark remak,
ltcls.load_code carsNo,
ltcls.sign_user_name signUserName,
ltcls.sign_time signTime,
ltcls.unload_time unloadTime,
ltco.sign_order_id signOrderId
from logpm_trunkline_cars_order ltco
left join logpm_trunkline_cars_load_scan ltcls on ltco.load_id = ltcls.load_id and ltco.node_id = ltcls.warehouse_id and ltcls.order_code = ltco.order_code and ltcls.waybill_no = ltco.waybill_no

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderService.java

@ -87,6 +87,8 @@ public interface IOpenOrderService {
R abolishWaybill(List<Long> waybillIds, Long warehouseId, String warehouseName, String abolishReson);
R findWaybillDes(Long departureWarehouseId, Long consigneeId);
// R findWaybillInfo(String waybillNo);
}

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java

@ -12,13 +12,14 @@ import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
public interface ITrunklineAdvanceDetailService extends BaseService<TrunklineAdvanceDetailEntity> {
void updatePackageStatusById(String packageStatus, Long advanceDetailId, Long warehouseId, String warehouseName);
void updatePackageStatusById(String packageStatus, Long advanceDetailId, Long warehouseId, String warehouseName, Date incomingTime);
TrunklineAdvanceDetailEntity findEntityByOrderPackageCodeAndWarehouseId(String orderPackageCode, Long warehouseId);

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java

@ -116,7 +116,7 @@ public class InComingServiceImpl implements IInComingService {
}
//1.修改暂存单包件入库状态
advanceDetailService.updatePackageStatusById("1", advanceDetailId, warehouseId, warehouseName);
advanceDetailService.updatePackageStatusById("1", advanceDetailId, warehouseId, warehouseName,new Date());
List<String> incomingWarehouseNames = advanceDetailService.findIncomingWarehouseName(advanceId);
advanceService.updateIncomingWarehouseName(String.join(",", incomingWarehouseNames), advanceId);

56
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java

@ -354,8 +354,14 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
BigDecimal otherFee = waybillEntity.getOtherFee();
BigDecimal otherPrice = otherFee.divide(new BigDecimal(totalCount), 2, RoundingMode.HALF_UP);
BigDecimal rebate = waybillEntity.getRebate();
if(Objects.isNull(rebate)){
rebate = BigDecimal.ZERO;
}
BigDecimal rebatePrice = rebate.divide(new BigDecimal(totalCount), 2, RoundingMode.HALF_UP);
BigDecimal thirdOperationFee = waybillEntity.getThirdOperationFee();
if(Objects.isNull(thirdOperationFee)){
thirdOperationFee = BigDecimal.ZERO;
}
BigDecimal thirdOperationPrice = thirdOperationFee.divide(new BigDecimal(totalCount), 2, RoundingMode.HALF_UP);
BigDecimal xPay = waybillEntity.getXPay();
BigDecimal xPayPrice = xPay.divide(new BigDecimal(totalCount), 2, RoundingMode.HALF_UP);
@ -395,8 +401,16 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
json.put("productId",advanceDetailVO.getGoodsId());
json.put("productName",goodsName);
json.put("totalNum",advanceDetailVO.getQuantity());
BigDecimal weight = advanceDetailVO.getWeight();
if(Objects.isNull(weight)){
weight = BigDecimal.ZERO;
}
json.put("totalWeight",advanceDetailVO.getWeight());
json.put("totalVolume",advanceDetailVO.getVolume());
BigDecimal volume = advanceDetailVO.getVolume();
if(Objects.isNull(volume)){
volume = BigDecimal.ZERO;
}
json.put("totalVolume",volume);
WarehouseWayBillDetail warehouseWayBillDetail = detailsMap.get(goodsName);
if(!Objects.isNull(warehouseWayBillDetail)){
@ -404,9 +418,13 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
if(num > 0){
json.put("freightFee",warehouseWayBillDetail.getPrice());
openPrice = openPrice.add(warehouseWayBillDetail.getPrice());
BigDecimal deliveryPrice = warehouseWayBillDetail.getDeliveryPrice();
if(Objects.isNull(deliveryPrice)){
deliveryPrice = BigDecimal.ZERO;
}
json.put("deliveryFee",warehouseWayBillDetail.getDeliveryPrice());
json.put("deliveryServiceFee",warehouseWayBillDetail.getDeliveryPrice());
openPrice = openPrice.add(warehouseWayBillDetail.getDeliveryPrice());
openPrice = openPrice.add(deliveryPrice);
warehouseWayBillDetail.setNum(num-1);
detailsMap.put(goodsName,warehouseWayBillDetail);
}
@ -434,7 +452,7 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
json.put("dPay",dPayPrice);
json.put("hPay",hPayPrice);
json.put("yPay",yPayPrice);
openPrice = openPrice.add(installPrice).add(insurancePrice).add(claimingPrice).add(otherPrice).add(rebatePrice).add(thirdOperationPrice).add(xPayPrice).add(dPayPrice).add(hPayPrice).add(yPayPrice);
openPrice = openPrice.add(installPrice).add(insurancePrice).add(claimingPrice).add(otherPrice).add(rebatePrice).add(thirdOperationPrice);
json.put("openPrice",openPrice);
jsonList.add(json);
});
@ -450,29 +468,41 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
// 使用 BigDecimal 的 add 方法来正确累加总价,确保精度
otherTotalPriceList.add(warehouseWayBillDetail.getPrice().multiply(new BigDecimal(num)));
otherTotalDeliveryPriceList.add(warehouseWayBillDetail.getDeliveryPrice().multiply(new BigDecimal(num)));
BigDecimal deliveryPrice = warehouseWayBillDetail.getDeliveryPrice();
if(Objects.isNull(deliveryPrice)){
deliveryPrice = BigDecimal.ZERO;
}
otherTotalDeliveryPriceList.add(deliveryPrice.multiply(new BigDecimal(num)));
}
});
int otherNum = atomicOtherNum.get();
BigDecimal p = BigDecimal.ZERO;
BigDecimal dp = BigDecimal.ZERO;
//otherTotalPriceList元素求和
BigDecimal otherTotalPrice = otherTotalPriceList.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal p = otherTotalPrice.divide(new BigDecimal(otherNum), 2, RoundingMode.HALF_UP);
BigDecimal otherTotalDeliveryPrice = otherTotalDeliveryPriceList.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal dp = otherTotalDeliveryPrice.divide(new BigDecimal(otherNum), 2, RoundingMode.HALF_UP);
if(otherNum > 0){
BigDecimal otherTotalPrice = otherTotalPriceList.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
p = otherTotalPrice.divide(new BigDecimal(otherNum), 2, RoundingMode.HALF_UP);
BigDecimal otherTotalDeliveryPrice = otherTotalDeliveryPriceList.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
dp = otherTotalDeliveryPrice.divide(new BigDecimal(otherNum), 2, RoundingMode.HALF_UP);
}
BigDecimal finalP = p;
BigDecimal finalDp = dp;
jsonList.forEach(json -> {
BigDecimal op = json.getBigDecimal("openPrice");
BigDecimal freightFee = json.getBigDecimal("freightFee");
if(Objects.isNull(freightFee)){
json.put("freightFee",p);
op = op.add(p);
json.put("freightFee", finalP);
op = op.add(finalP);
}
BigDecimal deliveryFee = json.getBigDecimal("deliveryFee");
if(Objects.isNull(deliveryFee)){
json.put("deliveryFee",dp);
json.put("deliveryServiceFee",dp);
op = op.add(dp);
json.put("deliveryFee", finalDp);
json.put("deliveryServiceFee", finalDp);
op = op.add(finalDp);
}
json.put("openPrice",op);
});

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

@ -178,6 +178,16 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
areaId = badeRegionAreaId;
}
openOrderVO.setDefaultDeliveryWay("2");
Integer typeService = basicdataClientEntity.getTypeService();
if (typeService == 1){
openOrderVO.setDefaultDeliveryWay("2");
}else if(typeService == 2){
openOrderVO.setDefaultDeliveryWay("3");
}else if(typeService == 3){
openOrderVO.setDefaultDeliveryWay("1");
}
openOrderVO.setDeparture(name);
openOrderVO.setDepartureCode(areaId);
openOrderVO.setDepartureArray(departureArray);
@ -197,9 +207,12 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
openOrderVO.setConsigneeMobile(basicdataClientEntity.getPhone());
openOrderVO.setConsigneeAddress(basicdataClientEntity.getDetailedly());
if(!Objects.isNull(advanceEntity)){
openOrderVO.setConsigneeName(advanceEntity.getConsigneePerson());
openOrderVO.setConsigneeMobile(advanceEntity.getConsigneeMobile());
openOrderVO.setConsigneeAddress(advanceEntity.getConsigneeAddress());
String consigneePerson = advanceEntity.getConsigneePerson();
if(!StringUtil.isBlank(consigneePerson)){
openOrderVO.setConsigneeName(consigneePerson);
openOrderVO.setConsigneeMobile(advanceEntity.getConsigneeMobile());
openOrderVO.setConsigneeAddress(advanceEntity.getConsigneeAddress());
}
}
List<String> destinationArray = new ArrayList<>();
@ -3128,6 +3141,21 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
return R.success("作废成功");
}
@Override
public R findWaybillDes(Long departureWarehouseId, Long consigneeId) {
Map<String,Object> map = new HashMap<>();
map.put("destinationWarehouseId",null);
map.put("destinationWarehouseName",null);
BasicdataStorageServicesEntity basicdataStorageServicesEntity = basicdataStorageServicesClient.findEntityBySendWarehouseIdAndClientId(departureWarehouseId, consigneeId);
if (!Objects.isNull(basicdataStorageServicesEntity)) {
map.put("destinationWarehouseId",basicdataStorageServicesEntity.getServeWarehouseId());
map.put("destinationWarehouseName",basicdataStorageServicesEntity.getServeWarehouseName());
}
return R.data(map);
}
private List<EditOrderMsgVO> verifyData(OpenOrderDTO openOrderDTO, WarehouseWaybillEntity waybillEntity) {
log.info("###################verifyData: 验证改单数据");
StringBuilder stringBuilder = new StringBuilder();

12
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java

@ -36,11 +36,7 @@ import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@ -55,8 +51,8 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
private final IWarehouseWaybillClient warehouseWaybillClient;
@Override
public void updatePackageStatusById(String packageStatus, Long advanceDetailId,Long warehouseId,String warehouseName) {
baseMapper.updatePackageStatusById(packageStatus,advanceDetailId,warehouseId,warehouseName);
public void updatePackageStatusById(String packageStatus, Long advanceDetailId,Long warehouseId,String warehouseName,Date incomingTime) {
baseMapper.updatePackageStatusById(packageStatus,advanceDetailId,warehouseId,warehouseName,incomingTime);
}
@Override
@ -288,7 +284,7 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
public R findOrderDetails(OrderDetailsDTO orderDetailsDTO) {
//判断orderDetailsDTO中的订单号 运单号 包件码 服务号 客户车次号至少有一个有值
if(!StringUtil.isBlank(orderDetailsDTO.getOrderCode()) || !StringUtil.isBlank(orderDetailsDTO.getWaybillNo()) || !StringUtil.isBlank(orderDetailsDTO.getOrderPackageCode()) || !StringUtil.isBlank(orderDetailsDTO.getServiceNumber()) || !StringUtil.isBlank(orderDetailsDTO.getTrunklineCarsNo())){
if(StringUtil.isBlank(orderDetailsDTO.getOrderCode()) && StringUtil.isBlank(orderDetailsDTO.getWaybillNo()) && !StringUtil.isBlank(orderDetailsDTO.getOrderPackageCode()) && StringUtil.isBlank(orderDetailsDTO.getServiceNumber()) && StringUtil.isBlank(orderDetailsDTO.getTrunklineCarsNo())){
return R.fail("订单号 运单号 包件码 服务号 客户车次号至少有一个有值");
}

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java

@ -33,7 +33,6 @@ import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.TenantNum;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.mp.base.BaseServiceImpl;
@ -265,7 +264,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
parcelList.setStockArticleId(orderId);
parcelList.setOrderCode(orderCode);
parcelList.setServiceNumber(advanceDetailEntity.getServiceNum());
parcelList.setTrainNumber(advanceEntity.getTrainNumber());
parcelList.setAdvanceId(advanceId);
Long materialId = advanceDetailEntity.getMaterialId();
@ -617,6 +616,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
parcelList.setStockArticleId(orderId);
parcelList.setOrderCode(orderCode);
parcelList.setServiceNumber(advanceDetailEntity.getServiceNum());
parcelList.setTrainNumber(advanceDetailEntity.getTrainNumber());
parcelList.setAdvanceId(advanceId);
Long materialId = advanceDetailEntity.getMaterialId();
@ -656,6 +656,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
advanceDetailEntity.setWaybillNo(waybillNo);
advanceDetailEntity.setIncomingWarehouseId(warehouseId);
advanceDetailEntity.setIncomingWarehouseName(warehouseName);
advanceDetailEntity.setIncomingTime(date);
orderPackageCodes.add(orderPackageCode);
}
parcelListClient.addBatch(parcelListEntityList);

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java

@ -605,12 +605,13 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
String startDateStr = billladingDTO.getStartDateStr();
String endDateStr = billladingDTO.getEndDateStr();
Long warehouseId = billladingDTO.getWarehouseId();
String customerTrain = billladingDTO.getCustomerTrain();
IPage<Object> page = new Page<>();
page.setCurrent(pageNum);
page.setSize(pageSize);
Map<String,Integer> map = baseMapper.billladingNum(warehouseId,CommonUtil.getStartByDateStr(startDateStr),CommonUtil.getEndByDateStr(endDateStr));
Map<String,Integer> map = baseMapper.billladingNum(warehouseId,CommonUtil.getStartByDateStr(startDateStr),CommonUtil.getEndByDateStr(endDateStr),customerTrain);
IPage<TrunklineBillladingDetailVO> ls = baseMapper.billladingList(page,warehouseId,CommonUtil.getStartByDateStr(startDateStr),CommonUtil.getEndByDateStr(endDateStr));
Map<String,Object> m = new HashMap<>();

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

@ -2939,6 +2939,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405, "订单信息不存在");
}
BasicdataWarehouseEntity finalNode = basicdataWarehouseClient.getEntityWarehouseId(finalNodeId);
TrunklineCarsLoadScanEntity carsLoadScanEntity = new TrunklineCarsLoadScanEntity();
carsLoadScanEntity.setLoadId(loadId);
carsLoadScanEntity.setLoadCode(carsLoadEntity.getCarsNo());
@ -2956,8 +2959,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setFromWarehouseId(warehouseId);
carsLoadScanEntity.setUnloadNum(0);
carsLoadScanEntity.setFinalNodeId(finalNodeId);
if(!Objects.isNull(finalNode)){
carsLoadScanEntity.setFinalNodeName(finalNode.getName());
}
carsLoadScanEntity.setRemark("零担补录异常装车");
carsLoadScanEntity.setUnloadCheck(0);
carsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName());
carsLoadScanEntity.setIsSupple(1);
trunklineCarsLoadScanService.save(carsLoadScanEntity);
@ -3471,6 +3478,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405, "配载计划信息不存在");
}
String carsNo = carsLoadEntity.getCarsNo();
TrunklineCarsLoadLineEntity loadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId);
if (Objects.isNull(loadLineEntity)) {
log.warn("############batchUnload: 配载计划节点信息不存在 loadId={} warehouseId={}", loadId, warehouseId);
@ -3647,6 +3656,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
newNoOrderPackage.setWarehouseId(warehouseId);
newNoOrderPackage.setWarehouse(warehouseName);
newNoOrderPackage.setStockArticleId(finalOrderId);
newNoOrderPackage.setTrainNumber(carsNo);
newNoOrderPackage.setOrderPackageStatus("20");
newNoOrderPackage.setOrderPackageFreezeStatus("10");
newNoOrderPackage.setOrderPackageGroundingStatus("10");
@ -3765,6 +3775,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
newNoOrderPackage.setWarehouseId(warehouseId);
newNoOrderPackage.setWarehouse(warehouseName);
newNoOrderPackage.setStockArticleId(finalOrderId);
newNoOrderPackage.setTrainNumber(carsNo);
newNoOrderPackage.setOrderPackageStatus("20");
newNoOrderPackage.setOrderPackageFreezeStatus("10");
newNoOrderPackage.setOrderPackageGroundingStatus("10");
@ -4066,6 +4077,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setUnloadNum(1);
carsLoadScanEntity.setSignTime(date);
carsLoadScanEntity.setSignAbnormal(1);
carsLoadScanEntity.setSignUserName(AuthUtil.getNickName());
carsLoadScanEntity.setSignOrderId(signOrderId);
carsLoadScanEntity.setUnloadTime(date);
carsLoadScanEntity.setRemark("无数据签收");
@ -4108,6 +4120,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setUnloadNum(1);
carsLoadScanEntity.setSignTime(date);
carsLoadScanEntity.setSignAbnormal(1);
carsLoadScanEntity.setSignUserName(AuthUtil.getNickName());
carsLoadScanEntity.setSignOrderId(signOrderId);
carsLoadScanEntity.setUnloadTime(date);
carsLoadScanEntity.setRemark("有数据异常签收");
@ -4169,6 +4182,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setScanStatus("3");
carsLoadScanEntity.setUnloadNum(1);
carsLoadScanEntity.setSignTime(date);
carsLoadScanEntity.setSignUserName(AuthUtil.getNickName());
carsLoadScanEntity.setSignOrderId(signOrderId);
carsLoadScanEntity.setUnloadTime(date);
trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
@ -4330,7 +4344,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
if (!list.isEmpty()) {
//排除list中scanStatus = 1的数据
list = list.stream().filter(e -> !"1".equals(e.getScanStatus())).collect(Collectors.toList());
list = list.stream().filter(e -> "1".equals(e.getScanStatus())).collect(Collectors.toList());
List<String> orderPackageCodes = new ArrayList<>();
@ -4345,6 +4359,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
entity.setScanStatus("3");
entity.setUnloadNum(t.getNum());
entity.setSignTime(date);
entity.setSignUserName(AuthUtil.getNickName());
entity.setUnloadTime(date);
if (entity.getType().equals(1)) {
String scanCode = entity.getScanCode();

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java

@ -15,6 +15,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.annotations.RepeatSubmit;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
@ -184,6 +185,7 @@ public class WarehouseUpdownTypeApiController {
}
@RepeatSubmit
@ResponseBody
@PostMapping("/upShelfOrder")
@ApiOperationSupport(order = 1)
@ -224,6 +226,7 @@ public class WarehouseUpdownTypeApiController {
}
@RepeatSubmit
@ResponseBody
@PostMapping("/upShelfPackage")
@ApiOperationSupport(order = 1)
@ -263,6 +266,7 @@ public class WarehouseUpdownTypeApiController {
}
@RepeatSubmit
@ResponseBody
@PostMapping("/upShelfTray")
@ApiOperationSupport(order = 1)
@ -428,6 +432,7 @@ public class WarehouseUpdownTypeApiController {
}
}
@RepeatSubmit
@ResponseBody
@PostMapping("/upShelfStockList")
@ApiOperationSupport(order = 1)

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/config/InterceptorAdapterConfig.java

@ -1,6 +1,7 @@
package com.logpm.warehouse.config;
import com.logpm.warehouse.config.interceptor.LocalServerLoginAccountsInterceptor;
import com.logpm.warehouse.interceptor.ParameterCombinationInterceptor;
import lombok.AllArgsConstructor;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.redis.lock.RedisLockClient;
@ -23,5 +24,9 @@ public class InterceptorAdapterConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry interceptorRegistry) {
interceptorRegistry.addInterceptor(new LocalServerLoginAccountsInterceptor(redis,environment,redisLockClient)).addPathPatterns("/oldpush/**").order(1);
interceptorRegistry.addInterceptor(new ParameterCombinationInterceptor())
.addPathPatterns("/**");
}
}

66
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/interceptor/ParameterCombinationInterceptor.java

@ -0,0 +1,66 @@
package com.logpm.warehouse.interceptor;
import org.apache.commons.codec.digest.DigestUtils;
import org.springblade.common.annotations.RepeatSubmit;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
import java.util.stream.Collectors;
@Component
public class ParameterCombinationInterceptor implements HandlerInterceptor {
private static final ThreadLocal<String> PROCESSED_REQUEST_HASH = new ThreadLocal<>();
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
if (handler instanceof HandlerMethod) {
HandlerMethod hm = (HandlerMethod) handler;
RepeatSubmit annotation = hm.getMethodAnnotation(RepeatSubmit.class);
if (annotation != null) {
// 计算当前请求参数的MD5哈希值
String currentRequestHash = calculateRequestHash(request.getParameterMap());
// 检查是否已处理过相同参数组合的请求
if (PROCESSED_REQUEST_HASH.get() != null && PROCESSED_REQUEST_HASH.get().equals(currentRequestHash)) {
// 阻止重复提交
response.sendError(HttpServletResponse.SC_CONFLICT, "Duplicate submit detected");
return false;
}
// 保存当前请求的哈希值
PROCESSED_REQUEST_HASH.set(currentRequestHash);
}
}
return true;
}
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
// 清理当前请求的哈希值
PROCESSED_REQUEST_HASH.remove();
}
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
// 可选清理操作,postHandle中已处理
}
/**
* 计算请求参数的MD5哈希值
* @param parameters 请求参数Map
* @return 参数哈希值字符串
*/
private String calculateRequestHash(Map<String, String[]> parameters) {
// 将参数按key排序并拼接为字符串
String sortedParams = parameters.entrySet().stream()
.sorted(Map.Entry.comparingByKey())
.map(entry -> entry.getKey() + "=" + String.join(",", entry.getValue()))
.collect(Collectors.joining("&"));
// 计算并返回MD5摘要
return DigestUtils.md5Hex(sortedParams);
}
}

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTaryAllocationServiceImpl.java

@ -39,7 +39,7 @@ public class WarehouseTaryAllocationServiceImpl extends BaseServiceImpl<Warehous
WarehouseTaryAllocationEntity taryAllocationEntity = baseMapper.selectOne(queryWrapper);
if(Objects.isNull(taryAllocationEntity)){
return null;
}else{
} else {
return taryAllocationEntity.getAllocationId();
}
}

Loading…
Cancel
Save