Browse Source

商家端进行签收

master
汤建军 10 months ago
parent
commit
111f83643f
  1. 2
      blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java
  2. 1
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanEntity.java
  3. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java
  4. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java
  5. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  6. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  7. 305
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

2
blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java

@ -62,7 +62,7 @@ public enum WorkNodeEnums implements Serializable {
CANCEL_DELIVERY(301030, "计划取消"),
PLAN_BILLOFLADING(301040, "计划自提"),
CANCEL_BILLOFLADING(301050, "取消自提"),
SIGN_BILLOFLADING(301050, "取消自提"),
SIGN_BILLOFLADING(301050, "自提签收"),
PLAN_DISTRIBUTION(301060, "计划配车"),
CANCEL_DISTRIBUTION(301070, "取消配车"),

1
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanEntity.java

@ -348,6 +348,7 @@ public class DistributionLoadscanEntity extends TenantEntity {
@ApiModelProperty(value = "是否异常装车 1-否 2-是")
private Integer isAbnormalLoading;
/**
* 是否异常装车 1- 2-
*/

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java

@ -423,9 +423,9 @@ public class DistributionDeliveryListController extends BladeController {
@GetMapping("/judgmentOrderRemove")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "判断是否可以在商配计划中移除", notes = "customArgs")
public R<Boolean> judgmentOrderRemove(@RequestParam Long deliveryId,@RequestParam String orderIds) {
boolean result = distributionDeliveryListService.judgmentOrderRemove(deliveryId,orderIds);
return R.data(result);
public R judgmentOrderRemove(@RequestParam Long deliveryId,@RequestParam String orderIds) {
R result = distributionDeliveryListService.judgmentOrderRemove(deliveryId,orderIds);
return result;
}
@PostMapping("/printBatch")

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java

@ -167,8 +167,6 @@ public class DistributionStockArticleController extends BladeController {
public R<List<DistributionParcelNumberVO>> getZeroOrderDetail(@ApiIgnore @RequestParam Long id) {
List<DistributionParcelNumberVO> parcelNumberVOS = distributionStockArticleService.getZeroOrderDetail(id);
return R.data(parcelNumberVOS);
// IPage<DistributionStockArticleEntity> pages = distributionStockArticleService.pageWhole(Condition.getPage(query), distributionStockArticle);
// return R.data(DistributionStockArticleWrapper.build().pageVO(pages));
}

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml

@ -908,7 +908,7 @@
ldbls.create_user AS distribution_contact_id,
ldbls.bill_lading_id AS distributionId,
ldbl.pickup_batch AS transNo,
ldsa.waybill_number AS waybillNo,
ldpl.waybill_number AS waybillNo,
ldsa.order_code AS orderSelfNum,
IFNULL(ldbls.packet_bar_code,'') AS unitNo,
2 AS type,
@ -929,6 +929,7 @@
LEFT JOIN logpm_distrilbution_bill_lading AS ldbl ON ldbls.bill_lading_id = ldbl.id AND ldbl.is_deleted = 0
LEFT JOIN logpm_distribution_stock_article AS ldsa ON ldbls.stock_article_id = ldsa.id AND ldsa.is_deleted = 0
LEFT JOIN logpm_warehouse_warehouse AS lww ON ldbl.warehouse_id = lww.id
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldbls.parce_list_id = ldpl.id
WHERE
bill_lading_id = #{id} AND ldbls.is_deleted = 0 AND ldbls.scan_type = 1
</select>

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

@ -401,7 +401,7 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
* @param
* @return
*/
boolean judgmentOrderRemove(Long deliveryId, String orderIds);
R judgmentOrderRemove(Long deliveryId, String orderIds);
/**
* 维护配送任务的配送数量

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

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

Loading…
Cancel
Save