Browse Source

add:1.增加车次协和完成作业节点事件,根据事件判断是否生成对应车次的成本外请结算数据

2.增加外请成本结算列表
pre-production
pref_mail@163.com 3 months ago
parent
commit
499952af42
  1. 4
      blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java
  2. 19
      blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java
  3. 114
      blade-biz-common/src/main/java/org/springblade/common/model/workNode/StationArrivedByLineStationVO.java
  4. 91
      blade-biz-common/src/main/java/org/springblade/common/model/workNode/StationArrivedEnterVO.java
  5. 219
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/TrunklineCarCostEntity.java
  6. 6
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/vo/TrunklineCarCostVO.java
  7. 4
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadEntity.java
  8. 55
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/TrunklineCarCostController.java
  9. 132
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/StationArrivedEnterListener.java
  10. 9
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/TrunklineCarCostMapper.java
  11. 6
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/TrunklineCarCostMapper.xml
  12. 8
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/ITrunklineCarCostService.java
  13. 32
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/TrunklineCarCostServiceImpl.java
  14. 14
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/config/RabbitMqConfiguration.java
  15. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java
  16. 6
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
  17. 9
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java
  18. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ISendFanoutService.java
  19. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java
  20. 137
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java
  21. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/SendFanoutServiceImpl.java
  22. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java
  23. 71
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

4
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;

19
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;
}
}
}

114
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;
}

91
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<StationArrivedByLineStationVO> stationArrivedByLineStationVOS;
}

219
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;
}

6
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 {
}

4
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;
}

55
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<IPage<TrunklineCarCostEntity>> page(@ApiIgnore @RequestParam Map<String, Object> expenseDispatchPriceOverZone, Query query) {
IPage<TrunklineCarCostEntity> page = trunklineCarCostService.page(Condition.getPage(query), Condition.getQueryWrapper(expenseDispatchPriceOverZone, TrunklineCarCostEntity.class));
return R.data(page);
}
}

132
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<StationArrivedByLineStationVO> 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<StationArrivedByLineStationVO> 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;
}
}

9
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<TrunklineCarCostEntity> {
}

6
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/mapper/TrunklineCarCostMapper.xml

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.statistics.mapper.TrunklineCarCostMapper">
</mapper>

8
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> {
TrunklineCarCostEntity saveTrunklineCarCost(TrunklineCarCostEntity costEntity);
}

32
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<TrunklineCarCostMapper, TrunklineCarCostEntity> implements ITrunklineCarCostService {
@Override
public TrunklineCarCostEntity saveTrunklineCarCost(TrunklineCarCostEntity costEntity) {
// 需要判断该车次是否存在过结算信息
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("cars_no", costEntity.getCarsNo());
List<TrunklineCarCostEntity> list = baseMapper.selectList(queryWrapper);
if(!list.isEmpty()){
log.warn("该车次已创建结算单");
return list.get(0);
}
// 保存对象
save(costEntity);
return costEntity;
}
}

14
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<String, Object> 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() {

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

@ -203,4 +203,6 @@ public interface TrunklineCarsLoadScanMapper extends BaseMapper<TrunklineCarsLoa
void updateWaybillInfoByOrderPackageCodes(@Param("orderPackageCodeList") List<String> orderPackageCodeList, @Param("waybillId") Long waybillId, @Param("waybillNo") String waybillNo);
List<RetentionCarsLoadVO> findRetentionPackage(@Param("orderPackageCode") String orderPackageCode, @Param("warehouseId") Long warehouseId);
String findBrandNameByCarLoadCode(@Param("loadCode") String loadCode);
}

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

@ -1217,7 +1217,13 @@
and type = '1'
and scan_status = '1'
</select>
<select id="findBrandNameByCarLoadCode" resultType="java.lang.String">
SELECT GROUP_CONCAT(DISTINCT lww.brand) brands from logpm_warehouse_waybill lww LEFT JOIN
logpm_trunkline_cars_load_scan ltcls on lww.id= ltcls.waybill_id
where ltcls.load_code=#{loadCode} GROUP BY lww.brand
</select>
</mapper>

