Browse Source

add:增加到达的坐标和地理位置信息

修改签收 装车节点数据
dist.1.3.0
pref_mail@163.com 7 months ago
parent
commit
d3cf78f537
  1. 33
      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. 41
      blade-biz-common/src/main/java/org/springblade/common/model/GAddressVo.java
  4. 25
      blade-biz-common/src/main/java/org/springblade/common/utils/GaoDeApiUtil.java
  5. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java
  6. 64
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/PlanReportListener.java
  7. 32
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverListener.java
  8. 62
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/StockReportListener.java
  9. 50
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  10. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  11. 31
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  12. 16
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

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

@ -26,11 +26,44 @@ public class ConsigneeArriveVO {
*/
private String vehicleName;
/**
* 预约单号
*/
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;
/**
* 预约单号
*/

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

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

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

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

@ -32,7 +32,7 @@ import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.*;
/**
* 配送计划生成明细报表
@ -56,7 +56,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 +68,9 @@ public class PlanReportListener {
BizOperationEnums bizOperation = bean.getBizOperation();
List<ReservationVO> reservationVOList = vo.getReservationVOList();
if (CollUtil.isNotEmpty(reservationVOList)) {
Set<String> reservationSet = new HashSet<>();
Map<String, QualityDeliverEntity> invMap = new HashMap<>();
Map<String, QualityDeliverEntity> ltlMap = new HashMap<>();
for (ReservationVO reservationVO : reservationVOList) {
List<PackageData> details = reservationVO.getPackageDataList();
if (BizOperationEnums.MODIFY.equals(bizOperation) || BizOperationEnums.DELETE.equals(bizOperation)) {
@ -83,6 +86,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);
}
@ -121,34 +125,60 @@ public class PlanReportListener {
qualityDeliverEntity.setConditions(2);
qualityDeliverEntity.setPlanNum(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());
// 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());
ltlMap.put(detail.getOrderCode()+detail.getProductName(), qualityDeliverEntity);
}
} 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);
// 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());
}
}
}
}
}
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)
);
}
}
if (CollUtil.isNotEmpty(ltlMap)) {
for (Map.Entry<String, QualityDeliverEntity> entry : ltlMap.entrySet()) {
QualityDeliverEntity qualityDeliverEntity = entry.getValue();
qualityDeliverService.update(qualityDeliverEntity, Wrappers.<QualityDeliverEntity>lambdaUpdate()
.eq(QualityDeliverEntity::getPlanReservationCode,qualityDeliverEntity.getPlanReservationCode())
.eq(QualityDeliverEntity::getOrderCode,qualityDeliverEntity.getOrderCode())
.eq(QualityDeliverEntity::getCostCategory,qualityDeliverEntity.getCostCategory())
.lt(QualityDeliverEntity::getBizStatus, 110)
);
}
}
}
}

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

@ -52,6 +52,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,27 +64,28 @@ 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));
} else if (3 == conditions) {
// 库存品
LambdaQueryWrapper<QualityDeliverEntity> wrapper = Wrappers.<QualityDeliverEntity>lambdaQuery()
.lt(QualityDeliverEntity::getBizStatus, 110);
if(StrUtil.isNotEmpty(qualityDeliverEntity.getOrderPackageCode())){
wrapper.eq(QualityDeliverEntity::getOrderPackageCode, qualityDeliverEntity.getOrderPackageCode());
}else{
wrapper.eq(QualityDeliverEntity::getMallName, qualityDeliverEntity.getMallName())
.eq(QualityDeliverEntity::getMaterielCode, qualityDeliverEntity.getMaterielCode());
}
if(StrUtil.isNotEmpty(qualityDeliverEntity.getPlanReservationCode())){
wrapper.eq(QualityDeliverEntity::getPlanReservationCode, qualityDeliverEntity.getPlanReservationCode());
}
QualityDeliverEntity entity = qualityDeliverService.getOne(wrapper);
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())){
wrapper.eq(QualityDeliverEntity::getOrderPackageCode, qualityDeliverEntity.getOrderPackageCode());
}
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())

62
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;
@ -31,7 +30,9 @@ import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 备货生成明细报表
@ -67,20 +68,21 @@ 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 (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)) {
Map<String, QualityDeliverEntity> invMap = new HashMap<>();
for (PackageData detail : details) {
QualityDeliverEntity qualityDeliverEntity = QualityDeliverEntity.builder()
.warehouseName(bean.getWarehouse())
@ -120,20 +122,36 @@ public class StockReportListener {
.build());
}
} 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 qualityDeliverEntity1 = list.get(0);
qualityDeliverService.update(qualityDeliverEntity, Wrappers.<QualityDeliverEntity>lambdaUpdate()
.eq(QualityDeliverEntity::getId,qualityDeliverEntity1.getId())
);
}
// 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;
@ -277,6 +279,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);
@ -3577,7 +3588,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);
@ -4694,7 +4705,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);
@ -4702,7 +4713,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++) {
@ -6104,8 +6115,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());
@ -6117,7 +6128,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++) {
@ -8224,8 +8235,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();
@ -8249,8 +8261,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();
@ -8271,8 +8283,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();
@ -8310,13 +8322,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);
}
//比较库存品之间的数据
}

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

@ -730,7 +730,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());
@ -2934,7 +2934,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());
@ -2958,7 +2958,6 @@ 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.setProductName(byId.getDescriptionGoods());
packageData.setMaterialCode(byIds.getCargoNumber());
@ -2968,6 +2967,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
packageData.setNumber(1);
data.add(packageData);
}
@ -2985,7 +2985,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());
@ -2995,6 +2995,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<>();
@ -4685,26 +4686,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);
@ -4720,7 +4721,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++) {
@ -4735,6 +4736,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);
@ -6541,7 +6550,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