From 499952af42d7e734f72a3b5f4902c69e37a6863e Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Sun, 22 Dec 2024 10:24:50 +0800 Subject: [PATCH] =?UTF-8?q?add:1.=E5=A2=9E=E5=8A=A0=E8=BD=A6=E6=AC=A1?= =?UTF-8?q?=E5=8D=8F=E5=92=8C=E5=AE=8C=E6=88=90=E4=BD=9C=E4=B8=9A=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E4=BA=8B=E4=BB=B6=EF=BC=8C=E6=A0=B9=E6=8D=AE=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E8=BD=A6=E6=AC=A1=E7=9A=84=E6=88=90=E6=9C=AC?= =?UTF-8?q?=E5=A4=96=E8=AF=B7=E7=BB=93=E7=AE=97=E6=95=B0=E6=8D=AE=20=20=20?= =?UTF-8?q?=20=202.=E5=A2=9E=E5=8A=A0=E5=A4=96=E8=AF=B7=E6=88=90=E6=9C=AC?= =?UTF-8?q?=E7=BB=93=E7=AE=97=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/constant/RabbitConstant.java | 4 - .../constant/broadcast/FanoutConstants.java | 19 ++ .../StationArrivedByLineStationVO.java | 114 +++++++++ .../model/workNode/StationArrivedEnterVO.java | 91 ++++++++ .../entity/TrunklineCarCostEntity.java | 219 ++++++++++++++++++ .../statistics/vo/TrunklineCarCostVO.java | 6 + .../entity/TrunklineCarsLoadEntity.java | 4 + .../TrunklineCarCostController.java | 55 +++++ .../mq/StationArrivedEnterListener.java | 132 +++++++++++ .../mapper/TrunklineCarCostMapper.java | 9 + .../mapper/TrunklineCarCostMapper.xml | 6 + .../service/ITrunklineCarCostService.java | 8 + .../impl/TrunklineCarCostServiceImpl.java | 32 +++ .../config/RabbitMqConfiguration.java | 14 -- .../mapper/TrunklineCarsLoadScanMapper.java | 2 + .../mapper/TrunklineCarsLoadScanMapper.xml | 6 + .../service/ICarsLoadAsyncService.java | 9 + .../trunkline/service/ISendFanoutService.java | 4 + .../ITrunklineCarsLoadScanService.java | 7 + .../impl/CarsLoadAsyncServiceImpl.java | 137 +++++++++-- .../service/impl/SendFanoutServiceImpl.java | 8 +- .../TrunklineCarsLoadScanServiceImpl.java | 4 + .../impl/TrunklineCarsLoadServiceImpl.java | 71 +++--- 23 files changed, 898 insertions(+), 63 deletions(-) create mode 100644 blade-biz-common/src/main/java/org/springblade/common/model/workNode/StationArrivedByLineStationVO.java create mode 100644 blade-biz-common/src/main/java/org/springblade/common/model/workNode/StationArrivedEnterVO.java create mode 100644 blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/TrunklineCarCostEntity.java create mode 100644 blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/TrunklineCarCostVO.java create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/TrunklineCarCostController.java create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/StationArrivedEnterListener.java create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/TrunklineCarCostMapper.java create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/TrunklineCarCostMapper.xml create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/ITrunklineCarCostService.java create mode 100644 blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/TrunklineCarCostServiceImpl.java diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java b/blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java index 2f62971c1..400160488 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java @@ -150,10 +150,6 @@ public interface RabbitConstant { String TEST_RECEIVE_INFO_ROUTING = "test_receive_info_routing" + ModuleNameConstant.DEVAUTH; - /****************干线卸车确认队列******************/ - String TRUNKLINE_UNLOAD_CONFIRM_QUEUE = "trunkline_unload_confirm_queue" + ModuleNameConstant.DEVAUTH; - String TRUNKLINE_UNLOAD_CONFIRM_EXCHANGE = "trunkline_unload_confirm_exchange" + ModuleNameConstant.DEVAUTH; - String TRUNKLINE_UNLOAD_CONFIRM_ROUTING = "trunkline_unload_confirm_routing" + ModuleNameConstant.DEVAUTH; /****************同步老系统库位数据***************/ String SYNC_OLD_UPDOWN_DATA_QUEUE = "sync_old_updown_data_queue" + ModuleNameConstant.DEVAUTH; diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java b/blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java index 845c2da98..2f045779a 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java @@ -122,6 +122,25 @@ public abstract class FanoutConstants { } } + // 卸车~ 包含卸车确认节点 + interface StationArrivedEnter { + // 交换机 + String EXCHANGE = "fanout.trunkline.stationarrivedenter" + ModuleNameConstant.DEVAUTH; + + /** + * 自主预约 + * + * @see org.springblade.common.model.ReservationVO + **/ + interface QUEUE { + // 创建干线车次成本代确认数据 + String STATIONARRIVEDENTER_COST = "fanout.trunkline.stationarrivedenter.statisticsdata.cost" + ModuleNameConstant.DEVAUTH; + } + + + + } + } diff --git a/blade-biz-common/src/main/java/org/springblade/common/model/workNode/StationArrivedByLineStationVO.java b/blade-biz-common/src/main/java/org/springblade/common/model/workNode/StationArrivedByLineStationVO.java new file mode 100644 index 000000000..5895c0b8b --- /dev/null +++ b/blade-biz-common/src/main/java/org/springblade/common/model/workNode/StationArrivedByLineStationVO.java @@ -0,0 +1,114 @@ +package org.springblade.common.model.workNode; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 到站车次的节点信息 + */ +@Data +public class StationArrivedByLineStationVO { + + + /** + * 节点排序 + */ + private Integer sort; + /** + * 节点状态 0未到达 1到车 2发车 + */ + private String nodeStatus; + /** + * 直发货物签收状态 0无直发货物 1未签收 2部分签收 3已签收 + */ + private String signStatus; + /** + * 节点类型 1仓库 2商场 + */ + private String nodeType; + /** + * clientId + */ + private Long nodeId; + /** + * 节点名称 + */ + private String nodeName; + /** + * 联系人 + */ + private String linkMan; + /** + * 联系人电话 + */ + private String linkPhone; + /** + * 联系人地址 + */ + private String linkAddress; + + /** 卸车状态 卸车状态 0未卸车 1网点卸车确认 2终点卸车确认 */ + private String unloadStatus ; + + /** + * 异常件数 + */ + private Integer abnormalNum; + /** + * 卸车件数 + */ + private Integer unloadNumber; + /** + * 现付运输费 + */ + private BigDecimal nowTransportCost; + /** + * 现付油卡费 + */ + private BigDecimal oilCost; + /** + * 回付运输费 + */ + private BigDecimal backTransportCost; + /** + * 到付运输费 + */ + private BigDecimal reachTransportCost; + /** + * 整车信息费 + */ + private BigDecimal wholeCarInfoCost; + /** + * 整车保险费 + */ + private BigDecimal wholeCarInsuranceCost; + /** + * 整车落地费 + */ + private BigDecimal wholeCarGroundCost; + /** + * 发站装车费 + */ + private BigDecimal hairWholeCost; + /** + * 发站其他费 + */ + private BigDecimal hairWholeOtherCost; + /** + * 到站卸车费 + */ + private BigDecimal unloadCost; + /** + * 到站其他费 + */ + private BigDecimal unloadOtherCost; + /** + * 油费 + */ + private BigDecimal fuel; + /** + * 路桥费 + */ + private BigDecimal tollFee; +} diff --git a/blade-biz-common/src/main/java/org/springblade/common/model/workNode/StationArrivedEnterVO.java b/blade-biz-common/src/main/java/org/springblade/common/model/workNode/StationArrivedEnterVO.java new file mode 100644 index 000000000..293ee8965 --- /dev/null +++ b/blade-biz-common/src/main/java/org/springblade/common/model/workNode/StationArrivedEnterVO.java @@ -0,0 +1,91 @@ +package org.springblade.common.model.workNode; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * 卸车确认作业节点数据推送 + */ +@Data +public class StationArrivedEnterVO implements Serializable { + + + /** + * 外请人 + */ + private String outDriverPerson; + + /** + * 司机 + */ + private String driverName; + + /** + * 外请站点 + */ + private String outsideStation; + + /** + * 发车批次号 + */ + private String carsNo; + + /** + * 车次创建时间 + */ + private Date createTime; + + /** + * 是否为直发商家:1=是,2=否【用于配载】 + */ + private String isCustomer; + /** + * 承运商名称 + */ + private String carrierName; + /** + * 车牌号 + */ + private String carNumber; + + /** + * 开始仓库名称 + */ + private String startWarehouseName; + + /** + * 车辆结算类型 + */ + private String carSettlementType; + + /** + * 货物品牌 多个 ,拼接 + */ + private String brandNames; + /** + * 实际装车件数 + */ + private Integer realLoadingNumber; + + /** + * 合计运输费用 + */ + private BigDecimal countTransportCost; + + /** + * 线路集合 + */ + private List stationArrivedByLineStationVOS; + + + + + + + + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/TrunklineCarCostEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/TrunklineCarCostEntity.java new file mode 100644 index 000000000..4a2efec6f --- /dev/null +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/TrunklineCarCostEntity.java @@ -0,0 +1,219 @@ +package com.logpm.statistics.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +@TableName("logpm_trunkline_car_cost") +@ApiModel(value = "StatisticsDistributionPackage对象", description = "干线车次成本") +@EqualsAndHashCode(callSuper = true) +public class TrunklineCarCostEntity extends TenantEntity { + + /** + * 申请时间 + */ + private Date effectTime; + + /** + * 车牌号 + */ + private String plateNumber; + + /** + * 司机名称 + */ + private String driverName; + + /** + * 实际收款人 + */ + private String actualReceivablePerson; + + /** + * 车次号码 + */ + private String carsNo; + + /** + * 车次类型 外请 自有 目前该字段不使用 + * + */ + private Integer carsNoType; + + /** + * 调车员 + */ + private String driverStaff; + + /** + * 车辆类型(结算车辆类型) + */ + private String vehicleType; + +// /** +// * 客户名称 和货物品牌 相同 +// */ +// private String customerName; + + /** + * 货物品牌,多个拼接在一起 + */ + private String brands; + + /** + * 起始站点 + */ + private String startStation; + + /** + * 外请网点 + */ + private String outStation; + + /** + * 货数 + */ + private Integer goodsNum; + + /** + * 原价(元) + */ + private BigDecimal originalPrice; + + /** + * 实际驾驶员费用(元) + */ + private BigDecimal actualDriverFee; + + /** + * 燃油卡费(元) + */ + private BigDecimal fuelCardFee; + + /** + * 路桥费f(元) + */ + private BigDecimal bridgeFee; + + /** + * 现付运输费(元) + */ + private BigDecimal nowFreightFee; + + /** + * 回收货运费(元) + */ + private BigDecimal returnFreightFee; + + /** + * 到付运输费(元) + */ + private BigDecimal payFreightFee; + + /** + * 整车信息费(元) + */ + private BigDecimal trailerInsuranceFee; + + /** + * 整车保险费(元) + */ + private BigDecimal trailerInsuranceCost; + + /** + * 整车落地费(元) + */ + private BigDecimal landingFee; + + /** + * 发站装车费(元) + */ + private BigDecimal stationLoadingFee; + + /** + * 发站其它费(元) + */ + private BigDecimal otherStationFee; + + /** + * 到站卸车费(元) + */ + private BigDecimal stationUnloadingFee; + + /** + * 其他费用(元) + */ + private BigDecimal otherFee; + + /** + *额外费用(元) + */ + private BigDecimal additionalFee; + + /** + * 平台结算fee(元) + */ + private BigDecimal platformSettlementFee; + + /** + *钉钉编号 + */ + private String dingDingNumber; + + /** + * 平台订单号 + */ + private String platformOrderNumber; + + /** + * 付款时间 + */ + private Date paymentTime; + + /** + * 付款方名称 + */ + private String paymentName; + + /** + * 付款方账号 + */ + private String paymentAccount; + + /** + * 收款方如是平台叫车该字段未平台名称 + */ + private String receiveName; + + /** + * 收款账号 + */ + private String receiveAccount; + + /** + * 线路名称 + */ + private String routeName; + + /** + * 付款记录 + */ + private String carPayId; + + /** + * 是否确认1确认0未确认 + */ + private Integer isEnter; + + /** + * 是否支付(0:未支付,1:已支付) + */ + private Integer isPayment; + +} diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/TrunklineCarCostVO.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/TrunklineCarCostVO.java new file mode 100644 index 000000000..eccfe6506 --- /dev/null +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/TrunklineCarCostVO.java @@ -0,0 +1,6 @@ +package com.logpm.statistics.vo; + +import com.logpm.statistics.entity.TrunklineCarCostEntity; + +public class TrunklineCarCostVO extends TrunklineCarCostEntity { +} diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadEntity.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadEntity.java index e0eac6929..32aad8b7e 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadEntity.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadEntity.java @@ -214,4 +214,8 @@ public class TrunklineCarsLoadEntity extends TenantEntity { @ApiModelProperty(name = "外请人",notes = "") private String outDriverPerson; + + /** 外请站点*/ + @ApiModelProperty(name = "外请站点",notes = "") + private String outsideStation; } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/TrunklineCarCostController.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/TrunklineCarCostController.java new file mode 100644 index 000000000..673cd7462 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/TrunklineCarCostController.java @@ -0,0 +1,55 @@ +package com.logpm.statistics.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.logpm.statistics.entity.ExpenseDispatchPriceOverZoneEntity; +import com.logpm.statistics.entity.TrunklineCarCostEntity; +import com.logpm.statistics.query.ExpenseDispatchTrainDetailMonthQuery; +import com.logpm.statistics.service.ITrunklineCarCostService; +import com.logpm.statistics.vo.ExpenseDispatchWarehouseMonthVO; +import com.logpm.statistics.vo.TrunklineCarCostVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.Map; + +/** + * 干线车次成本结算控制器 + * + * @author pref + */ +@RestController +@AllArgsConstructor +@RequestMapping("/trunklineCarCost") +@Api(value = "干线车次成本结算", tags = "干线车次成本结算") +public class TrunklineCarCostController extends BladeController { + + private final ITrunklineCarCostService trunklineCarCostService; + + /** + * 分页列表 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "分页", notes = "传入expenseDispatchWarehouseMonth") + public R> page(@ApiIgnore @RequestParam Map expenseDispatchPriceOverZone, Query query) { + + IPage page = trunklineCarCostService.page(Condition.getPage(query), Condition.getQueryWrapper(expenseDispatchPriceOverZone, TrunklineCarCostEntity.class)); + + return R.data(page); + + + } + + +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/StationArrivedEnterListener.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/StationArrivedEnterListener.java new file mode 100644 index 000000000..f07bd9242 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/StationArrivedEnterListener.java @@ -0,0 +1,132 @@ +package com.logpm.statistics.listener.mq; + +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; +import com.logpm.statistics.entity.TrunklineCarCostEntity; +import com.logpm.statistics.service.ITrunklineCarCostService; +import com.logpm.trunkline.entity.TrunklineCarsLoadEntity; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.common.constant.broadcast.FanoutConstants; +import org.springblade.common.model.NodeFanoutMsg; +import org.springblade.common.model.StockUpVO; +import org.springblade.common.model.workNode.StationArrivedByLineStationVO; +import org.springblade.common.model.workNode.StationArrivedEnterVO; +import org.springblade.core.tool.utils.StringUtil; +import org.springframework.amqp.core.ExchangeTypes; +import org.springframework.amqp.rabbit.annotation.Exchange; +import org.springframework.amqp.rabbit.annotation.Queue; +import org.springframework.amqp.rabbit.annotation.QueueBinding; +import org.springframework.amqp.rabbit.annotation.RabbitListener; +import org.springframework.stereotype.Component; + +import java.math.BigDecimal; +import java.util.List; + +@Slf4j +@Component +@AllArgsConstructor +public class StationArrivedEnterListener { + + + private final ITrunklineCarCostService trunklineCarCostService; + + @RabbitListener(bindings = @QueueBinding( + value = @Queue(name = FanoutConstants.trunkline.StationArrivedEnter.QUEUE.STATIONARRIVEDENTER_COST), + exchange = @Exchange(name = FanoutConstants.trunkline.StationArrivedEnter.EXCHANGE, type = ExchangeTypes.FANOUT) + )) + public void stationArrivedEnterData(String msg) { + + NodeFanoutMsg bean = JSONUtil.toBean(msg, NodeFanoutMsg.class); + + Object main = bean.getMain(); + JSONObject entries = JSONUtil.parseObj(main); + StationArrivedEnterVO vo = JSONUtil.toBean(entries, StationArrivedEnterVO.class); + List lineList = vo.getStationArrivedByLineStationVOS(); + // 判断每个节点是否都已点击卸车确认 + boolean flag = lineList.stream().filter(t->t.getSort()!=1).noneMatch(m -> m.getUnloadStatus().equals("0")); + if(!flag){ + log.warn("{}:车次存在未点击卸车确认完成的数据",vo.getCarsNo()); + return ; + } + if(StringUtil.isBlank(vo.getOutDriverPerson())){ + log.warn("{}:该车次自由车次数据",vo.getCarsNo()); + return ; + } + // 构建需要保存的数据 + TrunklineCarCostEntity costEntity = buildCostEntity(vo); + + trunklineCarCostService.saveTrunklineCarCost(costEntity); + + + } + + /** + * 构建需要的保存数据库信息 + * + * @param main + * @return + */ + private TrunklineCarCostEntity buildCostEntity(StationArrivedEnterVO main) { + + TrunklineCarCostEntity data =new TrunklineCarCostEntity(); + data.setEffectTime(main.getCreateTime()); + data.setPlateNumber(main.getCarNumber()); + data.setDriverName(main.getDriverName()); + data.setActualReceivablePerson(main.getDriverName()); + data.setCarsNo(main.getCarsNo()); + data.setCarsNoType(1); + data.setDriverStaff(main.getOutDriverPerson()); + data.setVehicleType(main.getCarSettlementType()); +// data.setCustomerName(main.getBrandNames()); + data.setBrands(main.getBrandNames()); + data.setStartStation(main.getStartWarehouseName()); + data.setOutStation(main.getOutsideStation()); + data.setGoodsNum(main.getRealLoadingNumber()); + data.setOriginalPrice(main.getCountTransportCost()); + + List list = main.getStationArrivedByLineStationVOS(); + + // 现付运输费合计 + data.setNowFreightFee(list.stream().map(StationArrivedByLineStationVO::getNowTransportCost).reduce(BigDecimal.ZERO, BigDecimal::add)); + // 现付油卡费合计 + data.setFuelCardFee(list.stream().map(StationArrivedByLineStationVO::getOilCost).reduce(BigDecimal.ZERO, BigDecimal::add)); + // 路桥费合计 + data.setBridgeFee(list.stream().map(StationArrivedByLineStationVO::getTollFee).reduce(BigDecimal.ZERO, BigDecimal::add)); + // 回付运输费合计 + data.setReturnFreightFee(list.stream().map(StationArrivedByLineStationVO::getBackTransportCost).reduce(BigDecimal.ZERO, BigDecimal::add)); + // 到付运输费合计 + data.setPayFreightFee(list.stream().map(StationArrivedByLineStationVO::getReachTransportCost).reduce(BigDecimal.ZERO, BigDecimal::add)); + // 整车信息费合计 + data.setTrailerInsuranceFee(list.stream().map(StationArrivedByLineStationVO::getWholeCarInfoCost).reduce(BigDecimal.ZERO, BigDecimal::add)); + // 整车保险费合计 + data.setTrailerInsuranceCost(list.stream().map(StationArrivedByLineStationVO::getWholeCarInsuranceCost).reduce(BigDecimal.ZERO, BigDecimal::add)); + // 整车落地费合计 + data.setLandingFee(list.stream().map(StationArrivedByLineStationVO::getWholeCarGroundCost).reduce(BigDecimal.ZERO, BigDecimal::add)); + // 发站装车费合计 + data.setStationLoadingFee(list.stream().map(StationArrivedByLineStationVO::getHairWholeCost).reduce(BigDecimal.ZERO, BigDecimal::add)); + // 发站其它费合计 + data.setOtherStationFee(list.stream().map(StationArrivedByLineStationVO::getHairWholeOtherCost).reduce(BigDecimal.ZERO, BigDecimal::add)); + // 到站卸车费合计 + data.setStationUnloadingFee(list.stream().map(StationArrivedByLineStationVO::getUnloadCost).reduce(BigDecimal.ZERO, BigDecimal::add)); + // 到站其它费合计 + data.setOtherFee(list.stream().map(StationArrivedByLineStationVO::getUnloadOtherCost).reduce(BigDecimal.ZERO, BigDecimal::add)); + + // 平台结算费用 合计运输费 - 现付油卡费 + data.setPlatformSettlementFee(data.getNowFreightFee().subtract(data.getFuelCardFee())); + + data.setPayFreightFee(main.getCountTransportCost()); + data.setPaymentTime(main.getCreateTime()); + data.setPaymentName(main.getOutDriverPerson()); + data.setPaymentAccount(main.getOutDriverPerson()); + data.setReceiveName(main.getOutDriverPerson()); + data.setReceiveAccount(main.getOutDriverPerson()); + data.setIsEnter(0); + data.setIsPayment(0); + + + return data; + } + + +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/TrunklineCarCostMapper.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/TrunklineCarCostMapper.java new file mode 100644 index 000000000..c61a05528 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/TrunklineCarCostMapper.java @@ -0,0 +1,9 @@ +package com.logpm.statistics.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.logpm.statistics.entity.TrunklineCarCostEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface TrunklineCarCostMapper extends BaseMapper { +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/TrunklineCarCostMapper.xml b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/TrunklineCarCostMapper.xml new file mode 100644 index 000000000..708528285 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/TrunklineCarCostMapper.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/ITrunklineCarCostService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/ITrunklineCarCostService.java new file mode 100644 index 000000000..a5f9806e9 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/ITrunklineCarCostService.java @@ -0,0 +1,8 @@ +package com.logpm.statistics.service; + +import com.logpm.statistics.entity.TrunklineCarCostEntity; +import org.springblade.core.mp.base.BaseService; + +public interface ITrunklineCarCostService extends BaseService { + TrunklineCarCostEntity saveTrunklineCarCost(TrunklineCarCostEntity costEntity); +} diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/TrunklineCarCostServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/TrunklineCarCostServiceImpl.java new file mode 100644 index 000000000..891073273 --- /dev/null +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/TrunklineCarCostServiceImpl.java @@ -0,0 +1,32 @@ +package com.logpm.statistics.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.logpm.statistics.entity.TrunklineCarCostEntity; +import com.logpm.statistics.mapper.TrunklineCarCostMapper; +import com.logpm.statistics.service.ITrunklineCarCostService; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class TrunklineCarCostServiceImpl extends BaseServiceImpl implements ITrunklineCarCostService { + @Override + public TrunklineCarCostEntity saveTrunklineCarCost(TrunklineCarCostEntity costEntity) { + + // 需要判断该车次是否存在过结算信息 + + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq("cars_no", costEntity.getCarsNo()); + List list = baseMapper.selectList(queryWrapper); + if(!list.isEmpty()){ + log.warn("该车次已创建结算单"); + return list.get(0); + } + + // 保存对象 + save(costEntity); + return costEntity; + } +} diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/config/RabbitMqConfiguration.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/config/RabbitMqConfiguration.java index 4f41cda88..08c4a217b 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/config/RabbitMqConfiguration.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/config/RabbitMqConfiguration.java @@ -44,20 +44,6 @@ public class RabbitMqConfiguration { return template; } - @Bean - public Queue unloadConfirmQueue() { - return new Queue(RabbitConstant.TRUNKLINE_UNLOAD_CONFIRM_QUEUE, true); - } - @Bean - public CustomExchange unloadConfirmExchange() { - Map args = Maps.newHashMap(); - args.put("x-delayed-type", "direct"); - return new CustomExchange(RabbitConstant.TRUNKLINE_UNLOAD_CONFIRM_EXCHANGE, "x-delayed-message", true, false, args); - } - @Bean - public Binding unloadConfirmBinding(Queue unloadConfirmQueue, CustomExchange unloadConfirmExchange) { - return BindingBuilder.bind(unloadConfirmQueue).to(unloadConfirmExchange).with(RabbitConstant.TRUNKLINE_UNLOAD_CONFIRM_ROUTING).noargs(); - } @Bean public Queue incomingToLoadQueue() { diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java index 16d3e5ab9..44deeb387 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java @@ -203,4 +203,6 @@ public interface TrunklineCarsLoadScanMapper extends BaseMapper orderPackageCodeList, @Param("waybillId") Long waybillId, @Param("waybillNo") String waybillNo); List findRetentionPackage(@Param("orderPackageCode") String orderPackageCode, @Param("warehouseId") Long warehouseId); + + String findBrandNameByCarLoadCode(@Param("loadCode") String loadCode); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml index 8ca11cf0d..ad13b609c 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml @@ -1217,7 +1217,13 @@ and type = '1' and scan_status = '1' + diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java index 755bdd997..e2032b656 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java @@ -1,7 +1,10 @@ package com.logpm.trunkline.service; +import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.trunkline.entity.*; import com.logpm.trunkline.vo.TrunklineScanZeroDetailVO; +import org.springblade.common.model.NodeFanoutMsg; +import org.springblade.core.secure.BladeUser; import java.util.List; @@ -48,4 +51,10 @@ public interface ICarsLoadAsyncService { void sendReportPackageSignData(String nickName, Long userId, Long warehouseId, String warehouseName, TrunklineCarsLoadEntity carsLoadEntity, List orderPackageCodeList); void sendReportZeroPackageSignData(Long userId, String nickName, Long warehouseId, String warehouseName, List updateScanZeroDetailList, TrunklineCarsLoadScanEntity carsLoadScanEntity, TrunklineCarsLoadEntity carsLoadEntity); + + /** + * 站点卸车完成消息推送 + * @param user + */ + void sendStationArrivedEnter(TrunklineCarsLoadEntity carsLoadEntity, String brands,BladeUser user, BasicdataWarehouseEntity warehouseEntity); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ISendFanoutService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ISendFanoutService.java index 670365aee..b5b359b3c 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ISendFanoutService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ISendFanoutService.java @@ -1,7 +1,11 @@ package com.logpm.trunkline.service; import org.springblade.common.model.FanoutMsg; +import org.springblade.common.model.NodeFanoutMsg; +import org.springblade.core.secure.BladeUser; public interface ISendFanoutService{ void sendFanoutMsg(FanoutMsg fanoutMsg); + + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java index bbf8afcfe..1080baaf1 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java @@ -206,4 +206,11 @@ public interface ITrunklineCarsLoadScanService extends BaseService findRetentionPackage(String orderPackageCode, Long warehouseId); + /** + * 根据车次号查询车上运输的品牌 + * @param loadCode 干线车次号 + * @return + */ + String findBrandNameByCarLoadCode(String loadCode); + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java index 57ae223a2..bb9a50210 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java @@ -1,6 +1,7 @@ package com.logpm.trunkline.service.impl; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; @@ -13,10 +14,14 @@ import com.logpm.aftersales.entity.AftersalesAbnormalRecordZeroDetailEntity; import com.logpm.aftersales.feign.IAftersalesAbnormalRecordClient; import com.logpm.aftersales.feign.IAftersalesAbnormalRecordZeroDetailClient; import com.logpm.aftersales.feign.IAftersalesWorkOrderClient; +import com.logpm.basic.entity.BasicCarModelEntity; +import com.logpm.basic.feign.IBasicCarModelClient; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.distribution.entity.DistributionParcelListEntity; +import com.logpm.distribution.entity.DistributionReservationEntity; import com.logpm.distribution.entity.DistributionStockArticleEntity; +import com.logpm.distribution.entity.DistrilbutionBillLadingEntity; import com.logpm.distribution.feign.IDistributionParcelListClient; import com.logpm.distribution.feign.IDistributionStockArticleClient; import com.logpm.factorydata.enums.BrandEnums; @@ -45,9 +50,14 @@ import org.springblade.common.exception.CustomerException; import org.springblade.common.model.FanoutMsg; import org.springblade.common.model.NodeFanoutMsg; import org.springblade.common.model.PackageData; +import org.springblade.common.model.StockUpVO; +import org.springblade.common.model.workNode.StationArrivedByLineStationVO; +import org.springblade.common.model.workNode.StationArrivedEnterVO; import org.springblade.common.utils.CommonUtil; +import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.system.cache.DictBizCache; +import org.springframework.amqp.AmqpException; import org.springframework.amqp.rabbit.connection.CorrelationData; import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.beans.factory.annotation.Autowired; @@ -72,6 +82,9 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { private ITrunklineCarsLoadLineService trunklineCarsLoadLineService; @Autowired private IWarehouseWaybillClient warehouseWaybillClient; + + @Autowired + private IBasicCarModelClient basicCarModelClient; @Autowired private ITrunklineCostShareRecordService trunklineCostShareRecordService; @Autowired @@ -221,7 +234,7 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { if (deptIds.contains(",")) { String[] split = deptIds.split(","); deptId = Long.parseLong(split[split.length - 1]); - }else{ + } else { deptId = Long.parseLong(deptIds); } @@ -303,7 +316,7 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { @LogpmAsync("asyncExecutor") @Override - public void costShareByLoadId(Long loadId, TrunklineCarsLoadEntity carsLoadEntity,Long warehouseId,String warehouseName) { + public void costShareByLoadId(Long loadId, TrunklineCarsLoadEntity carsLoadEntity, Long warehouseId, String warehouseName) { String proportion1 = DictBizCache.getValue(DictBizConstant.TRUNKLINE_COST_PROPORTION, "1"); String proportion2 = DictBizCache.getValue(DictBizConstant.TRUNKLINE_COST_PROPORTION, "2"); @@ -386,7 +399,7 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { } - sendReportCostShareData(list,AuthUtil.getUserId(),AuthUtil.getNickName(),warehouseId,warehouseName,carsLoadEntity); + sendReportCostShareData(list, AuthUtil.getUserId(), AuthUtil.getNickName(), warehouseId, warehouseName, carsLoadEntity); } @@ -670,7 +683,7 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { List abnormalRecordEntities1 = aftersalesAbnormalRecordEntities.stream().filter(abnormalRecordEntity -> abnormalRecordEntity.getIsZero() == 1).collect(Collectors.toList()); //把abnormalRecordEntities1中所有元素associationId放入一个集合 List associationIdList = abnormalRecordEntities1.stream().map(AftersalesAbnormalRecordEntity::getAssociationId).collect(Collectors.toList()); - if(CollUtil.isNotEmpty(associationIdList)){ + if (CollUtil.isNotEmpty(associationIdList)) { List scanZeroDetailVOList = trunklineScanZeroDetailService.findListByCarsLoadScanIds(associationIdList); //把scanZeroDetailVOList所有元素通过scanId进行分组 Map> scanZeroDetailVOMap = scanZeroDetailVOList.stream().collect(Collectors.groupingBy(TrunklineScanZeroDetailVO::getScanId)); @@ -763,9 +776,9 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg(); - if(startWarehouseId.equals(warehouseId)){ + if (startWarehouseId.equals(warehouseId)) { nodeFanoutMsg.setNode(WorkNodeEnums.INITIAL_WAREHOUSE_DEPART); - }else{ + } else { nodeFanoutMsg.setNode(WorkNodeEnums.TRANSFER_WAREHOUSE_DEPART); } nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD); @@ -851,9 +864,9 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg(); Long startWarehouseId = carsLoadEntity.getStartWarehouseId(); - if(warehouseId.equals(startWarehouseId)){ + if (warehouseId.equals(startWarehouseId)) { nodeFanoutMsg.setNode(WorkNodeEnums.CANCEL_INITIAL_WAREHOUSE_DEPART); - }else{ + } else { nodeFanoutMsg.setNode(WorkNodeEnums.CANEL_TRANSFER_WAREHOUSE_DEPART); } nodeFanoutMsg.setBizOperation(BizOperationEnums.DELETE); @@ -1068,9 +1081,9 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { public void sendReportPackageSignData(String nickName, Long userId, Long warehouseId, String warehouseName, TrunklineCarsLoadEntity carsLoadEntity, List orderPackageCodeList) { NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg(); String loadType = carsLoadEntity.getLoadType(); - if("4".equals(loadType)){ + if ("4".equals(loadType)) { nodeFanoutMsg.setNode(WorkNodeEnums.SIGN_TRIPARTITE_TRANSFER_DEPART); - }else{ + } else { nodeFanoutMsg.setNode(WorkNodeEnums.SIGN_DIRECT_SHIPPER); } nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD); @@ -1109,9 +1122,9 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg(); String loadType = carsLoadEntity.getLoadType(); - if("4".equals(loadType)){ + if ("4".equals(loadType)) { nodeFanoutMsg.setNode(WorkNodeEnums.SIGN_TRIPARTITE_TRANSFER_DEPART); - }else{ + } else { nodeFanoutMsg.setNode(WorkNodeEnums.SIGN_DIRECT_SHIPPER); } nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD); @@ -1223,8 +1236,8 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { .operator(AuthUtil.getNickName()) .operatorTime(new Date()) .warehouse(warehouseName) - .startWarehouse(ObjectUtil.isNotEmpty(parcelListEntity) ? parcelListEntity.getSendWarehouseName():"") - .endWarehouse(ObjectUtil.isNotEmpty(parcelListEntity) ? parcelListEntity.getAcceptWarehouseName():"") + .startWarehouse(ObjectUtil.isNotEmpty(parcelListEntity) ? parcelListEntity.getSendWarehouseName() : "") + .endWarehouse(ObjectUtil.isNotEmpty(parcelListEntity) ? parcelListEntity.getAcceptWarehouseName() : "") .address("在【" + warehouseName + "】入库") .brand(BrandEnums.getByValue(parcelListEntity.getBrandName())) .main(JSONUtil.toJsonStr(main)) @@ -1233,8 +1246,8 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { .packageCode(orderPackageCode) .warehouseName(warehouseName) .waybillNumber(parcelListEntity.getWaybillNumber()) - .destinationWarehouse(ObjectUtil.isNotEmpty(parcelListEntity) ? parcelListEntity.getAcceptWarehouseName():"") - .waybillStartWarehouse(ObjectUtil.isNotEmpty(parcelListEntity) ? parcelListEntity.getSendWarehouseName():"") + .destinationWarehouse(ObjectUtil.isNotEmpty(parcelListEntity) ? parcelListEntity.getAcceptWarehouseName() : "") + .waybillStartWarehouse(ObjectUtil.isNotEmpty(parcelListEntity) ? parcelListEntity.getSendWarehouseName() : "") .orderCode(orderCode) .build())) .build(); @@ -1250,4 +1263,96 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { updownTypeClient.downPackageOrDelTray(orderPackageCode, fromWarehouseId, remark); } + + @Override + public void sendStationArrivedEnter(TrunklineCarsLoadEntity carsLoadEntity,String brands, BladeUser user, BasicdataWarehouseEntity warehouseEntity) { + + List list = trunklineCarsLoadLineService.findListByLoadId(carsLoadEntity.getId()); + + NodeFanoutMsg stationArrivedEnterVONodeFanoutMsg = buildNodeFanoutMsgForStationArrivedEnter(carsLoadEntity,brands, list, user, warehouseEntity); + + stationArrivedEnter(stationArrivedEnterVONodeFanoutMsg, user); + + } + + private NodeFanoutMsg buildNodeFanoutMsgForStationArrivedEnter(TrunklineCarsLoadEntity carsLoadEntity,String brands, List lineList, BladeUser user, BasicdataWarehouseEntity warehouseEntity) { + + NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg(); + nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD); + nodeFanoutMsg.setNode(WorkNodeEnums.NET_ARRIVE_CAR); + nodeFanoutMsg.setWarehouse(warehouseEntity.getName()); + nodeFanoutMsg.setWarehouseId(warehouseEntity.getId()); + nodeFanoutMsg.setOperator(user.getNickName()); + nodeFanoutMsg.setOperatorTime(carsLoadEntity.getCreateTime()); + StationArrivedEnterVO stationArrivedEnterVO = new StationArrivedEnterVO(); + stationArrivedEnterVO.setOutDriverPerson(carsLoadEntity.getOutDriverPerson()); + stationArrivedEnterVO.setOutsideStation(carsLoadEntity.getOutsideStation()); + stationArrivedEnterVO.setCarsNo(carsLoadEntity.getCarsNo()); + stationArrivedEnterVO.setCarNumber(carsLoadEntity.getCarNumber()); + stationArrivedEnterVO.setStartWarehouseName(warehouseEntity.getName()); + stationArrivedEnterVO.setDriverName(carsLoadEntity.getDriverName()); + // 车辆结算类型 + BasicCarModelEntity nc = basicCarModelClient.getCarModelByCarNumber(stationArrivedEnterVO.getCarNumber()); + if(nc != null){ + stationArrivedEnterVO.setCarSettlementType(nc.getVehicleModel()); + } + // 获取车次品牌-- 查询车辆运输 + stationArrivedEnterVO.setBrandNames(brands); + stationArrivedEnterVO.setRealLoadingNumber(carsLoadEntity.getRealLoadingNumber()); + stationArrivedEnterVO.setCountTransportCost(carsLoadEntity.getCountTransportCost()); + stationArrivedEnterVO.setIsCustomer(carsLoadEntity.getIsCustomer()); + stationArrivedEnterVO.setCarrierName(carsLoadEntity.getCarrierName()); + stationArrivedEnterVO.setCreateTime(carsLoadEntity.getCreateTime()); + + List stationArrivedByLineStationVOS = new ArrayList<>(); + + + if(CollectionUtil.isEmpty(lineList)){ + log.warn("干线车次没有节点信息"); + return null; + } + lineList.forEach(line -> { + StationArrivedByLineStationVO stationArrivedByLineStationVO = new StationArrivedByLineStationVO(); + stationArrivedByLineStationVO.setNodeStatus(line.getNodeStatus()); + stationArrivedByLineStationVO.setSignStatus(line.getSignStatus()); + stationArrivedByLineStationVO.setNodeType(line.getNodeType()); + stationArrivedByLineStationVO.setNodeId(line.getNodeId()); + stationArrivedByLineStationVO.setNodeName(line.getNodeName()); + stationArrivedByLineStationVO.setLinkMan(line.getLinkMan()); + stationArrivedByLineStationVO.setLinkPhone(line.getLinkPhone()); + stationArrivedByLineStationVO.setLinkAddress(line.getLinkAddress()); + stationArrivedByLineStationVO.setUnloadStatus(line.getUnloadStatus()); + stationArrivedByLineStationVO.setAbnormalNum(line.getAbnormalNum()); + stationArrivedByLineStationVO.setUnloadNumber(line.getUnloadNumber()); + stationArrivedByLineStationVO.setNowTransportCost(line.getNowTransportCost()); + stationArrivedByLineStationVO.setOilCost(line.getOilCost()); + stationArrivedByLineStationVO.setBackTransportCost(line.getBackTransportCost()); + stationArrivedByLineStationVO.setReachTransportCost(line.getReachTransportCost()); + stationArrivedByLineStationVO.setWholeCarInfoCost(line.getWholeCarInfoCost()); + stationArrivedByLineStationVO.setWholeCarInsuranceCost(line.getWholeCarInsuranceCost()); + stationArrivedByLineStationVO.setWholeCarGroundCost(line.getWholeCarGroundCost()); + stationArrivedByLineStationVO.setHairWholeCost(line.getHairWholeCost()); + stationArrivedByLineStationVO.setHairWholeOtherCost(line.getHairWholeOtherCost()); + stationArrivedByLineStationVO.setUnloadCost(line.getUnloadCost()); + stationArrivedByLineStationVO.setUnloadOtherCost(line.getUnloadOtherCost()); + stationArrivedByLineStationVO.setFuel(line.getFuel()); + stationArrivedByLineStationVO.setTollFee(line.getTollFee()); + stationArrivedByLineStationVO.setSort(line.getSort()); + stationArrivedByLineStationVOS.add(stationArrivedByLineStationVO); + }); + + stationArrivedEnterVO.setStationArrivedByLineStationVOS(stationArrivedByLineStationVOS); + nodeFanoutMsg.setMain(stationArrivedEnterVO); + nodeFanoutMsg.setTenantId(AuthUtil.getTenantId()); + return nodeFanoutMsg; + + } + + public void stationArrivedEnter(NodeFanoutMsg nodeFanoutMsg, BladeUser user) { + try { + rabbitTemplate.convertAndSend(FanoutConstants.trunkline.StationArrivedEnter.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg)); + } catch (AmqpException e) { + log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 站点卸车确认消息推送失败~ 请联系管理员! ", e); + } + } } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/SendFanoutServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/SendFanoutServiceImpl.java index 927a5d3a8..116428460 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/SendFanoutServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/SendFanoutServiceImpl.java @@ -3,7 +3,11 @@ package com.logpm.trunkline.service.impl; import com.logpm.trunkline.service.ISendFanoutService; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springblade.common.constant.broadcast.FanoutConstants; import org.springblade.common.model.FanoutMsg; +import org.springblade.common.model.NodeFanoutMsg; +import org.springblade.core.secure.BladeUser; +import org.springframework.amqp.AmqpException; import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.retry.annotation.Backoff; import org.springframework.retry.annotation.Retryable; @@ -20,7 +24,9 @@ public class SendFanoutServiceImpl implements ISendFanoutService { @Override public void sendFanoutMsg(FanoutMsg fanoutMsg) { - rabbitTemplate.convertAndSend(fanoutMsg.getExchange(),null, fanoutMsg.getMsg()); + rabbitTemplate.convertAndSend(fanoutMsg.getExchange(), null, fanoutMsg.getMsg()); } + + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java index ac8400248..b08d2968d 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java @@ -509,4 +509,8 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl loadCarsPageList(LoadCarsDTO loadCarsDTO) { @@ -1461,22 +1462,22 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl scanIds = carsLoadScanEntityList.stream().map(TrunklineCarsLoadScanEntity::getId).collect(Collectors.toList()); - List zeroDetailVOList = scanZeroDetailService.findListByCarsLoadScanIds(scanIds); +// List scanIds = carsLoadScanEntityList.stream().map(TrunklineCarsLoadScanEntity::getId).collect(Collectors.toList()); +// List zeroDetailVOList = scanZeroDetailService.findListByCarsLoadScanIds(scanIds); //把zeroDetailVOList中所有元素通过scanId进行分组 - Map> mapByScanId = zeroDetailVOList.stream() - .collect(Collectors.groupingBy(TrunklineScanZeroDetailVO::getScanId)); - - - carsLoadScanEntityList.forEach(carsLoadScanEntity -> { +// Map> mapByScanId = zeroDetailVOList.stream() +// .collect(Collectors.groupingBy(TrunklineScanZeroDetailVO::getScanId)); - Long scanId = carsLoadScanEntity.getId(); - - List list = mapByScanId.get(scanId); - //TODO 暂时注释 -// carsLoadAsyncService.sendReportZeroPackageUnloadData(AuthUtil.getUserId(), AuthUtil.getNickName(), warehouseId, warehouseEntity.getName(),list,carsLoadScanEntity,carsLoadEntity); - }); +// carsLoadScanEntityList.forEach(carsLoadScanEntity -> { +// +//// Long scanId = carsLoadScanEntity.getId(); +// +//// List list = mapByScanId.get(scanId); +// //TODO 暂时注释 +//// carsLoadAsyncService.sendReportZeroPackageUnloadData(AuthUtil.getUserId(), AuthUtil.getNickName(), warehouseId, warehouseEntity.getName(),list,carsLoadScanEntity,carsLoadEntity); +// +// }); } @@ -1498,17 +1499,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl map = new HashMap<>(); - map.put("messageId", CommonUtil.getUUID()); - map.put("messageData", jsonObject); - map.put("createTime", System.currentTimeMillis()); - map.put("flagType", "TrunklineUnloadConfirm"); - rabbitTemplate.convertAndSend(RabbitConstant.TRUNKLINE_UNLOAD_CONFIRM_EXCHANGE, RabbitConstant.TRUNKLINE_UNLOAD_CONFIRM_ROUTING, map); +// JSONObject jsonObject = new JSONObject(); +// jsonObject.put("loadId", loadId); +// jsonObject.put("carsNo", carsLoadEntity.getCarsNo()); +// jsonObject.put("warehouseId", warehouseId); +// +// Map map = new HashMap<>(); +// map.put("messageId", CommonUtil.getUUID()); +// map.put("messageData", jsonObject); +// map.put("createTime", System.currentTimeMillis()); +// map.put("flagType", "TrunklineUnloadConfirm"); +// rabbitTemplate.convertAndSend(RabbitConstant.TRUNKLINE_UNLOAD_CONFIRM_EXCHANGE, RabbitConstant.TRUNKLINE_UNLOAD_CONFIRM_ROUTING, map); try { List brands = this.baseMapper.fingPackageCodeByLoadId(loadId, warehouseId); @@ -1518,8 +1519,20 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl