Browse Source

Merge remote-tracking branch 'origin/dist.1.2.0' into dist.1.2.0

# Conflicts:
#	blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
dist.1.3.0
汤建军 7 months ago
parent
commit
66ce782046
  1. 31
      blade-biz-common/src/main/java/org/springblade/common/model/ConsigneeArriveVO.java
  2. 5
      blade-biz-common/src/main/java/org/springblade/common/model/DistributionSignforVO.java
  3. 14
      blade-biz-common/src/main/java/org/springblade/common/model/DistributionTaskVO.java
  4. 41
      blade-biz-common/src/main/java/org/springblade/common/model/GAddressVo.java
  5. 2
      blade-biz-common/src/main/java/org/springblade/common/model/PlanDriverbindCarVO.java
  6. 25
      blade-biz-common/src/main/java/org/springblade/common/utils/GaoDeApiUtil.java
  7. 14
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/QualityDeliverEntity.java
  8. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java
  9. 14
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ConsigneeArriveReportListener.java
  10. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/LoadingReportListener.java
  11. 43
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/PlanReportListener.java
  12. 59
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverListener.java
  13. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReViewReportListener.java
  14. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/SignforReportListener.java
  15. 63
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/StockReportListener.java
  16. 50
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  17. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  18. 33
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  19. 16
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

31
blade-biz-common/src/main/java/org/springblade/common/model/ConsigneeArriveVO.java

@ -3,8 +3,6 @@ package org.springblade.common.model;
import lombok.Data;
import java.util.List;
/**
* 客户到达
*/
@ -31,6 +29,35 @@ public class ConsigneeArriveVO {
*/
private String reservationCode;
/**
*
*/
private String province;
/**
*
*/
private String city;
/**
*
*/
private String district;
/**
* 街道
*
*/
private String township;
/**
* 完整详细地址
*/
private String address;
/**
* 打卡坐标
*/
private String positioning;
}

5
blade-biz-common/src/main/java/org/springblade/common/model/DistributionSignforVO.java

