Browse Source

add:

1.修改复核作业节点的数据
dist.1.3.0
pref_mail@163.com 7 months ago
parent
commit
047bc0da8a
  1. 5
      blade-biz-common/src/main/java/org/springblade/common/model/DistributionSignforVO.java
  2. 95
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverListener.java
  3. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReservationPlanReportListener.java
  4. 49
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  5. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

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 carType;
/**
* 签收车次
*/

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

@ -6,7 +6,9 @@ import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.entity.BasicdataFactoryCategoryEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataFactoryCategoryClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.dto.ReportQualityDeliverDTO;
import com.logpm.distribution.entity.DistributionParcelListEntity;
@ -23,6 +25,7 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.Nullable;
import org.springblade.common.constant.report.ReportConstants;
import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.enums.PackageTypeEnums;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
@ -64,6 +67,9 @@ public class QualityDeliverListener {
@Resource
private IDistributionStockListService stockListService;
@Resource
private IBasicdataFactoryCategoryClient factoryCategoryClient;
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = ReportConstants.REPORT_QUALITY_DELIVER_QUEUE, durable = "true"),
exchange = @Exchange(name = ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE, type = ExchangeTypes.TOPIC),
@ -77,37 +83,39 @@ public class QualityDeliverListener {
ReportQualityDeliverDTO bean = JSONUtil.toBean(msg, ReportQualityDeliverDTO.class);
String data = bean.getData();
QualityDeliverEntity qualityDeliverEntity = JSONUtil.toBean(data, QualityDeliverEntity.class);
switch (bean.getOperation()) {
case MODIFY:
Integer conditions = qualityDeliverEntity.getConditions();
if (ObjectUtil.equals(PackageTypeEnums.CMP.getCode(), conditions)) {
// 定制品
LambdaQueryWrapper<QualityDeliverEntity> wrapper = Wrappers.<QualityDeliverEntity>lambdaQuery()
.eq(QualityDeliverEntity::getOrderPackageCode, qualityDeliverEntity.getOrderPackageCode())
.lt(QualityDeliverEntity::getBizStatus, 110);
saveOrUpdate(wrapper, qualityDeliverEntity);
} else if (ObjectUtil.equals(PackageTypeEnums.INV.getCode(), conditions)) {
// 库存品
LambdaQueryWrapper<QualityDeliverEntity> wrapper = buildInvWrapper(qualityDeliverEntity);
if (wrapper == null) {
return;
}
// 查询不存在时更新,存在时修改
saveOrUpdate(wrapper, qualityDeliverEntity);
} else if (ObjectUtil.equals(PackageTypeEnums.LTL.getCode(), 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())) {
wrapper.eq(QualityDeliverEntity::getPlanReservationCode, qualityDeliverEntity.getPlanReservationCode());
}
saveOrUpdate(wrapper, qualityDeliverEntity);
Integer conditions = qualityDeliverEntity.getConditions();
if(ObjectUtil.equals(bean.getOperation(), BizOperationEnums.MODIFY)){
if (ObjectUtil.equals(PackageTypeEnums.CMP.getCode(), conditions)) {
// 定制品
LambdaQueryWrapper<QualityDeliverEntity> wrapper = Wrappers.<QualityDeliverEntity>lambdaQuery()
.eq(QualityDeliverEntity::getOrderPackageCode, qualityDeliverEntity.getOrderPackageCode())
.lt(QualityDeliverEntity::getBizStatus, 110);
saveOrUpdate(wrapper, qualityDeliverEntity);
} else if (ObjectUtil.equals(PackageTypeEnums.INV.getCode(), conditions)) {
// 库存品
LambdaQueryWrapper<QualityDeliverEntity> wrapper = buildInvWrapper(qualityDeliverEntity);
if (wrapper == null) {
return;
}
break;
default:
return;
// 查询不存在时更新,存在时修改
saveOrUpdate(wrapper, qualityDeliverEntity);
} else if (ObjectUtil.equals(PackageTypeEnums.LTL.getCode(), 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())) {
wrapper.eq(QualityDeliverEntity::getPlanReservationCode, qualityDeliverEntity.getPlanReservationCode());
}
saveOrUpdate(wrapper, qualityDeliverEntity);
}
}
if(ObjectUtil.equals(bean.getOperation(), BizOperationEnums.ADD)){
if (ObjectUtil.equals(PackageTypeEnums.INV.getCode(), conditions)) {
// 查询不存在时更新,存在时修改
saveOrUpdate(null, qualityDeliverEntity);
}
}
}
@ -165,7 +173,10 @@ public class QualityDeliverListener {
* @Author zqb 2024/9/10
**/
private void saveOrUpdate(LambdaQueryWrapper<QualityDeliverEntity> wrapper, QualityDeliverEntity qualityDeliverEntity) {
QualityDeliverEntity entity = qualityDeliverService.getOne(wrapper);
QualityDeliverEntity entity = null;
if (ObjectUtil.isNotEmpty(wrapper)) {
entity = qualityDeliverService.getOne(wrapper);
}
if (ObjectUtil.isNotEmpty(entity)) {
// 修改
qualityDeliverService.update(qualityDeliverEntity, wrapper);
@ -197,25 +208,41 @@ public class QualityDeliverListener {
}
private void buildInvBasicInfo(QualityDeliverEntity qualityDeliverEntity) {
String materielName = qualityDeliverEntity.getMaterielName();
DistributionStockListEntity stockListEntity = new DistributionStockListEntity();
stockListEntity.setIncomingBatch(qualityDeliverEntity.getIncomingBatch());
stockListEntity.setMallName(qualityDeliverEntity.getMallName());
stockListEntity.setCargoNumber((qualityDeliverEntity.getMaterielCode()));
stockListEntity.setDescriptionGoods(qualityDeliverEntity.getMaterielName());
stockListEntity.setDescriptionGoods(materielName);
stockListEntity.setWarehouseId(qualityDeliverEntity.getWarehouseId());
DistributionStockListEntity stockList = stockListService.findStockListByAttrAndWarehouseId(stockListEntity);
if (ObjectUtil.isNotEmpty(stockList)) {
String brandName = stockList.getBrandName();
String sourceType = stockList.getSourceType();
if (StrUtil.equals(sourceType, "1")) {
buildCmpBasicInfo(qualityDeliverEntity);
} else {
qualityDeliverEntity.setBrandName(stockList.getBrandName());
qualityDeliverEntity.setBrandName(brandName);
qualityDeliverEntity.setMallCode(stockList.getMarketCode());
qualityDeliverEntity.setStoreCode(stockList.getStoreCode());
qualityDeliverEntity.setStoreName(stockList.getStoreName());
qualityDeliverEntity.setEndWarehouseInTime(stockList.getWarehousingTime());
}
// 品类
if(StrUtil.isNotEmpty(materielName) && StrUtil.isNotEmpty(brandName)){
BasicdataFactoryCategoryEntity factoryCategoryEntity = new BasicdataFactoryCategoryEntity();
factoryCategoryEntity.setMaterielName(materielName);
factoryCategoryEntity.setBrand(brandName);
BasicdataFactoryCategoryEntity categoryEntity = factoryCategoryClient.findEntityByMaterielName(factoryCategoryEntity);
if(ObjectUtil.isNotEmpty(categoryEntity)){
// TODO 存id
qualityDeliverEntity.setCostCategory(categoryEntity.getCategory());
qualityDeliverEntity.setRevenueCategory(categoryEntity.getCategory());
}
// TODO 从入库单上查询入库时间
}
}
}
private void buildCmpBasicInfo(QualityDeliverEntity qualityDeliverEntity) {
@ -269,7 +296,7 @@ public class QualityDeliverListener {
qualityDeliverEntity.setCustomAddress(stockArticleEntity.getCustomerAddress());
// 商场信息
qualityDeliverEntity.setMallName(stockArticleEntity.getMallName());
qualityDeliverEntity.setMallCode(stockArticleEntity.getMallName());
qualityDeliverEntity.setMallCode(stockArticleEntity.getMallCode());
// 服务号
qualityDeliverEntity.setServiceNumber(stockArticleEntity.getServiceNumber());
// 经销商信息

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReservationPlanReportListener.java

@ -101,14 +101,14 @@ public class ReservationPlanReportListener {
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {
qualityDeliverEntity.setConditions(1);
qualityDeliverEntity.setPlanNum(1);
sendReport(bizOperation, qualityDeliverEntity);
sendReport(bizOperation, qualityDeliverEntity,BizOperationEnums.MODIFY);
}
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.LTL)) {
qualityDeliverEntity.setOrderCode(detail.getOrderCode());
qualityDeliverEntity.setCostCategory(detail.getProductName());
qualityDeliverEntity.setRevenueCategory(detail.getProductName());
qualityDeliverEntity.setConditions(2);
sendReport(bizOperation, qualityDeliverEntity);
sendReport(bizOperation, qualityDeliverEntity,BizOperationEnums.MODIFY);
}
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.INV)) {
qualityDeliverEntity.setIncomingBatch(detail.getPickupBatch());
@ -121,7 +121,7 @@ public class ReservationPlanReportListener {
QualityDeliverEntity entity = new QualityDeliverEntity();
BeanUtil.copyProperties(qualityDeliverEntity, entity);
entity.setPlanNum(1);
sendReport(bizOperation, entity);
sendReport(bizOperation, entity, BizOperationEnums.ADD);
}
}
@ -129,9 +129,9 @@ public class ReservationPlanReportListener {
}
}
private void sendReport(BizOperationEnums bizOperation, QualityDeliverEntity qualityDeliverEntity) {
private void sendReport(BizOperationEnums bizOperation, QualityDeliverEntity qualityDeliverEntity, BizOperationEnums bizOperationEnums) {
if (BizOperationEnums.ADD.equals(bizOperation) || BizOperationEnums.MODIFY.equals(bizOperation)) {
ReportQualityDeliverDTO dto = ReportQualityDeliverDTO.builder().data(JSONUtil.toJsonStr(qualityDeliverEntity)).operation(BizOperationEnums.MODIFY).build();
ReportQualityDeliverDTO dto = ReportQualityDeliverDTO.builder().data(JSONUtil.toJsonStr(qualityDeliverEntity)).operation(bizOperationEnums).build();
factoryDataClient.sendMessage(SendMsg.builder()
.exchange(ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE)
.routingKey(ReportConstants.REPORT_QUALITY_DELIVER_ROUTINGKEY)

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

@ -1872,15 +1872,18 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return Resp.scanFail("未授权", "未授权!!!");
}
//库存品
DistributionDeliveryListEntity distributionDeliveryListEntity = this.getById(distrilbutionloadingscanDTO.getDeliveryId());
//获取当前用户司机
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId());
DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfEntity();
if ("1".equals(distributionDeliveryListEntity.getKind())) {
distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectById(distrilbutionloadingscanDTO.getLoadingId());
} else {
DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectById(distrilbutionloadingscanDTO.getLoadingId());
BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity);
}
DistributionDeliverySelfEntity distributionDeliverySelfEntity = getDriver(distributionDeliveryListEntity, AuthUtil.getUser(), distrilbutionloadingscanDTO, true);
// DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId());
// DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfEntity();
// if ("1".equals(distributionDeliveryListEntity.getKind())) {
// distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectById(distrilbutionloadingscanDTO.getLoadingId());
// } else {
// DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectById(distrilbutionloadingscanDTO.getLoadingId());
// BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity);
// }
List<Long> packageLockIds = new ArrayList<>();
//根据传递进来的库存品条码进行库存品的校验
@ -1905,17 +1908,23 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
DisStockListDetailEntity disStockListDetailEntity = disStockListDetailEntities.get(0);
disStockListDetailEntity.setStockLockingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
disStockListDetailService.updateById(disStockListDetailEntity);
//维护包件装车状态
boolean update = distributionParcelListService.update(
Wrappers.<DistributionParcelListEntity>update().lambda()
.eq(DistributionParcelListEntity::getOrderPackageCode, disStockListDetailEntity.getStockPackageCode())
.eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId())
.eq(DistributionParcelListEntity::getMaterialCode, disStockListDetailEntity.getSku())
.set(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.yizhuangche.getValue())
.set(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.yiyueyue.getValue())
.set(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yichuku.getValue())
);
DistributionStockListEntity byId = distributionStockListService.getById(disStockListDetailEntity.getStockListId());
if(byId!=null &&"1".equals(byId.getSourceType())){
//维护包件装车状态
boolean update = distributionParcelListService.update(
Wrappers.<DistributionParcelListEntity>update().lambda()
.eq(DistributionParcelListEntity::getOrderPackageCode, disStockListDetailEntity.getStockPackageCode())
.eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId())
.eq(DistributionParcelListEntity::getMaterialCode, disStockListDetailEntity.getSku())
.set(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.yizhuangche.getValue())
.set(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.yiyueyue.getValue())
.set(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yichuku.getValue())
);
}
log.info(">>>>>>>>>>>>>>>>>>>装车修改库存品包件>装车包件码:{},", disStockListDetailEntity.getStockPackageCode());
DistributionLoadscaninvnEntity distributionLoadscaninvnEntity = getDistributionLoadscaninvnEntity(distrilbutionloadingscanDTO, distributionDeliverySelfEntity, disStockListDetailEntities, myCurrentWarehouse);
packageLockIds.add(distributionLoadscaninvnEntity.getInventoryPackageId());
@ -1964,9 +1973,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
}
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(distrilbutionloadingscanDTO.getDeliveryId());
// DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(distrilbutionloadingscanDTO.getDeliveryId());
DistributionReservationEntity reservationEntity = distributionReservationService.getById(distrilbutionloadingscanDTO.getReservationId());
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByStock(deliveryListEntity, reservationEntity, ts);
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByStock(distributionDeliveryListEntity, reservationEntity, ts);
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser());
String msg = getLoadingMsg(distrilbutionloadingscanDTO);
return Resp.scanSuccess("扫描成功", msg);

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

@ -2940,6 +2940,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
DistributionLoadscaninvnEntity distributionLoadscanEntity = pushList.get(0);
distributionLoadVO.setDriverName(distributionLoadscanEntity.getDriverName());
distributionLoadVO.setVehicleName(distributionLoadscanEntity.getVehicleName());
distributionLoadVO.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
DistributionReservationEntity byId = distributionReservationService.getById(distributionLoadscanEntity.getReservationId());
if (!Func.isEmpty(byId)) {
distributionLoadVO.setReservationCode(byId.getReservationCode());
@ -2992,6 +2993,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
DistributionLoadscanEntity distributionLoadscanEntity = pushList.get(0);
distributionLoadVO.setDriverName(distributionLoadscanEntity.getDriverName());
distributionLoadVO.setVehicleName(distributionLoadscanEntity.getVehicleName());
// 获取车辆类型
distributionLoadVO.setReservationCode(distributionReservationEntity.getReservationCode());
distributionLoadVO.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
distributionLoadVO.setReservationId(distributionReservationEntity.getId());

Loading…
Cancel
Save