|
|
|
@ -72,10 +72,7 @@ import org.springblade.common.constant.WorkNodeEnums;
|
|
|
|
|
import org.springblade.common.constant.common.IsOrNoConstant; |
|
|
|
|
import org.springblade.common.constant.delivery.DeliveryLoadingStatusConstant; |
|
|
|
|
import org.springblade.common.constant.delivery.DeliveryStatusConstant; |
|
|
|
|
import org.springblade.common.constant.loading.LoadScanSigningStatusConstant; |
|
|
|
|
import org.springblade.common.constant.loading.LoadingAbnormalAuditingStatusConstant; |
|
|
|
|
import org.springblade.common.constant.loading.LoadingIsInsertConstant; |
|
|
|
|
import org.springblade.common.constant.loading.LoadingStatusConstant; |
|
|
|
|
import org.springblade.common.constant.loading.*; |
|
|
|
|
import org.springblade.common.constant.order.OrderStatusConstant; |
|
|
|
|
import org.springblade.common.constant.orderpackage.*; |
|
|
|
|
import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant; |
|
|
|
@ -100,7 +97,9 @@ import org.springblade.core.tool.api.R;
|
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
|
import org.springblade.system.cache.DictBizCache; |
|
|
|
|
import org.springblade.system.entity.User; |
|
|
|
|
import org.springblade.system.feign.IDictBizClient; |
|
|
|
|
import org.springblade.system.feign.IUserClient; |
|
|
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
@ -246,6 +245,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private FactoryDataMessageSender factoryDataMessageSender; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private IUserClient userClient; |
|
|
|
|
|
|
|
|
|
// private final IWarehouseRetentionScanClient warehouseRetentionScanClient;
|
|
|
|
|
|
|
|
|
|
// @Lazy
|
|
|
|
@ -7007,7 +7010,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean judgmentOrderRemove(Long deliveryId, String orderIds) { |
|
|
|
|
public R judgmentOrderRemove(Long deliveryId, String orderIds) { |
|
|
|
|
List<Long> list = Func.toLongList(orderIds); |
|
|
|
|
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda() |
|
|
|
|
.eq(DistributionLoadscanEntity::getDeliveryId, deliveryId) |
|
|
|
@ -7015,9 +7018,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(loadscanEntityList)) { |
|
|
|
|
return false; |
|
|
|
|
List<Long> ids = loadscanEntityList.stream().map(DistributionLoadscanEntity::getOrderId).distinct().collect(Collectors.toList()); |
|
|
|
|
List<DistributionStockArticleEntity> distributionStockArticleEntities = distributionStockArticleService.listByIds(ids); |
|
|
|
|
if (!distributionStockArticleEntities.isEmpty()) { |
|
|
|
|
String orderCodes = distributionStockArticleEntities.stream().map(DistributionStockArticleEntity::getOrderCode).distinct().collect(Collectors.joining(",\n")); |
|
|
|
|
return R.fail(orderCodes+"当前订单已装车,请滞留后进行移除"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
return R.data(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -7235,6 +7243,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
); |
|
|
|
|
if (Func.isEmpty(packageObj)) { |
|
|
|
|
//系统无编码
|
|
|
|
|
log.error("系统无编码"); |
|
|
|
|
} |
|
|
|
|
if (OrderPackageStatusConstant.yiqianshou.getValue().equals(packageObj.getOrderPackageStatus())) { |
|
|
|
|
//包件已签收
|
|
|
|
|
log.error("包件已签收"); |
|
|
|
|
} |
|
|
|
|
//查询配送计划
|
|
|
|
|
DistributionDeliveryListEntity deliveryListEntity = this.getOne(Wrappers.<DistributionDeliveryListEntity>query().lambda() |
|
|
|
@ -7243,49 +7256,281 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
); |
|
|
|
|
if (Func.isEmpty(deliveryListEntity)) { |
|
|
|
|
//配送计划查询错误
|
|
|
|
|
log.error("配送计划查询错误"); |
|
|
|
|
} |
|
|
|
|
//查询仓库是否有效
|
|
|
|
|
BasicdataWarehouseEntity entityWarehouseId = warehouseClient.getEntityWarehouseId(warehouseId); |
|
|
|
|
if (Func.isEmpty(entityWarehouseId)) { |
|
|
|
|
//仓库查询错误
|
|
|
|
|
log.error("仓库查询错误"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(packageObj.getId()); |
|
|
|
|
if (Func.isEmpty(stockArticleEntity)) { |
|
|
|
|
//订单查询错误
|
|
|
|
|
log.error("订单查询错误"); |
|
|
|
|
} |
|
|
|
|
//查询配送司机
|
|
|
|
|
DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfDTO(); |
|
|
|
|
if (deliveryListEntity.getKind().equals(ServiceConstant.DELIVERLIST_KIND_SELF)) { |
|
|
|
|
distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectOne(new QueryWrapper<DistributionDeliverySelfEntity>().lambda() |
|
|
|
|
.eq(DistributionDeliverySelfEntity::getIsMaster, ServiceConstant.IS_MASTER_YES) |
|
|
|
|
.eq(DistributionDeliverySelfEntity::getDeliveryId, deliveryListEntity.getId()) |
|
|
|
|
); |
|
|
|
|
} else { |
|
|
|
|
DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectOne(new QueryWrapper<DistributionDeliveryTripartiteEntity>().lambda() |
|
|
|
|
.eq(DistributionDeliveryTripartiteEntity::getDeliveryId, deliveryListEntity.getId())); |
|
|
|
|
BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (Func.isEmpty(distributionDeliverySelfEntity)){ |
|
|
|
|
//查询司机信息失败
|
|
|
|
|
log.error("查询司机信息失败"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//查询签收信息
|
|
|
|
|
List<DistributionSignforEntity> signforEntityList = distributionSignforService.list(Wrappers.<DistributionSignforEntity>query().lambda() |
|
|
|
|
.eq(DistributionSignforEntity::getDeliveryId, deliveryListEntity.getId()) |
|
|
|
|
); |
|
|
|
|
String content = ""; |
|
|
|
|
|
|
|
|
|
if (!signforEntityList.isEmpty()) { |
|
|
|
|
List<Long> reservationIds = signforEntityList.stream().map(DistributionSignforEntity::getReservationId).collect(Collectors.toList()); |
|
|
|
|
List<DistributionReservationPackageEntity> reservationPackageEntityList = distributionReservationPackageService.list(Wrappers.<DistributionReservationPackageEntity>query().lambda() |
|
|
|
|
.in(DistributionReservationPackageEntity::getReservationId, reservationIds) |
|
|
|
|
.ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); |
|
|
|
|
if (!reservationPackageEntityList.isEmpty()) { |
|
|
|
|
boolean flag = reservationPackageEntityList.stream().anyMatch(rp -> orderPackageCode.equals(rp.getPacketBarCode())); |
|
|
|
|
if (flag) { |
|
|
|
|
//存在计划中,进行是否装车判断然后完成签收扫描闭环
|
|
|
|
|
List<DistributionReservationPackageEntity> rpList = reservationPackageEntityList.stream().filter(rp -> orderPackageCode.equals(rp.getPacketBarCode())).collect(Collectors.toList()); |
|
|
|
|
if (rpList.size() == 1) { |
|
|
|
|
DistributionReservationEntity reservationEntity = distributionReservationService.getById(rpList.get(0).getReservationId()); |
|
|
|
|
DistributionLoadscanEntity loadscanEntity = distributionLoadscanService.getOne(Wrappers.<DistributionLoadscanEntity>query().lambda() |
|
|
|
|
.eq(DistributionLoadscanEntity::getReservationId, rpList.get(0).getReservationId()) |
|
|
|
|
.eq(DistributionLoadscanEntity::getOrderPackageCode, rpList.get(0).getPacketBarCode()) |
|
|
|
|
.eq(DistributionLoadscanEntity::getWarehouseId, warehouseId) |
|
|
|
|
.eq(DistributionLoadscanEntity::getSignforState, LoadScanSigningStatusConstant.weiqianshou.getValue()) |
|
|
|
|
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (Func.isEmpty(loadscanEntity)) { |
|
|
|
|
//存在装车数据
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
loadscanEntity.setSigningTime(simpleDateFormat.format(new Date())); |
|
|
|
|
loadscanEntity.setSignforState(2); |
|
|
|
|
loadscanEntity.setScanState(1); |
|
|
|
|
loadscanEntity.setIsInsert(1); |
|
|
|
|
loadscanEntity.setScanState(1); |
|
|
|
|
loadscanEntity.setReceivedQuantity(loadscanEntity.getLoadedNub()); |
|
|
|
|
loadscanEntity.setSigningUser(loadscanEntity.getDriverName()); |
|
|
|
|
loadscanEntity.setSigningUserId(Long.parseLong(loadscanEntity.getDriverId())); |
|
|
|
|
distributionLoadscanService.updateById(loadscanEntity); |
|
|
|
|
//更新签收数量
|
|
|
|
|
Integer j = distributionSignforMapper.updateSignforNum(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); |
|
|
|
|
//更新签收人
|
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
user.setNickName(loadscanEntity.getDriverName()); |
|
|
|
|
Integer m = distributionSignforMapper.updateSignUser(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), user); |
|
|
|
|
content = "包件在" + entityWarehouseId.getName() + "由" + loadscanEntity.getSigningUser() + "扫描签收,签收方式:司机进行装车,由商家端进行签收,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode(); |
|
|
|
|
} else { |
|
|
|
|
//不存在装车数据进行补录
|
|
|
|
|
//查询配送计划的计划司机
|
|
|
|
|
DistributionLoadscanEntity distributionLoadscanEntity = new DistributionLoadscanEntity(); |
|
|
|
|
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverPhone())) { |
|
|
|
|
distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); |
|
|
|
|
} |
|
|
|
|
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleNub())) { |
|
|
|
|
distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); |
|
|
|
|
} |
|
|
|
|
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverId())) { |
|
|
|
|
distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getId())) { |
|
|
|
|
distributionLoadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) { |
|
|
|
|
distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); |
|
|
|
|
} |
|
|
|
|
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleId())) { |
|
|
|
|
distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); |
|
|
|
|
} |
|
|
|
|
Date loadScanTime = new Date(); |
|
|
|
|
distributionLoadscanEntity.setScanTime(simpleDateFormat.format(loadScanTime)); |
|
|
|
|
distributionLoadscanEntity.setPackageId(packageObj.getId()); |
|
|
|
|
distributionLoadscanEntity.setWarehouseId(entityWarehouseId.getId()); |
|
|
|
|
distributionLoadscanEntity.setWarehouseName(entityWarehouseId.getName()); |
|
|
|
|
distributionLoadscanEntity.setOrderPackageCode(packageObj.getOrderPackageCode()); |
|
|
|
|
Date signingTime = new Date(System.currentTimeMillis() + (1000 * 60)); |
|
|
|
|
distributionLoadscanEntity.setSigningTime(simpleDateFormat.format(signingTime)); |
|
|
|
|
distributionLoadscanEntity.setReceivedQuantity(packageObj.getQuantity()); |
|
|
|
|
distributionLoadscanEntity.setReservationId(rpList.get(0).getReservationId()); |
|
|
|
|
distributionLoadscanEntity.setScanState(0); |
|
|
|
|
distributionLoadscanEntity.setIsSignfor(2); |
|
|
|
|
distributionLoadscanEntity.setScanType("1"); |
|
|
|
|
distributionLoadscanEntity.setIsInsert(2); |
|
|
|
|
distributionLoadscanEntity.setSignforState(2); |
|
|
|
|
distributionLoadscanEntity.setTrainNumber(deliveryListEntity.getTrainNumber()); |
|
|
|
|
distributionLoadscanEntity.setPackageNub(packageObj.getQuantity()); |
|
|
|
|
distributionLoadscanEntity.setOrderId(packageObj.getStockArticleId()); |
|
|
|
|
distributionLoadscanEntity.setLoadedNub(packageObj.getQuantity()); |
|
|
|
|
distributionLoadscanEntity.setDeliveryId(deliveryListEntity.getId()); |
|
|
|
|
distributionLoadscanEntity.setScanUser(distributionDeliverySelfEntity.getDriverName()); |
|
|
|
|
distributionLoadscanEntity.setSigningUser(distributionDeliverySelfEntity.getDriverName()); |
|
|
|
|
distributionLoadscanEntity.setSigningUserId(distributionDeliverySelfEntity.getDeliveryId()); |
|
|
|
|
distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.buluzhuangche.getValue()); |
|
|
|
|
distributionLoadscanService.save(distributionLoadscanEntity); |
|
|
|
|
//进行签收数量的修改
|
|
|
|
|
Integer i = distributionDeliveryListMapper.updateloadingTimeById(deliveryListEntity.getId()); |
|
|
|
|
//更新装车包件数和签收包件数
|
|
|
|
|
Integer j = distributionSignforMapper.updateSignforByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub()); |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
user.setNickName(distributionLoadscanEntity.getDriverName()); |
|
|
|
|
//更新签收人
|
|
|
|
|
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), user); |
|
|
|
|
//包件解托下架
|
|
|
|
|
warehouseUpdownTypeClient.downPackageOrDelTray(packageObj.getOrderPackageCode(), warehouseId, "签收下架解托"); |
|
|
|
|
content = "包件在" + entityWarehouseId.getName() + "由" + loadscanEntity.getSigningUser() + "扫描签收,签收方式:司机未进行装车,由商家端进行签收,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode(); |
|
|
|
|
} |
|
|
|
|
//进行包件状态维护
|
|
|
|
|
|
|
|
|
|
//维护订单
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
//异常签收判定
|
|
|
|
|
//查询此包件的订单
|
|
|
|
|
//查询此配送任务的预约列表
|
|
|
|
|
List<DistributionReservationEntity> distributionReservationEntities = baseMapper.selectReservationByDeliveryListId(deliveryListEntity.getId()); |
|
|
|
|
if (!distributionReservationEntities.isEmpty()) { |
|
|
|
|
boolean isSatisfy = distributionReservationEntities.stream().anyMatch(f -> stockArticleEntity.getConsigneeUnit().equals(f.getReceivingUnit()) && stockArticleEntity.getMallName().equals(f.getMallName()) && stockArticleEntity.getConsigneePerson().equals(f.getConsignee())); |
|
|
|
|
if (isSatisfy) { |
|
|
|
|
List<DistributionReservationEntity> reservationList = distributionReservationEntities.stream().filter(f -> stockArticleEntity.getConsigneeUnit().equals(f.getReceivingUnit()) && stockArticleEntity.getMallName().equals(f.getMallName()) && stockArticleEntity.getConsigneePerson().equals(f.getConsignee())).collect(Collectors.toList()); |
|
|
|
|
if (reservationList.size() == 1) { |
|
|
|
|
//查询装车记录
|
|
|
|
|
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda() |
|
|
|
|
.eq(DistributionLoadscanEntity::getOrderPackageCode, packageObj.getOrderPackageCode()) |
|
|
|
|
.eq(DistributionLoadscanEntity::getSignforState, LoadScanSigningStatusConstant.weiqianshou.getValue()) |
|
|
|
|
.eq(DistributionLoadscanEntity::getWarehouseId, warehouseId) |
|
|
|
|
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (!loadscanEntityList.isEmpty()) { |
|
|
|
|
//存在装车
|
|
|
|
|
if (loadscanEntityList.size() == 1) { |
|
|
|
|
//判定是否是本车次的装车
|
|
|
|
|
isSatisfy = loadscanEntityList.stream().anyMatch(a -> deliveryListEntity.getId().equals(a.getDeliveryId())); |
|
|
|
|
if (isSatisfy){ |
|
|
|
|
//本车次的异常装车
|
|
|
|
|
DistributionLoadscanEntity distributionLoadscanEntity = loadscanEntityList.get(0); |
|
|
|
|
if (distributionLoadscanEntity.equals("2")){ |
|
|
|
|
//进行异常签收的标识
|
|
|
|
|
//存在装车数据
|
|
|
|
|
distributionLoadscanEntity.setSigningTime(simpleDateFormat.format(new Date())); |
|
|
|
|
distributionLoadscanEntity.setSignforState(2); |
|
|
|
|
distributionLoadscanEntity.setScanState(1); |
|
|
|
|
distributionLoadscanEntity.setIsInsert(1); |
|
|
|
|
distributionLoadscanEntity.setScanState(1); |
|
|
|
|
//异常装车状态下进行签收
|
|
|
|
|
distributionLoadscanEntity.setIsAbnormalSigning(2); |
|
|
|
|
distributionLoadscanEntity.setAbnormalNote("异常签收"); |
|
|
|
|
distributionLoadscanEntity.setReceivedQuantity(distributionLoadscanEntity.getLoadedNub()); |
|
|
|
|
distributionLoadscanEntity.setSigningUser(distributionLoadscanEntity.getDriverName()); |
|
|
|
|
distributionLoadscanEntity.setSigningUserId(Long.parseLong(distributionLoadscanEntity.getDriverId())); |
|
|
|
|
distributionLoadscanEntity.setTrainNumber(deliveryListEntity.getTrainNumber()); |
|
|
|
|
distributionLoadscanService.updateById(distributionLoadscanEntity); |
|
|
|
|
Integer j = distributionSignforMapper.updateSignforNum(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub()); |
|
|
|
|
//更新签收人
|
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
user.setNickName(distributionLoadscanEntity.getDriverName()); |
|
|
|
|
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), user); |
|
|
|
|
content = "包件在" + entityWarehouseId.getName() + "由" + distributionLoadscanEntity.getSigningUser() + "扫描签收,签收方式:司机进行异常装车,由商家端进行签收,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationList.get(0).getReservationCode(); |
|
|
|
|
|
|
|
|
|
//成功 -- 进行异常签收
|
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
log.error("商家端异常签收存在装车非本车次计划"); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
log.error("商家端签收非计划下存在多条装车记录"); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
DistributionLoadscanEntity distributionLoadscanEntity = new DistributionLoadscanEntity(); |
|
|
|
|
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverPhone())) { |
|
|
|
|
distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); |
|
|
|
|
} |
|
|
|
|
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleNub())) { |
|
|
|
|
distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); |
|
|
|
|
} |
|
|
|
|
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverId())) { |
|
|
|
|
distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getId())) { |
|
|
|
|
distributionLoadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) { |
|
|
|
|
distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); |
|
|
|
|
} |
|
|
|
|
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleId())) { |
|
|
|
|
distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); |
|
|
|
|
} |
|
|
|
|
Date loadScanTime = new Date(); |
|
|
|
|
distributionLoadscanEntity.setScanTime(simpleDateFormat.format(loadScanTime)); |
|
|
|
|
distributionLoadscanEntity.setPackageId(packageObj.getId()); |
|
|
|
|
distributionLoadscanEntity.setWarehouseId(entityWarehouseId.getId()); |
|
|
|
|
distributionLoadscanEntity.setWarehouseName(entityWarehouseId.getName()); |
|
|
|
|
distributionLoadscanEntity.setOrderPackageCode(packageObj.getOrderPackageCode()); |
|
|
|
|
Date signingTime = new Date(System.currentTimeMillis() + (1000 * 60)); |
|
|
|
|
distributionLoadscanEntity.setSigningTime(simpleDateFormat.format(signingTime)); |
|
|
|
|
distributionLoadscanEntity.setReceivedQuantity(packageObj.getQuantity()); |
|
|
|
|
distributionLoadscanEntity.setReservationId(reservationList.get(0).getId()); |
|
|
|
|
distributionLoadscanEntity.setScanState(0); |
|
|
|
|
distributionLoadscanEntity.setIsSignfor(2); |
|
|
|
|
distributionLoadscanEntity.setScanType("5"); |
|
|
|
|
distributionLoadscanEntity.setIsInsert(2); |
|
|
|
|
distributionLoadscanEntity.setSignforState(2); |
|
|
|
|
distributionLoadscanEntity.setTrainNumber(deliveryListEntity.getTrainNumber()); |
|
|
|
|
distributionLoadscanEntity.setPackageNub(packageObj.getQuantity()); |
|
|
|
|
distributionLoadscanEntity.setOrderId(packageObj.getStockArticleId()); |
|
|
|
|
distributionLoadscanEntity.setLoadedNub(packageObj.getQuantity()); |
|
|
|
|
distributionLoadscanEntity.setDeliveryId(deliveryListEntity.getId()); |
|
|
|
|
distributionLoadscanEntity.setScanUser(distributionDeliverySelfEntity.getDriverName()); |
|
|
|
|
distributionLoadscanEntity.setSigningUser(distributionDeliverySelfEntity.getDriverName()); |
|
|
|
|
distributionLoadscanEntity.setSigningUserId(distributionDeliverySelfEntity.getDeliveryId()); |
|
|
|
|
distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.buluzhuangche.getValue()); |
|
|
|
|
distributionLoadscanService.save(distributionLoadscanEntity); |
|
|
|
|
//进行签收数量的修改
|
|
|
|
|
Integer i = distributionDeliveryListMapper.updateloadingTimeById(deliveryListEntity.getId()); |
|
|
|
|
//更新装车包件数和签收包件数
|
|
|
|
|
Integer j = distributionSignforMapper.updateSignforByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub()); |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
user.setNickName(distributionLoadscanEntity.getDriverName()); |
|
|
|
|
//更新签收人
|
|
|
|
|
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), user); |
|
|
|
|
content = "包件在" + entityWarehouseId.getName() + "由" + distributionLoadscanEntity.getSigningUser() + "扫描签收,签收方式:司机未进行装车,由商家端进行异常签收,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationList.get(0).getReservationCode(); |
|
|
|
|
|
|
|
|
|
//失败 -- 无法进行异常签收
|
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
log.error("一个车次内存在两个同样客户"); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
log.error("商家签收车次内不存在该客户"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
List<JSONObject> logs = handleMallLogJSONObject(entityWarehouseId, Long.parseLong(distributionDeliverySelfEntity.getDriverId()), packageObj.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode()); |
|
|
|
|
if (!logs.isEmpty()) { |
|
|
|
|
trunklinePackageTrackLogClient.addPackageTrackLog(logs); |
|
|
|
|
} |
|
|
|
|
//进行包件状态维护
|
|
|
|
|
packageObj.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); |
|
|
|
|
packageObj.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue()); |
|
|
|
|
distributionParcelListService.updateById(packageObj); |
|
|
|
|
//下架解托
|
|
|
|
|
Map<String, Object> info = new HashMap<>(); |
|
|
|
|
warehouseUpdownTypeClient.downPackageAndDelTrayAndIsUpdate(packageObj.getOrderPackageCode(), entityWarehouseId.getId(), "扫描装车进行下架、解托", false); |
|
|
|
|
//维护订单
|
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(stockArticleEntity.getOrderCode(),warehouseId); |
|
|
|
|
//维护车次任务状态
|
|
|
|
|
deliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue()); |
|
|
|
|
distributionDeliveryListService.updateById(deliveryListEntity); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -7424,4 +7669,28 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
trunklinePackageTrackLog.put("operator", user.getNickName()); |
|
|
|
|
return trunklinePackageTrackLog; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<JSONObject> handleMallLogJSONObject(BasicdataWarehouseEntity warehouse, Long userId, String orderPackageCode, String content, Integer node) { |
|
|
|
|
List<JSONObject> trunklinePackageTrackLog = new ArrayList<>(); |
|
|
|
|
JSONObject js = new JSONObject(); |
|
|
|
|
R<User> userR = userClient.userInfoById(userId); |
|
|
|
|
User user = userR.getData(); |
|
|
|
|
js.put("tenantId", user.getTenantId()); |
|
|
|
|
js.put("createTime", new Date()); |
|
|
|
|
js.put("createUser", user.getId()); |
|
|
|
|
js.put("updateUser", user.getId()); |
|
|
|
|
js.put("updateTime", new Date()); |
|
|
|
|
js.put("isDeleted", 0); |
|
|
|
|
js.put("status", 1); |
|
|
|
|
js.put("createDept", warehouse.getDepartment()); |
|
|
|
|
js.put("orderPackageCode", orderPackageCode); |
|
|
|
|
js.put("warehouseId", warehouse.getId()); |
|
|
|
|
js.put("warehouseName", warehouse.getName()); |
|
|
|
|
js.put("workNode", node); |
|
|
|
|
js.put("content", content); |
|
|
|
|
js.put("operator", user.getName()); |
|
|
|
|
trunklinePackageTrackLog.add(js); |
|
|
|
|
return trunklinePackageTrackLog; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|