9
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<String> orderPackageCodeList);
void sendReportZeroPackageSignData(Long userId, String nickName, Long warehouseId, String warehouseName, List<TrunklineScanZeroDetailEntity> updateScanZeroDetailList, TrunklineCarsLoadScanEntity carsLoadScanEntity, TrunklineCarsLoadEntity carsLoadEntity);
/**
* 站点卸车完成消息推送
* @param user
*/
void sendStationArrivedEnter(TrunklineCarsLoadEntity carsLoadEntity, String brands,BladeUser user, BasicdataWarehouseEntity warehouseEntity);
}

4
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);
}

7
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java

@ -206,4 +206,11 @@ public interface ITrunklineCarsLoadScanService extends BaseService<TrunklineCars
List<RetentionCarsLoadVO> findRetentionPackage(String orderPackageCode, Long warehouseId);
/**
* 根据车次号查询车上运输的品牌
* @param loadCode 干线车次号
* @return
*/
String findBrandNameByCarLoadCode(String loadCode);
}

137
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<AftersalesAbnormalRecordEntity> abnormalRecordEntities1 = aftersalesAbnormalRecordEntities.stream().filter(abnormalRecordEntity -> abnormalRecordEntity.getIsZero() == 1).collect(Collectors.toList());
//把abnormalRecordEntities1中所有元素associationId放入一个集合
List<Long> associationIdList = abnormalRecordEntities1.stream().map(AftersalesAbnormalRecordEntity::getAssociationId).collect(Collectors.toList());
if(CollUtil.isNotEmpty(associationIdList)){
if (CollUtil.isNotEmpty(associationIdList)) {
List<TrunklineScanZeroDetailVO> scanZeroDetailVOList = trunklineScanZeroDetailService.findListByCarsLoadScanIds(associationIdList);
//把scanZeroDetailVOList所有元素通过scanId进行分组
Map<Long, List<TrunklineScanZeroDetailVO>> 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<String> 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<TrunklineCarsLoadLineEntity> list = trunklineCarsLoadLineService.findListByLoadId(carsLoadEntity.getId());
NodeFanoutMsg<StationArrivedEnterVO> stationArrivedEnterVONodeFanoutMsg = buildNodeFanoutMsgForStationArrivedEnter(carsLoadEntity,brands, list, user, warehouseEntity);
stationArrivedEnter(stationArrivedEnterVONodeFanoutMsg, user);
}
private NodeFanoutMsg<StationArrivedEnterVO> buildNodeFanoutMsgForStationArrivedEnter(TrunklineCarsLoadEntity carsLoadEntity,String brands, List<TrunklineCarsLoadLineEntity> lineList, BladeUser user, BasicdataWarehouseEntity warehouseEntity) {
NodeFanoutMsg<StationArrivedEnterVO> nodeFanoutMsg = new NodeFanoutMsg<StationArrivedEnterVO>();
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<StationArrivedByLineStationVO> 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<StationArrivedEnterVO> nodeFanoutMsg, BladeUser user) {
try {
rabbitTemplate.convertAndSend(FanoutConstants.trunkline.StationArrivedEnter.EXCHANGE, null, com.alibaba.fastjson.JSONObject.toJSONString(nodeFanoutMsg));
} catch (AmqpException e) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 站点卸车确认消息推送失败~ 请联系管理员! ", e);
}
}
}

8
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());
}
}

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java

@ -509,4 +509,8 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl<TrunklineC
return baseMapper.findRetentionPackage(orderPackageCode,warehouseId);
}
@Override
public String findBrandNameByCarLoadCode(String loadCode) {
return baseMapper.findBrandNameByCarLoadCode(loadCode);
}
}

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

