From 2bc13830407282a526e58fb77bbdd9d58c8f979d Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Tue, 28 May 2024 16:12:35 +0800 Subject: [PATCH] =?UTF-8?q?1.=E7=BB=93=E7=AE=97=E6=A8=A1=E5=9D=97bug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=202.=E6=9B=B4=E6=96=B0=E5=8C=85=E4=BB=B6?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../statistics/dto/ChangesRecordDTO.java | 2 + .../entity/StatisticsChangesRecordEntity.java | 3 ++ .../entity/TrunklineAdvanceDetailEntity.java | 3 ++ .../ITrunklinePackageTrackLogClient.java | 21 +++++++++ .../controller/MerchantBalanceController.java | 10 ++--- .../listener/mq/WaybillFanoutListener.java | 21 ++++++--- .../mapper/StatisticsOrderInfoMapper.xml | 2 +- .../impl/StatisticsOrderInfoServiceImpl.java | 3 +- .../feign/TrunklinePackageTrackLogClient.java | 33 ++++++++++++++ .../mapper/TrunklineAdvanceDetailMapper.java | 3 +- .../mapper/TrunklineAdvanceDetailMapper.xml | 5 ++- .../mapper/TrunklineBillladingMapper.java | 2 +- .../mapper/TrunklineBillladingMapper.xml | 44 ++++++++++++------- .../mapper/TrunklineCarsLoadMapper.xml | 3 +- .../ITrunklineAdvanceDetailService.java | 3 +- .../service/impl/InComingServiceImpl.java | 2 +- .../TrunklineAdvanceDetailServiceImpl.java | 12 ++--- .../impl/TrunklineAdvanceServiceImpl.java | 5 ++- .../impl/TrunklineBillladingServiceImpl.java | 3 +- .../impl/TrunklineCarsLoadServiceImpl.java | 4 ++ 20 files changed, 137 insertions(+), 47 deletions(-) create mode 100644 blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklinePackageTrackLogClient.java create mode 100644 blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklinePackageTrackLogClient.java diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/ChangesRecordDTO.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/ChangesRecordDTO.java index 8108be3a9..566859eb3 100644 --- a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/ChangesRecordDTO.java +++ b/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; diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsChangesRecordEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsChangesRecordEntity.java index f4ce2695d..185759e96 100644 --- a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsChangesRecordEntity.java +++ b/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; diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java index 613922761..fef61c819 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java +++ b/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; } diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklinePackageTrackLogClient.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklinePackageTrackLogClient.java new file mode 100644 index 000000000..61af39974 --- /dev/null +++ b/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 addPackageTrackLogList, List orderPackageCodes, Integer workNode); + +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java index bb7b88dde..a40475a47 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java +++ b/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 pages = balanceOrderInfoService.pageList(merchantStatisticsDTO); diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillFanoutListener.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillFanoutListener.java index a3b7d3f1c..fc9470b26 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillFanoutListener.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillFanoutListener.java @@ -23,6 +23,7 @@ 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 @@ -58,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(); @@ -77,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")); @@ -125,8 +134,8 @@ 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")); @@ -160,8 +169,8 @@ 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")); diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml index f013c28ee..8a11e5bd8 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/StatisticsOrderInfoMapper.xml @@ -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 diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java index d1d661054..47941400e 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java +++ b/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 changesPhotoUrls = changesRecordDTO.getChangesPhotoUrls(); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklinePackageTrackLogClient.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklinePackageTrackLogClient.java new file mode 100644 index 000000000..2d6c0ae0f --- /dev/null +++ b/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 addPackageTrackLogList, List orderPackageCodes, Integer workNode) { + List ls = new ArrayList<>(); + addPackageTrackLogList.forEach(jsonObject -> { + WarehousePackageTrackLogEntity warehousePackageTrackLogEntity = jsonObject.toJavaObject(WarehousePackageTrackLogEntity.class); + ls.add(warehousePackageTrackLogEntity); + }); + + packageTrackLogAsyncService.addBatchPackageTrackLog(ls, orderPackageCodes, workNode); + + } +} diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java index 8101d6b3f..edf27a458 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java +++ b/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 { - 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 findList(@Param("advanceId") Long advanceId); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml index 91e2a84fc..91f004809 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml +++ b/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} @@ -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 diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.java index 909e95f15..d0a5c8d79 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.java @@ -29,7 +29,7 @@ public interface TrunklineBillladingMapper extends BaseMapper findAdvanceDetailList(@Param("orderCode") String orderCode); - Map billladingNum(@Param("warehouseId") Long warehouseId, @Param("startByDateStr") Date startByDateStr, @Param("endByDateStr") Date endByDateStr); + Map billladingNum(@Param("warehouseId") Long warehouseId, @Param("startByDateStr") Date startByDateStr, @Param("endByDateStr") Date endByDateStr, @Param("customerTrain") String customerTrain); List findBillladingLogList(@Param("billladingId") Long billladingId); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml index f79226ad6..77d991a27 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml @@ -147,15 +147,21 @@ diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml index 6e0c835b7..c1a497bbe 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml +++ b/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} and ltcl.create_time >= #{param.startTime} @@ -400,11 +401,11 @@ and ltcl.load_status = '0' - and ltcl.load_status != '100' and ltcl.load_status != '0' + order by ltcl.create_time desc