@ -19,6 +19,11 @@ public class DistributionSignforVO implements Serializable {
*/
private String vehicleName;
/**
* 签收车次
*/
private String trainNumber;
/**
* 预约单号
*/

14
blade-biz-common/src/main/java/org/springblade/common/model/DistributionTaskVO.java

@ -12,20 +12,18 @@ import java.util.List;
public class DistributionTaskVO implements Serializable {
private Long id;
/** 配送种类 */
private String kind;
/** 配送时间 */
private String taskTime;
/** 车次 */
private String trainNumber;
/** 配送类型 */
private String type;
/** 配送公司 */
private String distributionCompany;
/**
* 司机名
*/
private String driverName;
/**
* 车牌号
*/
private String vehicleName;
/** 司机和车辆信息 */
private List<PlanDriverbindCarVO> planDriverbindCars;
/**

41
blade-biz-common/src/main/java/org/springblade/common/model/GAddressVo.java

@ -0,0 +1,41 @@
package org.springblade.common.model;
import lombok.Data;
/**
* 高德返回信息
*/
@Data
public class GAddressVo {
/**
*
*/
private String province;
/**
*
*/
private String city;
/**
*
*/
private String district;
/**
* 街道
*
*/
private String township;
/**
* 完整详细地址
*/
private String address;
/**
* 打卡坐标
*/
private String positioning;
}

2
blade-biz-common/src/main/java/org/springblade/common/model/PlanDriverbindCarVO.java

@ -7,8 +7,10 @@ import java.io.Serializable;
@Data
public class PlanDriverbindCarVO implements Serializable {
/** 司机 */
private String driverName;
/** 车牌 */
private String carPlate;
}

25
blade-biz-common/src/main/java/org/springblade/common/utils/GaoDeApiUtil.java

@ -2,6 +2,7 @@ package org.springblade.common.utils;
import com.alibaba.fastjson.JSONObject;
import org.springblade.common.model.GAddressVo;
import java.net.URL;
@ -16,8 +17,9 @@ public class GaoDeApiUtil {
* @param lat
* @return
*/
public static String getAdd(String positioning ){
public static GAddressVo getAdd(String positioning ){
//lat 小 log 大
GAddressVo gAddressVo = new GAddressVo();
//注意key是在高德/百度开放平台申请的key,高德地图具体获得key的步骤请查看网址:https://developer.amap.com/api/webservice/guide/create-project/get-key
//百度地图开放平台的网址:https://lbsyun.baidu.com/index.php 在该平台注册即可
String key = "40448f21dfc7a531e9db4c405d955bea";
@ -42,18 +44,31 @@ public class GaoDeApiUtil {
in.close();
//解析结果
JSONObject jsonObject = JSONObject.parseObject(res);
// logger.info(jsonObject.toJSONString());
// 这个是高德的
JSONObject jsonObject1 = jsonObject.getJSONObject("regeocode");
//// 这个是百度的
// JSONObject jsonObject1 = jsonObject.getJSONObject("result");
res =jsonObject1.getString("formatted_address");
JSONObject t = jsonObject1.getJSONObject("addressComponent");
gAddressVo.setProvince(t.getString("province"));
gAddressVo.setCity(t.getString("city"));
gAddressVo.setDistrict(t.getString("district"));
gAddressVo.setTownship(t.getString("township"));;
gAddressVo.setAddress(res);
gAddressVo.setPositioning(positioning);
} catch (Exception e) {
// logger.error("获取地址信息异常{}",e.getMessage());
return null;
}
System.out.println("通过API获取到具体位置:"+res);
return res;
return gAddressVo;
}
public static void main(String[] args) {
String pods ="104.185875,30.533806";
getAdd(pods);
}
}

14
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/QualityDeliverEntity.java

@ -144,9 +144,9 @@ public class QualityDeliverEntity extends TenantEntity {
@ApiModelProperty(value = "客户车次号")
private String trainNumber;
/**
* 数据类型 1 定制品 2 库存品 3零担
* 数据类型 1 定制品 3 库存品 2零担
*/
@ApiModelProperty(value = "数据类型 1 定制品 2 库存品 3零担")
@ApiModelProperty(value = "数据类型 1 定制品 3 库存品 2零担")
private Integer conditions;
/**
* 一级品
@ -389,6 +389,16 @@ public class QualityDeliverEntity extends TenantEntity {
*/
@ApiModelProperty(value = "到达区/县")
private String arriveDistrict;
/**
* 到达街道
*/
@ApiModelProperty(value = "到达街道")
private String arriveTownship;
/**
* 到达打卡经纬度
*/
@ApiModelProperty(value = "到达打卡经纬度")
private String arrivePositioning;
/**
* 到达地址
*/

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java

@ -43,6 +43,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.model.GAddressVo;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.utils.GaoDeApiUtil;
import org.springblade.core.boot.ctrl.BladeController;
@ -287,8 +288,8 @@ public class DistributionSignforController extends BladeController {
@ApiOperationSupport(order = 3)
@ApiOperation(value = "分页", notes = "传入distributionSignfor")
public R<?> getLocationAddress(String positioning) {
String address = GaoDeApiUtil.getAdd(positioning);
return R.data(address);
GAddressVo address = GaoDeApiUtil.getAdd(positioning);
return R.data(address.getAddress());
}
/**

14
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ConsigneeArriveReportListener.java

@ -57,12 +57,18 @@ public class ConsigneeArriveReportListener {
Object main = bean.getMain();
JSONObject entries = JSONUtil.parseObj(main);
ConsigneeArriveVO vo = JSONUtil.toBean(entries, ConsigneeArriveVO.class);
Long warehouseId = bean.getWarehouseId();
BizOperationEnums bizOperation = bean.getBizOperation();
if (BizOperationEnums.DELETE.equals(bizOperation)) {
LambdaUpdateWrapper<QualityDeliverEntity> wrapper = Wrappers.<QualityDeliverEntity>lambdaUpdate()
.set(QualityDeliverEntity::getArriveCarUserName, null)
.set(QualityDeliverEntity::getArriveCarTime, null)
.set(QualityDeliverEntity::getArriveProvince, null)
.set(QualityDeliverEntity::getArriveCity, null)
.set(QualityDeliverEntity::getArriveDistrict, null)
.set(QualityDeliverEntity::getArriveTownship, null)
.set(QualityDeliverEntity::getArriveAddress, null)
.set(QualityDeliverEntity::getArrivePositioning, null)
.eq(QualityDeliverEntity::getLoadLicensePlate, vo.getVehicleName())
.eq(QualityDeliverEntity::getLoadTrainNumber, vo.getTrainNumber())
.eq(QualityDeliverEntity::getPlanReservationCode, vo.getReservationCode())
.ne(QualityDeliverEntity::getBizStatus, 110);
@ -72,6 +78,12 @@ public class ConsigneeArriveReportListener {
LambdaUpdateWrapper<QualityDeliverEntity> wrapper = Wrappers.<QualityDeliverEntity>lambdaUpdate()
.set(QualityDeliverEntity::getArriveCarUserName, vo.getDriverName())
.set(QualityDeliverEntity::getArriveCarTime, bean.getOperatorTime())
.set(QualityDeliverEntity::getArriveProvince, vo.getProvince())
.set(QualityDeliverEntity::getArriveCity, vo.getCity())
.set(QualityDeliverEntity::getArriveDistrict, vo.getDistrict())
.set(QualityDeliverEntity::getArriveTownship, vo.getTownship())
.set(QualityDeliverEntity::getArriveAddress, vo.getAddress())
.set(QualityDeliverEntity::getArrivePositioning, vo.getPositioning())
.eq(QualityDeliverEntity::getLoadTrainNumber, vo.getTrainNumber())
.eq(QualityDeliverEntity::getPlanReservationCode, vo.getReservationCode())
.ne(QualityDeliverEntity::getBizStatus, 110);

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/LoadingReportListener.java

@ -52,7 +52,7 @@ public class LoadingReportListener {
))
@Transactional(rollbackFor = Exception.class)
public void buildReport(String msg) {
log.info("备货生成明细报表: {}", msg);
log.info("装车生成明细报表: {}", msg);
if (StrUtil.isEmpty(msg)) {
return;
}

43
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/PlanReportListener.java

@ -22,6 +22,7 @@ import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.common.model.DistributionTaskVO;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.model.PackageData;
import org.springblade.common.model.PlanDriverbindCarVO;
import org.springblade.common.model.ReservationVO;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
@ -32,7 +33,8 @@ import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
* 配送计划生成明细报表
@ -56,7 +58,7 @@ public class PlanReportListener {
))
@Transactional(rollbackFor = Exception.class)
public void buildReport(String msg) {
log.info("预约计划生成明细报表: {}", msg);
log.info("配送计划生成明细报表: {}", msg);
if (StrUtil.isEmpty(msg)) {
return;
}
@ -68,6 +70,15 @@ public class PlanReportListener {
BizOperationEnums bizOperation = bean.getBizOperation();
List<ReservationVO> reservationVOList = vo.getReservationVOList();
if (CollUtil.isNotEmpty(reservationVOList)) {
List<PlanDriverbindCarVO> planDriverbindCars = vo.getPlanDriverbindCars();
String vehicleName = "";
String driverName = "";
if(CollUtil.isNotEmpty(planDriverbindCars)){
// 用逗号拼接 车辆和司机
vehicleName = planDriverbindCars.stream().map(PlanDriverbindCarVO::getCarPlate).collect(Collectors.joining(","));
driverName = planDriverbindCars.stream().map(PlanDriverbindCarVO::getDriverName).collect(Collectors.joining(","));
}
Map<String, QualityDeliverEntity> invMap = new HashMap<>();
for (ReservationVO reservationVO : reservationVOList) {
List<PackageData> details = reservationVO.getPackageDataList();
if (BizOperationEnums.MODIFY.equals(bizOperation) || BizOperationEnums.DELETE.equals(bizOperation)) {
@ -83,6 +94,7 @@ public class PlanReportListener {
.set(QualityDeliverEntity::getDeliveryPlanTime, null)
.set(QualityDeliverEntity::getDeliveryCreateUserName, null)
.eq(QualityDeliverEntity::getPlanTrainNumber, vo.getTrainNumber())
.eq(QualityDeliverEntity::getPlanReservationCode, reservationVO.getReservationCode())
.ne(QualityDeliverEntity::getBizStatus, 110);
qualityDeliverService.update(wrapper);
}
@ -96,8 +108,8 @@ public class PlanReportListener {
.deliveryTime(DateUtil.parseDate(vo.getTaskTime()))
.deliveryType(vo.getType())
.deliveryKind(vo.getKind())
.vehicleName(vo.getVehicleName())
.driverName(vo.getDriverName())
.vehicleName(vehicleName)
.driverName(driverName)
.distributionCompany(vo.getDistributionCompany())
.deliveryPlanTime(bean.getOperatorTime())
.deliveryCreateUserName(bean.getOperator())
@ -130,25 +142,32 @@ public class PlanReportListener {
.build());
}
} else if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.INV)) {
invMap.put(detail.getMallName()+detail.getMaterialCode(), qualityDeliverEntity);
qualityDeliverEntity.setPlanReservationCode(reservationVO.getReservationCode());
qualityDeliverEntity.setIncomingBatch(detail.getPickupBatch());
qualityDeliverEntity.setMallName(detail.getMallName());
qualityDeliverEntity.setMaterielCode(detail.getMaterialCode());
qualityDeliverEntity.setMaterielName(detail.getMaterialName());
qualityDeliverEntity.setConditions(3);
qualityDeliverEntity.setPlanNum(detail.getNumber());
qualityDeliverEntity.setPlanNum(1);
if (BizOperationEnums.ADD.equals(bizOperation) || BizOperationEnums.MODIFY.equals(bizOperation)) {
ReportQualityDeliverDTO dto = ReportQualityDeliverDTO.builder().data(JSONUtil.toJsonStr(qualityDeliverEntity)).operation(BizOperationEnums.MODIFY).build();
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE)
.routingKey(ReportConstants.REPORT_QUALITY_DELIVER_ROUTINGKEY)
.message(JSONUtil.toJsonStr(dto))
.delay(3000)
.build());
invMap.put(detail.getMallName()+detail.getMaterialCode(), qualityDeliverEntity);
}
}
}
}
}
if (CollUtil.isNotEmpty(invMap)) {
for (Map.Entry<String, QualityDeliverEntity> entry : invMap.entrySet()) {
QualityDeliverEntity qualityDeliverEntity = entry.getValue();
qualityDeliverService.update(qualityDeliverEntity, Wrappers.<QualityDeliverEntity>lambdaUpdate()
.eq(QualityDeliverEntity::getPlanReservationCode,qualityDeliverEntity.getPlanReservationCode())
.eq(QualityDeliverEntity::getMallName,qualityDeliverEntity.getMallName())
.eq(QualityDeliverEntity::getMaterielCode,qualityDeliverEntity.getMaterielCode())
.lt(QualityDeliverEntity::getBizStatus, 110)
);
}
}
}
}

59
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverListener.java

@ -4,7 +4,6 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.dto.ReportQualityDeliverDTO;
import com.logpm.distribution.entity.QualityDeliverEntity;
@ -41,7 +40,7 @@ public class QualityDeliverListener {
key = ReportConstants.REPORT_QUALITY_DELIVER_ROUTINGKEY
))
public void data(String msg) {
log.info("明细报表: {}", msg);
log.info("配送明细基础表处理: {}", msg);
if (StrUtil.isEmpty(msg)) {
return;
}
@ -52,6 +51,7 @@ public class QualityDeliverListener {
case MODIFY:
Integer conditions = qualityDeliverEntity.getConditions();
if (1 == conditions) {
// 定制品
QualityDeliverEntity entity = qualityDeliverService.getOne(Wrappers.<QualityDeliverEntity>lambdaQuery()
.eq(QualityDeliverEntity::getOrderPackageCode, qualityDeliverEntity.getOrderPackageCode())
.lt(QualityDeliverEntity::getBizStatus, 110));
@ -63,32 +63,57 @@ public class QualityDeliverListener {
// 获取基础数据赋值
qualityDeliverService.save(qualityDeliverEntity);
}
} else if (2 == conditions) {
QualityDeliverEntity entity = qualityDeliverService.getOne(Wrappers.<QualityDeliverEntity>lambdaQuery()
// .eq(QualityDeliverEntity::getIncomingBatch, qualityDeliverEntity.getIncomingBatch())
.eq(QualityDeliverEntity::getMallName, qualityDeliverEntity.getMallName())
.eq(QualityDeliverEntity::getMaterielCode, qualityDeliverEntity.getMaterielCode())
.lt(QualityDeliverEntity::getBizStatus, 110));
if (ObjectUtil.isNotEmpty(entity)) {
LambdaUpdateWrapper<QualityDeliverEntity> wrapper = Wrappers.<QualityDeliverEntity>lambdaUpdate()
.eq(QualityDeliverEntity::getIncomingBatch, qualityDeliverEntity.getIncomingBatch())
.eq(QualityDeliverEntity::getMallName, qualityDeliverEntity.getMallName())
.eq(QualityDeliverEntity::getMaterielCode, qualityDeliverEntity.getMaterielCode())
.lt(QualityDeliverEntity::getBizStatus, 110);
if(StrUtil.isNotEmpty(qualityDeliverEntity.getOrderPackageCode())){
} else if (3 == conditions) {
// 库存品
LambdaQueryWrapper<QualityDeliverEntity> wrapper = Wrappers.<QualityDeliverEntity>lambdaQuery()
.lt(QualityDeliverEntity::getBizStatus, 110);
if (ObjectUtil.isNotEmpty(qualityDeliverEntity.getId())) {
// 库存品更新优先按id更新
wrapper.eq(QualityDeliverEntity::getId, qualityDeliverEntity.getId());
} else {
if (StrUtil.isNotEmpty(qualityDeliverEntity.getOrderPackageCode())) {
// 没有id,按包条码更新
wrapper.eq(QualityDeliverEntity::getOrderPackageCode, qualityDeliverEntity.getOrderPackageCode());
} else {
if (StrUtil.isEmpty(qualityDeliverEntity.getMallName())) {
// 没有id,没有包条码。没有商场,不处理。
return;
} else {
// 否则加上商场过滤
wrapper.eq(QualityDeliverEntity::getMallName, qualityDeliverEntity.getMallName());
}
if (StrUtil.isEmpty(qualityDeliverEntity.getMaterielCode()) && StrUtil.isEmpty(qualityDeliverEntity.getMaterielName())) {
// 没有id,没有包条码,没有商场,没有物料,不处理。
return;
}
if (StrUtil.isNotEmpty(qualityDeliverEntity.getMaterielCode())) {
// 优先按物料编码更新
wrapper.eq(QualityDeliverEntity::getMaterielCode, qualityDeliverEntity.getMaterielCode());
} else {
// 按物料名称更新
wrapper.eq(QualityDeliverEntity::getMaterielName, qualityDeliverEntity.getMaterielName());
}
}
}
if (StrUtil.isNotEmpty(qualityDeliverEntity.getPlanReservationCode())) {
// 有预约单号时加上预约单号过滤:存在同一个库存品在多个预约单中,只根据库存品本身的信息无法查询出对应的数据的情况。
wrapper.eq(QualityDeliverEntity::getPlanReservationCode, qualityDeliverEntity.getPlanReservationCode());
}
// 查询不存在时更新,存在时修改
QualityDeliverEntity entity = qualityDeliverService.getOne(wrapper);
if (ObjectUtil.isNotEmpty(entity)) {
qualityDeliverService.update(qualityDeliverEntity, wrapper);
} else {
// 获取基础数据赋值
qualityDeliverService.save(qualityDeliverEntity);
}
} else if (3 == conditions) {
} else if (2 == conditions) {
// 零担
LambdaQueryWrapper<QualityDeliverEntity> wrapper = Wrappers.<QualityDeliverEntity>lambdaQuery()
.eq(QualityDeliverEntity::getOrderCode, qualityDeliverEntity.getOrderCode())
.eq(QualityDeliverEntity::getCostCategory, qualityDeliverEntity.getCostCategory())
.lt(QualityDeliverEntity::getBizStatus, 110);
if(StrUtil.isNotEmpty(qualityDeliverEntity.getPlanReservationCode())){
if (StrUtil.isNotEmpty(qualityDeliverEntity.getPlanReservationCode())) {
wrapper.eq(QualityDeliverEntity::getPlanReservationCode, qualityDeliverEntity.getPlanReservationCode());
}
QualityDeliverEntity entity = qualityDeliverService.getOne(wrapper);

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReViewReportListener.java

@ -63,16 +63,6 @@ public class ReViewReportListener {
Long warehouseId = bean.getWarehouseId();
BizOperationEnums bizOperation = bean.getBizOperation();
List<PackageData> details = vo.getPackageDataList();
// if (BizOperationEnums.MODIFY.equals(bizOperation) || BizOperationEnums.DELETE.equals(bizOperation)) {
// // 根据预约单号查询出所有这个预约单下的数据 先置空
// LambdaUpdateWrapper<QualityDeliverEntity> wrapper = Wrappers.<QualityDeliverEntity>lambdaUpdate()
// .set(QualityDeliverEntity::getLoadUserName, null)
// .set(QualityDeliverEntity::getLoadTime, null)
// .set(QualityDeliverEntity::getLoadLicensePlate, null)
// .set(QualityDeliverEntity::getLoadNum, null)
// .ne(QualityDeliverEntity::getBizStatus, 110);
// qualityDeliverService.update(wrapper);
// }
if (CollUtil.isNotEmpty(details)) {
for (PackageData detail : details) {
QualityDeliverEntity qualityDeliverEntity = QualityDeliverEntity.builder()
@ -81,6 +71,7 @@ public class ReViewReportListener {
.orderPackageCode(detail.getPackageCode())
.reviewUserName(bean.getOperator())
.reviewTime(bean.getOperatorTime())
.bizStatus(100)
.build();
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {
qualityDeliverEntity.setConditions(1);

13
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/SignforReportListener.java

@ -63,16 +63,6 @@ public class SignforReportListener {
Long warehouseId = bean.getWarehouseId();
BizOperationEnums bizOperation = bean.getBizOperation();
List<PackageData> details = vo.getPackageDataList();
// if (BizOperationEnums.MODIFY.equals(bizOperation) || BizOperationEnums.DELETE.equals(bizOperation)) {
// // 根据预约单号查询出所有这个预约单下的数据 先置空
// LambdaUpdateWrapper<QualityDeliverEntity> wrapper = Wrappers.<QualityDeliverEntity>lambdaUpdate()
// .set(QualityDeliverEntity::getLoadUserName, null)
// .set(QualityDeliverEntity::getLoadTime, null)
// .set(QualityDeliverEntity::getLoadLicensePlate, null)
// .set(QualityDeliverEntity::getLoadNum, null)
// .ne(QualityDeliverEntity::getBizStatus, 110);
// qualityDeliverService.update(wrapper);
// }
if (CollUtil.isNotEmpty(details)) {
for (PackageData detail : details) {
QualityDeliverEntity qualityDeliverEntity = QualityDeliverEntity.builder()
@ -82,6 +72,9 @@ public class SignforReportListener {
.signUserName(bean.getOperator())
.signTime(bean.getOperatorTime())
.signCarNumber(vo.getVehicleName())
.signTrainNumber(vo.getTrainNumber())
.signReservationCode(vo.getReservationCode())
.bizStatus(90)
.build();
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {
qualityDeliverEntity.setConditions(1);

63
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/StockReportListener.java

@ -5,7 +5,6 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.dto.ReportQualityDeliverDTO;
import com.logpm.distribution.entity.QualityDeliverEntity;
@ -67,19 +66,6 @@ public class StockReportListener {
BizOperationEnums bizOperation = bean.getBizOperation();
ReservationVO reservationVO = vo.getReservationVO();
List<PackageData> details = reservationVO.getPackageDataList();
if (BizOperationEnums.MODIFY.equals(bizOperation) || BizOperationEnums.DELETE.equals(bizOperation)) {
// 根据预约单号查询出所有这个预约单下的数据 先置空
LambdaUpdateWrapper<QualityDeliverEntity> wrapper = Wrappers.<QualityDeliverEntity>lambdaUpdate()
.set(QualityDeliverEntity::getStockupCode, null)
.set(QualityDeliverEntity::getStockupUserName, null)
.set(QualityDeliverEntity::getStockupFinishTime, null)
.set(QualityDeliverEntity::getStockNum, null)
.set(QualityDeliverEntity::getStockAllocation, null)
.set(QualityDeliverEntity::getStockupCreateTime, null)
.eq(QualityDeliverEntity::getStockupCode, vo.getStockupCode())
.ne(QualityDeliverEntity::getBizStatus, 110);
qualityDeliverService.update(wrapper);
}
if (CollUtil.isNotEmpty(details)) {
for (PackageData detail : details) {
QualityDeliverEntity qualityDeliverEntity = QualityDeliverEntity.builder()
@ -96,13 +82,7 @@ public class StockReportListener {
qualityDeliverEntity.setConditions(1);
qualityDeliverEntity.setStockNum(1);
if (BizOperationEnums.ADD.equals(bizOperation) || BizOperationEnums.MODIFY.equals(bizOperation)) {
ReportQualityDeliverDTO dto = ReportQualityDeliverDTO.builder().data(JSONUtil.toJsonStr(qualityDeliverEntity)).operation(BizOperationEnums.MODIFY).build();
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE)
.routingKey(ReportConstants.REPORT_QUALITY_DELIVER_ROUTINGKEY)
.message(JSONUtil.toJsonStr(dto))
.delay(3000)
.build());
sendReport(qualityDeliverEntity);
}
} else if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.LTL)) {
qualityDeliverEntity.setOrderCode(detail.getOrderCode());
@ -111,33 +91,44 @@ public class StockReportListener {
qualityDeliverEntity.setConditions(2);
qualityDeliverEntity.setStockNum(detail.getNumber());
if (BizOperationEnums.ADD.equals(bizOperation) || BizOperationEnums.MODIFY.equals(bizOperation)) {
ReportQualityDeliverDTO dto = ReportQualityDeliverDTO.builder().data(JSONUtil.toJsonStr(qualityDeliverEntity)).operation(BizOperationEnums.MODIFY).build();
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE)
.routingKey(ReportConstants.REPORT_QUALITY_DELIVER_ROUTINGKEY)
.message(JSONUtil.toJsonStr(dto))
.delay(3000)
.build());
sendReport(qualityDeliverEntity);
}
} else if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.INV)) {
qualityDeliverEntity.setPlanReservationCode(reservationVO.getReservationCode());
qualityDeliverEntity.setIncomingBatch(detail.getPickupBatch());
qualityDeliverEntity.setMallName(detail.getMallName());
qualityDeliverEntity.setMaterielCode(detail.getMaterialCode());
qualityDeliverEntity.setMaterielName(detail.getMaterialName());
qualityDeliverEntity.setConditions(3);
qualityDeliverEntity.setStockNum(detail.getNumber());
qualityDeliverEntity.setStockNum(1);
if (BizOperationEnums.ADD.equals(bizOperation) || BizOperationEnums.MODIFY.equals(bizOperation)) {
ReportQualityDeliverDTO dto = ReportQualityDeliverDTO.builder().data(JSONUtil.toJsonStr(qualityDeliverEntity)).operation(BizOperationEnums.MODIFY).build();
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE)
.routingKey(ReportConstants.REPORT_QUALITY_DELIVER_ROUTINGKEY)
.message(JSONUtil.toJsonStr(dto))
.delay(3000)
.build());
List<QualityDeliverEntity> list = qualityDeliverService.list(Wrappers.<QualityDeliverEntity>lambdaQuery()
.select(QualityDeliverEntity::getId)
.eq(QualityDeliverEntity::getPlanReservationCode, qualityDeliverEntity.getPlanReservationCode())
.eq(QualityDeliverEntity::getMallName, qualityDeliverEntity.getMallName())
.eq(QualityDeliverEntity::getMaterielCode, qualityDeliverEntity.getMaterielCode())
.isNull(QualityDeliverEntity::getOrderPackageCode)
.lt(QualityDeliverEntity::getBizStatus, 110)
.last(" limit 1")
);
if(CollUtil.isNotEmpty(list)){
qualityDeliverEntity.setId(list.get(0).getId());
sendReport(qualityDeliverEntity);
}
}
}
}
}
}
private void sendReport(QualityDeliverEntity qualityDeliverEntity) {
ReportQualityDeliverDTO dto = ReportQualityDeliverDTO.builder().data(JSONUtil.toJsonStr(qualityDeliverEntity)).operation(BizOperationEnums.MODIFY).build();
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE)
.routingKey(ReportConstants.REPORT_QUALITY_DELIVER_ROUTINGKEY)
.message(JSONUtil.toJsonStr(dto))
.delay(3000)
.build());
}
}

50
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -29,7 +29,9 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO;
import com.logpm.basic.entity.BasicMaterialEntity;
import com.logpm.basic.entity.BasicPrintTemplateEntity;
import com.logpm.basic.feign.IBasicMaterialClient;
import com.logpm.basic.feign.IBasicPrintTemplateClient;
import com.logpm.basicdata.entity.BasicdataDriverArteryEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
@ -278,6 +280,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Autowired
private IBasicdataDriverArteryClient basicdataDriverArteryClient;
@Autowired
private IBasicMaterialClient basicMaterialClient;
@Override
public IPage<DistributionDeliveryListEntity> selectDistributionDeliveryListPage(IPage<DistributionDeliveryListEntity> page, DistributionDeliveryListDTO distributionDeliveryList) {
//转换创建时间
@ -1111,7 +1116,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
nodeFanoutMsg.setNode(WorkNodeEnums.DISTRIBUTION_LOADING);
nodeFanoutMsg.setWarehouse(distributionDeliveryListEntity.getWarehouseName());
nodeFanoutMsg.setWarehouseId(distributionDeliveryListEntity.getWarehouseId());
nodeFanoutMsg.setOperator(AuthUtil.getTenantId());
nodeFanoutMsg.setOperator(AuthUtil.getNickName());
nodeFanoutMsg.setOperatorTime(distributionDeliveryListEntity.getUpdateTime());
// DistributionTaskVO taskVO = buildDistributionTaskVO(distributionDeliveryListEntity, AuthUtil.getUserId());
@ -1123,7 +1128,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
String vehicleName = distributionDeliveryListEntity.getVehicleName();
// 如果是自主配送 需要去获取当前司机绑定的车牌
if ("1".equals(distributionDeliveryListEntity.getKind())) {
BasicdataDriverArteryEntity driverArteryById = basicdataDriverArteryClient.getDriverArteryById(AuthUtil.getUserId());
BasicdataDriverArteryEntity driverArteryById = basicdataDriverArteryClient.getDriverArtery(AuthUtil.getUserId());
if (driverArteryById != null) {
for (int i = 0; i < planDriverbindCarVOS.size(); i++) {
@ -1137,6 +1142,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
distributionLoadVO.setDriverName(driverName);
distributionLoadVO.setVehicleName(vehicleName);
distributionLoadVO.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
nodeFanoutMsg.setMain(distributionLoadVO);
@ -1200,7 +1206,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
nodeFanoutMsg.setNode(WorkNodeEnums.DISTRIBUTION_LOADING);
nodeFanoutMsg.setWarehouse(distributionDeliveryListEntity.getWarehouseName());
nodeFanoutMsg.setWarehouseId(distributionDeliveryListEntity.getWarehouseId());
nodeFanoutMsg.setOperator(AuthUtil.getTenantId());
nodeFanoutMsg.setOperator(AuthUtil.getNickName());
nodeFanoutMsg.setOperatorTime(distributionDeliveryListEntity.getCreateTime());
// DistributionTaskVO taskVO = buildDistributionTaskVO(distributionDeliveryListEntity, AuthUtil.getUserId());
@ -1213,7 +1219,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
String vehicleName = distributionDeliveryListEntity.getVehicleName();
// 如果是自主配送 需要去获取当前司机绑定的车牌
if ("1".equals(distributionDeliveryListEntity.getKind())) {
BasicdataDriverArteryEntity driverArteryById = basicdataDriverArteryClient.getDriverArteryById(AuthUtil.getUserId());
BasicdataDriverArteryEntity driverArteryById = basicdataDriverArteryClient.getDriverArtery(AuthUtil.getUserId());
if (driverArteryById != null) {
for (int i = 0; i < planDriverbindCarVOS.size(); i++) {
@ -1227,6 +1233,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
distributionLoadVO.setDriverName(driverName);
distributionLoadVO.setVehicleName(vehicleName);
distributionLoadVO.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
List<PackageData> data = new ArrayList<>();
for (DistributionLoadscaninvnEntity distributionParcelListEntity : ts) {
@ -1250,7 +1257,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
packageData.setBrand(stockListEntity.getBrandName());
packageData.setPackageCode(stockEntity.getOrderPackageCode());
packageData.setMallName(stockListEntity.getMallName());
packageData.setMaterialCode(stockListEntity.getMarketCode());
BasicMaterialEntity materialOwnId = basicMaterialClient.getMaterialOwnId(stockListEntity.getMaterialId());
if(materialOwnId!=null){
packageData.setMaterialCode(materialOwnId.getProductCode());
}
packageData.setMaterialName(stockListEntity.getDescriptionGoods());
packageData.setOrderCode(stockListEntity.getOrderCode());
packageData.setPackageType(PackageTypeEnums.INV);
@ -3568,7 +3579,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
nodeFanoutMsg.setNode(WorkNodeEnums.PLAN_DELIVERY);
nodeFanoutMsg.setWarehouse(distributionDeliveryListEntity.getWarehouseName());
nodeFanoutMsg.setWarehouseId(distributionDeliveryListEntity.getWarehouseId());
nodeFanoutMsg.setOperator(user.getTenantId());
nodeFanoutMsg.setOperator(user.getNickName());
nodeFanoutMsg.setOperatorTime(distributionDeliveryListEntity.getCreateTime());
DistributionTaskVO distributionTaskVO = getDistributionTaskVO(distributionDeliveryListEntity);
List<PlanDriverbindCarVO> planDriverbindCarVOS = buildDeliveryCarDriverInfor(distributionDeliveryListEntity);
@ -4822,7 +4833,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
nodeFanoutMsg.setNode(WorkNodeEnums.DISTRIBUTION_CAR_START);
nodeFanoutMsg.setWarehouse(distributionDeliveryListEntity.getWarehouseName());
nodeFanoutMsg.setWarehouseId(distributionDeliveryListEntity.getWarehouseId());
nodeFanoutMsg.setOperator(AuthUtil.getTenantId());
nodeFanoutMsg.setOperator(AuthUtil.getNickName());
nodeFanoutMsg.setOperatorTime(distributionDeliveryListEntity.getUpdateTime());
List<PlanDriverbindCarVO> planDriverbindCarVOS = buildDeliveryCarDriverInfor(distributionDeliveryListEntity);
@ -4830,7 +4841,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
String vehicleName = distributionDeliveryListEntity.getVehicleName();
// 如果是自主配送 需要去获取当前司机绑定的车牌
if ("1".equals(distributionDeliveryListEntity.getKind())) {
BasicdataDriverArteryEntity driverArteryById = basicdataDriverArteryClient.getDriverArteryById(AuthUtil.getUserId());
BasicdataDriverArteryEntity driverArteryById = basicdataDriverArteryClient.getDriverArtery(AuthUtil.getUserId());
if (driverArteryById != null) {
for (int i = 0; i < planDriverbindCarVOS.size(); i++) {
@ -6235,8 +6246,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
nodeFanoutMsg.setNode(WorkNodeEnums.DISTRIBUTION_LOADING);
nodeFanoutMsg.setWarehouse(distributionDeliveryListEntity.getWarehouseName());
nodeFanoutMsg.setWarehouseId(distributionDeliveryListEntity.getWarehouseId());
nodeFanoutMsg.setOperator(AuthUtil.getTenantId());
nodeFanoutMsg.setOperatorTime(distributionDeliveryListEntity.getCreateTime());
nodeFanoutMsg.setOperator(AuthUtil.getNickName());
nodeFanoutMsg.setOperatorTime(new Date());
// DistributionTaskVO taskVO = buildDistributionTaskVO(distributionDeliveryListEntity, AuthUtil.getUserId());
@ -6248,7 +6259,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
String vehicleName = distributionDeliveryListEntity.getVehicleName();
// 如果是自主配送 需要去获取当前司机绑定的车牌
if ("1".equals(distributionDeliveryListEntity.getKind())) {
BasicdataDriverArteryEntity driverArteryById = basicdataDriverArteryClient.getDriverArteryById(AuthUtil.getUserId());
BasicdataDriverArteryEntity driverArteryById = basicdataDriverArteryClient.getDriverArtery(AuthUtil.getUserId());
if (driverArteryById != null) {
for (int i = 0; i < planDriverbindCarVOS.size(); i++) {
@ -8379,8 +8390,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (!broadcastDataByArticles.isEmpty()) {
broadcastDataByArticles.forEach(map -> {
DistributionReservationEntity reservationEntity = new DistributionReservationEntity();
reservationEntity.setId(Long.parseLong(map.get("reservationId").toString()));
DistributionReservationEntity reservationEntity = distributionReservationService.getById(map.get("reservationId").toString());
ReservationVO reservationVO = checkListForReservationVO(data, reservationEntity);
List<PackageData> packageDataList = reservationVO.getPackageDataList();
@ -8404,8 +8416,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (!broadcastDataByStock.isEmpty()) {
for (Map<String, Object> map : broadcastDataByStock) {
DistributionReservationEntity reservationEntity = new DistributionReservationEntity();
reservationEntity.setId(Long.parseLong(map.get("reservationId").toString()));
DistributionReservationEntity reservationEntity = distributionReservationService.getById(map.get("reservationId").toString());
ReservationVO reservationVO = checkListForReservationVO(data, reservationEntity);
List<PackageData> packageDataList = reservationVO.getPackageDataList();
@ -8426,8 +8438,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<Map<String, Object>> broadcastDataByZeroOrder = baseMapper.getBroadcastDataByZeroOrder(id, warehouseId);
if (!broadcastDataByZeroOrder.isEmpty()) {
broadcastDataByZeroOrder.forEach(map -> {
DistributionReservationEntity reservationEntity = new DistributionReservationEntity();
reservationEntity.setId(Long.parseLong(map.get("reservationId").toString()));
DistributionReservationEntity reservationEntity = distributionReservationService.getById(map.get("reservationId").toString());
ReservationVO reservationVO = checkListForReservationVO(data, reservationEntity);
List<PackageData> packageDataList = reservationVO.getPackageDataList();
@ -8465,13 +8477,15 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
ReservationVO temp = null;
for (ReservationVO reservationVO : data) {
if (reservationVO.getReservationCode().equals(reservationEntity.getReservationCode())) {
if (reservationVO.getId().equals(reservationEntity.getId())) {
temp = reservationVO;
break;
}
}
if(temp==null){
temp=distributionReservationService.getReservationVO(reservationEntity);
data.add(temp);
}
return temp;

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -2075,8 +2075,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
// Long reservationStocklistEntityId = distributionReservationStocklistEntity.getId();
// Long reservationId = distributionReservationStocklistEntity.getReservationId();
}else {
oleInventoryList.remove(c);
allStockListEntityList.add(oleInventoryList.get(c).get(0));
oleInventoryList.remove(c);
}
//比较库存品之间的数据
}

33
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -735,7 +735,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
nodeFanoutMsg.setNode(WorkNodeEnums.CLERK_REVIEW);
nodeFanoutMsg.setWarehouse(reservationEntity.getWarehouseName());
nodeFanoutMsg.setWarehouseId(reservationEntity.getWarehouseId());
nodeFanoutMsg.setOperator(AuthUtil.getTenantId());
nodeFanoutMsg.setOperator(AuthUtil.getNickName());
nodeFanoutMsg.setOperatorTime(reservationEntity.getUpdateTime());
// DistributionTaskVO taskVO = buildDistributionTaskVO(distributionDeliveryListEntity, AuthUtil.getUserId());
@ -2930,7 +2930,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
nodeFanoutMsg.setNode(WorkNodeEnums.DISTRIBUTION_SIGN_FOR);
nodeFanoutMsg.setWarehouse(distributionDeliveryListEntity.getWarehouseName());
nodeFanoutMsg.setWarehouseId(distributionDeliveryListEntity.getWarehouseId());
nodeFanoutMsg.setOperator(AuthUtil.getTenantId());
nodeFanoutMsg.setOperator(AuthUtil.getNickName());
nodeFanoutMsg.setOperatorTime(distributionDeliveryListEntity.getUpdateTime());
// DistributionTaskVO taskVO = buildDistributionTaskVO(distributionDeliveryListEntity, AuthUtil.getUserId());
@ -2954,8 +2954,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (Func.isNotEmpty(byIds)) {
packageData.setPackageCode(distributionParcelListEntity.getOrderPackageCode());
packageData.setBrand(byIds.getBrandName());
packageData.setMallName(StringUtil.isBlank(byIds.getMallName()) ? byIds.getMarketName() : byIds.getMallName());
packageData.setMallName(StringUtil.isBlank(byIds.getMallName())? byIds.getMarketName():byIds.getMallName());
// packageData.setProductName(byId.getDescriptionGoods());
packageData.setMaterialCode(byIds.getCargoNumber());
packageData.setMaterialName(byIds.getDescriptionGoods());
@ -2964,6 +2963,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
packageData.setNumber(1);
data.add(packageData);
}
@ -2981,7 +2981,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
nodeFanoutMsg.setNode(WorkNodeEnums.DISTRIBUTION_SIGN_FOR);
nodeFanoutMsg.setWarehouse(distributionDeliveryListEntity.getWarehouseName());
nodeFanoutMsg.setWarehouseId(distributionDeliveryListEntity.getWarehouseId());
nodeFanoutMsg.setOperator(AuthUtil.getTenantId());
nodeFanoutMsg.setOperator(AuthUtil.getNickName());
nodeFanoutMsg.setOperatorTime(distributionDeliveryListEntity.getUpdateTime());
// DistributionTaskVO taskVO = buildDistributionTaskVO(distributionDeliveryListEntity, AuthUtil.getUserId());
@ -2991,6 +2991,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadVO.setDriverName(distributionLoadscanEntity.getDriverName());
distributionLoadVO.setVehicleName(distributionLoadscanEntity.getVehicleName());
distributionLoadVO.setReservationCode(distributionReservationEntity.getReservationCode());
distributionLoadVO.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
List<PackageData> data = new ArrayList<>();
@ -4681,26 +4682,26 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return Resp.scanSuccess("已打卡", "已打卡");
}
String positioning = distributionSignfor.getPositioning();
String add = GaoDeApiUtil.getAdd(positioning);
GAddressVo add =GaoDeApiUtil.getAdd(positioning);
boolean update = this.update(new UpdateWrapper<DistributionSignforEntity>().lambda()
.eq(DistributionSignforEntity::getReservationId, distributionSignfor.getReservationId())
.eq(DistributionSignforEntity::getDeliveryId, distributionSignfor.getDeliveryId())
.set(StringUtils.isNotBlank(distributionSignfor.getPositioning()), DistributionSignforEntity::getPositioning, distributionSignfor.getPositioning())
.set(StringUtils.isNotBlank(add), DistributionSignforEntity::getPositioningAdr, add)
.set(StringUtils.isNotBlank(add.getAddress()), DistributionSignforEntity::getPositioningAdr, add.getAddress())
);
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(distributionSignforEntity.getDeliveryId());
DistributionReservationEntity reservationEntity = distributionReservationService.getById(deliveryListEntity.getReservationId());
DistributionReservationEntity reservationEntity = distributionReservationService.getById(distributionSignforEntity.getReservationId());
BladeUser user = AuthUtil.getUser();
NodeFanoutMsg<ConsigneeArriveVO> nodeFanoutMsg= buildConsigneeArriveVO(deliveryListEntity,reservationEntity,user);
NodeFanoutMsg<ConsigneeArriveVO> nodeFanoutMsg= buildConsigneeArriveVO(deliveryListEntity,reservationEntity,add,user);
iDistributionNodeWorkService.carArrived(nodeFanoutMsg,user);
return Resp.scanSuccess("打卡成功", "打卡成功");
}
private NodeFanoutMsg<ConsigneeArriveVO> buildConsigneeArriveVO(DistributionDeliveryListEntity deliveryListEntity, DistributionReservationEntity reservationEntity, BladeUser user) {
private NodeFanoutMsg<ConsigneeArriveVO> buildConsigneeArriveVO(DistributionDeliveryListEntity deliveryListEntity, DistributionReservationEntity reservationEntity,GAddressVo add, BladeUser user) {
NodeFanoutMsg<ConsigneeArriveVO> nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD);
@ -4716,7 +4717,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
String vehicleName = deliveryListEntity.getVehicleName();
// 如果是自主配送 需要去获取当前司机绑定的车牌
if ("1".equals(deliveryListEntity.getKind())) {
BasicdataDriverArteryEntity driverArteryById = basicdataDriverArteryClient.getDriverArteryById(AuthUtil.getUserId());
BasicdataDriverArteryEntity driverArteryById = basicdataDriverArteryClient.getDriverArtery(AuthUtil.getUserId());
if (driverArteryById != null) {
for (int i = 0; i < planDriverbindCarVOS.size(); i++) {
@ -4731,6 +4732,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
ConsigneeArriveVO consigneeArriveVO = new ConsigneeArriveVO();
consigneeArriveVO.setTrainNumber(deliveryListEntity.getTrainNumber());
consigneeArriveVO.setReservationCode(reservationEntity.getReservationCode());
consigneeArriveVO.setProvince(add.getProvince());
consigneeArriveVO.setCity(add.getCity());
consigneeArriveVO.setDistrict(add.getDistrict());
consigneeArriveVO.setTownship(add.getTownship());
consigneeArriveVO.setAddress(add.getAddress());
consigneeArriveVO.setPositioning(add.getPositioning());
consigneeArriveVO.setDriverName(driverName);
consigneeArriveVO.setVehicleName(vehicleName);
@ -6537,7 +6546,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
nodeFanoutMsg.setNode(WorkNodeEnums.DISTRIBUTION_SIGN_FOR);
nodeFanoutMsg.setWarehouse(distributionDeliveryListEntity.getWarehouseName());
nodeFanoutMsg.setWarehouseId(distributionDeliveryListEntity.getWarehouseId());
nodeFanoutMsg.setOperator(AuthUtil.getTenantId());
nodeFanoutMsg.setOperator(AuthUtil.getNickName());
nodeFanoutMsg.setOperatorTime(distributionDeliveryListEntity.getUpdateTime());
// DistributionTaskVO taskVO = buildDistributionTaskVO(distributionDeliveryListEntity, AuthUtil.getUserId());

16
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

@ -27,6 +27,8 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.basic.entity.BasicMaterialEntity;
import com.logpm.basic.feign.IBasicMaterialClient;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataTrayEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
@ -237,6 +239,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
private IDistributionNodeWorkService distributionNodeWorkService;
@Autowired
private ITrunklinePackageTrackLogClient trunklinePackageTrackLogClient;
@Autowired
private IBasicMaterialClient basicMaterialClient;
@Override
@ -4348,7 +4352,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
nodeFanoutMsg.setWarehouse(entityWarehouse.getName());
}
nodeFanoutMsg.setWarehouseId(distributionStockupEntity.getWarehouseId());
nodeFanoutMsg.setOperator(user.getTenantId());
nodeFanoutMsg.setOperator(user.getNickName());
nodeFanoutMsg.setOperatorTime(distributionStockupEntity.getCreateTime());
StockUpVO stockUpVO = new StockUpVO();
stockUpVO.setTypeService(distributionStockupEntity.getTypeService());
@ -4416,7 +4420,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
nodeFanoutMsg.setWarehouse(entityWarehouse.getName());
}
nodeFanoutMsg.setWarehouseId(stockupEntity.getWarehouseId());
nodeFanoutMsg.setOperator(user.getTenantId());
nodeFanoutMsg.setOperator(user.getNickName());
nodeFanoutMsg.setOperatorTime(stockupEntity.getCreateTime());
@ -4434,7 +4438,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
reservationVO.setPackageDataList(packageDataList);
stockUpVO.setReservationVO(reservationVO);
nodeFanoutMsg.setMain(stockUpVO);
nodeFanoutMsg.setTenantId(AuthUtil.getTenantId());
@ -4458,7 +4462,11 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
packageData.setPackageCode(stockEntity.getCoding());
// packageData.setMallName(stockListEntity.getMallName());
packageData.setMallName(StringUtil.isBlank(stockListEntity.getMallName())? stockListEntity.getMarketName():stockListEntity.getMallName());
packageData.setMaterialCode(stockListEntity.getMarketCode());
Long materialId = stockListEntity.getMaterialId();
BasicMaterialEntity materialOwnId = basicMaterialClient.getMaterialOwnId(materialId);
if(materialOwnId!=null){
packageData.setMaterialCode(materialOwnId.getProductCode());
}
packageData.setMaterialName(stockListEntity.getDescriptionGoods());
packageData.setOrderCode(stockListEntity.getOrderCode());
packageData.setPackageType(PackageTypeEnums.INV);

Loading…
Cancel
Save