@ -55,12 +55,16 @@ import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.springblade.common.annotations.RepeatSubmit;
import org.springblade.common.constant.*;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.constant.carsload.CarsLoadLogTypeConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.model.FanoutMsg;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.utils.CommonUtil;
import org.springblade.common.utils.QRCodeUtil;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
@ -103,7 +107,6 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
private final IBasicdataCodeClient codeClient;
private final IWarehouseWaybillDetailClient warehouseWaybillDetailClient;
private final ITrunklineLoadSignOrderService trunklineLoadSignOrderService;
private final IBasicdataDriverArteryClient basicdataDriverArteryClient;
private final ITrunklineCarsSignLogService trunklineCarsSignLogService;
private final RabbitTemplate rabbitTemplate;
private final IInComingService inComingService;
@ -116,13 +119,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
private final ITrunklineCostShareRecordService trunklineCostShareRecordService;
private final IAftersalesAbnormalRecordClient abnormalRecordClient;
private final FactoryDataMessageSender factoryDataMessageSender;
private final IFactoryDataClient factoryDataClient;
private final IPackageTrackLogAsyncService packageTrackLogAsyncService;
private final IBasicdataDriverArteryClient driverArteryClient;
private final ITrunklineLoadSignPhotoService loadSignPhotoService;
private final ITrunklineWaybillPackageService waybillPackageService;
private final ITrunklinePackageTrackLogClient packageTrackLogClient;
private final IAftersalesWorkOrderClient aftersalesWorkOrderClient;
private final ITrunklineWaybillTrackService waybillTrackService;
private final ITrunklineScanZeroDetailService scanZeroDetailService;
@ -134,7 +135,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
private final IBasicMaterialClient basicMaterialClient;
private final IBasicdataBrandClient basicdataBrandClient;
private final IWarehouseConfigClient warehouseConfigClient;
private final ISendFanoutService sendFanoutService;
@Override
public IPage<TrunklineCarsLoadVO> loadCarsPageList(LoadCarsDTO loadCarsDTO) {
@ -1461,22 +1462,22 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//把carsLoadScanEntityList中所有id放入一个List
List<Long> scanIds = carsLoadScanEntityList.stream().map(TrunklineCarsLoadScanEntity::getId).collect(Collectors.toList());
List<TrunklineScanZeroDetailVO> zeroDetailVOList = scanZeroDetailService.findListByCarsLoadScanIds(scanIds);
// List<Long> scanIds = carsLoadScanEntityList.stream().map(TrunklineCarsLoadScanEntity::getId).collect(Collectors.toList());
// List<TrunklineScanZeroDetailVO> zeroDetailVOList = scanZeroDetailService.findListByCarsLoadScanIds(scanIds);
//把zeroDetailVOList中所有元素通过scanId进行分组
Map<Long, List<TrunklineScanZeroDetailVO>> mapByScanId = zeroDetailVOList.stream()
.collect(Collectors.groupingBy(TrunklineScanZeroDetailVO::getScanId));
carsLoadScanEntityList.forEach(carsLoadScanEntity -> {
// Map<Long, List<TrunklineScanZeroDetailVO>> mapByScanId = zeroDetailVOList.stream()
// .collect(Collectors.groupingBy(TrunklineScanZeroDetailVO::getScanId));
Long scanId = carsLoadScanEntity.getId();
List<TrunklineScanZeroDetailVO> 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<TrunklineScanZeroDetailVO> 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<TrunklineCarsL
}
//MQ卸车确认推送工厂
JSONObject jsonObject = new JSONObject();
jsonObject.put("loadId", loadId);
jsonObject.put("carsNo", carsLoadEntity.getCarsNo());
jsonObject.put("warehouseId", warehouseId);
Map<String, Object> 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<String, Object> 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<LoadScanBrandDTO> brands = this.baseMapper.fingPackageCodeByLoadId(loadId, warehouseId);
@ -1518,8 +1519,20 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
trunklineCarsLoadLineService.updateById(updateUnloadStatus);
String brands = trunklineCarsLoadScanService.findBrandNameByCarLoadCode(carsLoadEntity.getCarsNo());
// 发送卸车作业事件
carsLoadAsyncService.sendStationArrivedEnter(carsLoadEntity,brands, AuthUtil.getUser(), warehouseEntity);
}
@RepeatSubmit
@Transactional(rollbackFor = Exception.class)
@Override
@ -1550,6 +1563,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadEntity.setCostAllocationType("0");
carsLoadEntity.setIsAbnormal(0);
carsLoadEntity.setIsCustomer("2");
carsLoadEntity.setOutsideStation(carsLoadDTO.getOutsideStation());
boolean saveCarsLoad = save(carsLoadEntity);
if (!saveCarsLoad) {
log.warn("##############saveNew: 保存配载计划失败");
@ -2464,6 +2478,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadEntity.setDriverType(driverType);
carsLoadEntity.setOutDriverPerson(outDriverPerson);
carsLoadEntity.setLoadingType(loadingType);
carsLoadEntity.setOutsideStation(carsLoadDTO.getOutsideStation());
updateById(carsLoadEntity);
for (TrunklineCarsLoadLineDTO carsLoadLineDTO : removeCarsLoadLineList) {

Loading…
Cancel
Save