Browse Source

签收代码提交

dist.1.3.0
汤建军 7 months ago
parent
commit
3093ae2cdf
  1. 49
      blade-biz-common/src/main/java/org/springblade/common/constant/delivery/DeliveryStartStatusConstant.java
  2. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java
  3. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionAppsignforDTO.java
  4. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  5. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationPackageService.java
  6. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java
  7. 54
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  8. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationPackageServiceImpl.java
  9. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  10. 518
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  11. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseRetentionApiController.java
  12. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java

49
blade-biz-common/src/main/java/org/springblade/common/constant/delivery/DeliveryStartStatusConstant.java

@ -0,0 +1,49 @@
package org.springblade.common.constant.delivery;
/**
* 配送状态枚举
* 对应码表
* distribution_signfor_status
* @author pref
*/
public enum DeliveryStartStatusConstant {
daifache("待发车",10),
bufenfache("部分发车",20),
yifache("已发车",30);
/**
* 状态
*/
private String name;
/**
*
*/
private Integer value;
private DeliveryStartStatusConstant(String name, Integer value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getValue() {
return value;
}
public void setValue(Integer value) {
this.value = value;
}
}

15
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java

@ -170,6 +170,21 @@ public class DistributionSignforAppController {
return R.fail("签收失败!");
}
@PostMapping("/newSignfor")
@ApiOperationSupport(order = 2)
public R newSignfor(@Valid @RequestBody DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) {
try {
R r = distributionSignforService.newSignfor(distrilbutionloadingscanDTO);
return r;
} catch (Exception e) {
log.error("#############signfor:签收报错", e);
}
return R.fail("签收失败!");
}
/**
* 司机零担签收
*/

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionAppsignforDTO.java

@ -25,6 +25,12 @@ public class DistrilbutionAppsignforDTO {
@ApiModelProperty(value = "扫描码")
private String barcodes;
/**
* 扫描类型 1-订制品 2-零担 3-库存品
*/
@ApiModelProperty(value = "扫描类型")
private Integer type;
/**
* 配送任务Id

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml

@ -976,7 +976,6 @@
ldsa.order_delivery_status,
group_concat(DISTINCT ldpl.pallet ) as trays,
group_concat(DISTINCT ldpl.goods_allocation) as allocation
from logpm_distribution_stock_article ldsa
left join logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id
<where>

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationPackageService.java

@ -103,4 +103,11 @@ public interface IDistributionReservationPackageService extends BaseService<Dist
String getConcatMaterialName(Long reservationId, Long stockArticleId);
/**
* 查询包件是否存在订制品
* @param reservationId
* @param barcode
* @return
*/
DistributionReservationPackageEntity getPlanPackageByReservationAndCode(Long reservationId, String barcode);
}

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java

@ -376,4 +376,11 @@ public interface IDistributionSignforService extends BaseService<DistributionSig
* @return
*/
Map<String, Object> clerkInventoryCheckPushData(String orderPackageCode);
/**
* 新签收 需要装车限制
* @param distrilbutionloadingscanDTO
* @return
*/
R newSignfor(DistrilbutionAppsignforDTO distrilbutionloadingscanDTO);
}

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

@ -71,6 +71,7 @@ import org.springblade.common.constant.RabbitConstant;
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.DeliveryStartStatusConstant;
import org.springblade.common.constant.delivery.DeliveryStatusConstant;
import org.springblade.common.constant.loading.*;
import org.springblade.common.constant.order.OrderStatusConstant;
@ -4636,6 +4637,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Func.isNotEmpty(isRepeat)){
return Resp.scanFail("请勿重复发车","请勿重复发车");
}
if ("1".equals(distributionDeliveryListEntity.getKind())) {
DistributionDeliverySelfEntity distributionDeliverySelfEntity = getDriver(distributionDeliveryListEntity,user,distrilbutionloadingscanDTO,isDriverFlag);
distributionDeliverySelfEntity.setDepartureTime(format);
@ -4643,14 +4645,15 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
isEnd = isEndDriver(distributionDeliveryListEntity.getId());
} else {
b = distributionDeliveryTripartiteService.update(new UpdateWrapper<DistributionDeliveryTripartiteEntity>().lambda()
.eq(DistributionDeliveryTripartiteEntity::getId, loadingId)
.eq(DistributionDeliveryTripartiteEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
.set(DistributionDeliveryTripartiteEntity::getDepartureTime, format));
isEnd = true;//
}
//处理最后一个司机进行发车
//判断是否是最后一个司机点发车
distributionDeliveryListEntity.setIsStart(DeliveryStartStatusConstant.bufenfache.getValue());
if (isEnd){
distributionDeliveryListEntity.setIsStart(Integer.parseInt(IsOrNoConstant.yes.getValue()));
distributionDeliveryListEntity.setIsStart(DeliveryStartStatusConstant.yifache.getValue());
//进行实际装车和计划数据比对
contrastPlanAndLoading(distributionDeliveryListEntity,myCurrentWarehouse);
//进行发车日志记录
@ -4815,6 +4818,16 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return false;
}
private boolean isFirstDriver(Long deliveryId) {
List<DistributionDeliverySelfEntity> deliverySelfEntities = distributionDeliverySelfService.list(Wrappers.<DistributionDeliverySelfEntity>query().lambda()
.eq(DistributionDeliverySelfEntity::getDeliveryId, deliveryId)
);
if (!deliverySelfEntities.isEmpty()) {
return deliverySelfEntities.stream().allMatch(f -> Objects.isNull(f.getDepartureTime()));
}
return false;
}
private NodeFanoutMsg<CarStartVO> builderNodeFanoutMsgByCarStart(DistributionDeliveryListEntity distributionDeliveryListEntity, BladeUser user) {
NodeFanoutMsg<CarStartVO> nodeFanoutMsg = new NodeFanoutMsg<>();
nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD);
@ -6331,7 +6344,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
DistributionDeliveryListEntity deliveryListEntity = this.getById(deliveryId);
List<DistributionRetentionScanVo> retentionScanVos = new ArrayList<>();
switch (retentionType) {
case 1:
//包件--库存品 和包件
@ -6423,29 +6435,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return Resp.scanFail("此包件存在异常未处理", "此包件存在异常未处理");
}
}
// //如果均不存在则就该判断该货物是否属于当前的配送任务,如果属于则是未装车,如果不属于则此码无效
// List<DistributionParcelListEntity> distributionParcelListEntities = baseMapper.selectPackageListByDeliveryListId(deliveryListEntity.getId());
// boolean flag = false;
// if (Func.isNotEmpty(distributionParcelListEntities)) {
// List<DistributionParcelListEntity> isHave = distributionParcelListEntities.stream().filter(p -> p.getOrderPackageCode().equals(distrilbutionloadingscanDTO.getBarcode())).collect(Collectors.toList());
// if (Func.isNotEmpty(isHave)) {
// flag = isHave.size() == 1;
// //判断是否存在有待处理的异常
// }
// } else {
// List<DisStockListDetailEntity> disStockListDetailEntities = baseMapper.selectInventoryListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
// if (Func.isNotEmpty(disStockListDetailEntities)) {
// List<DisStockListDetailEntity> isHaveinven = disStockListDetailEntities.stream().filter(inven -> Func.isNotEmpty(inven.getStockPackageCode()) && inven.getStockPackageCode().equals(distrilbutionloadingscanDTO.getBarcode())).collect(Collectors.toList());
// if (Func.isNotEmpty(isHaveinven)) {
// flag = isHaveinven.size() == 1;
// }
// }
// }
//
// if (!flag) {
// //存在该订制品或者库存品包件信息但是未进行装车操作
// return Resp.scanFail("包件未装车", "包件未装车");
// }
}
return R.data(retentionScanVos);
}
@ -6520,10 +6509,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//包件存在装车才能进行滞留
//通过配送任务和包件确定预约信息
DistributionLoadscanEntity distributionLoadscanEntity = loadscanEntityList.get(0);
// if (2 == distributionLoadscanEntity.getIsAbnormalLoading()) {
// //异常装车未进行审核
// return Resp.scanFail("包件存在异常操作,请先处理异常", "包件存在异常操作,请先处理异常");
// }
if (2 == distributionLoadscanEntity.getSignforState()) {
log.info("滞留扫描失败,包件已签收>>>>>>>>>>>>>>>>>>>>>>>reservationId:{},packageCode:{}", distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getOrderPackageCode());
return Resp.scanFail("包件已签收", "包件已签收");
@ -8015,6 +8000,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if ("1".equals(distributionDeliveryListEntity.getKind())) {
b = distributionDeliverySelfService.update(new UpdateWrapper<DistributionDeliverySelfEntity>().lambda()
.eq(DistributionDeliverySelfEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
.eq(DistributionDeliverySelfEntity::getDriverId, deliverySelfEntity.getDriverId())
.eq(DistributionDeliverySelfEntity::getId, deliverySelfEntity.getId())
.set(DistributionDeliverySelfEntity::getDepartureTime, null)
);
} else {
@ -8027,7 +8014,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
deletedAbnormalData(distrilbutionloadingscanDTO.getDeliveryId());
//修改主表状态
distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.daipeisong.getValue());
distributionDeliveryListEntity.setIsStart(Integer.parseInt(IsOrNoConstant.no.getValue()));
distributionDeliveryListEntity.setIsStart(DeliveryStartStatusConstant.bufenfache.getValue());
//所有都取消则整个配送任务需要进行数据恢复
Boolean isFirstFlag = isFirstDriver(distrilbutionloadingscanDTO.getDeliveryId());
if (isFirstFlag) {
distributionDeliveryListEntity.setIsStart(DeliveryStartStatusConstant.daifache.getValue());
}
baseMapper.updateById(distributionDeliveryListEntity);
//取消发车日志记录
handleCancelStartLog(distributionDeliveryListEntity,deliverySelfEntity,user,myCurrentWarehouse);

9
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationPackageServiceImpl.java

@ -207,6 +207,15 @@ public class DistributionReservationPackageServiceImpl extends BaseServiceImpl<D
return baseMapper.getConcatMaterialName(reservationId,stockArticleId);
}
@Override
public DistributionReservationPackageEntity getPlanPackageByReservationAndCode(Long reservationId, String barcode) {
return this.getOne(Wrappers.<DistributionReservationPackageEntity>query().lambda()
.eq(DistributionReservationPackageEntity::getReservationId,reservationId)
.eq(DistributionReservationPackageEntity::getPacketBarCode,barcode)
.ne(DistributionReservationPackageEntity::getPacketBarStatus,ReservationPackageStatusConstant.quxiao.getValue())
);
}
private JSONObject handleLogJSONObject(BasicdataWarehouseEntity warehouse, BladeUser user, String orderPackageCode, String content, Integer node) {
JSONObject trunklinePackageTrackLog = new JSONObject();
trunklinePackageTrackLog.put("tenantId",user.getTenantId());

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

@ -3765,13 +3765,11 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
boolean stockUpStatus = false;
if (Func.isNotEmpty(distributionParcelListEntities)) {
loadStatus = distributionParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()));
// signStatus = distributionParcelListEntities.stream().allMatch(p->p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue()));
stockUpStatus = distributionParcelListEntities.stream().allMatch(p -> p.getOrderPackageStockupStatus().equals(OrderPackageStockupStatusConstant.yibeihu.getValue()));
}
if (Func.isNotEmpty(disStockListDetailEntities)) {
loadStatus = disStockListDetailEntities.stream().allMatch(p -> p.getStockLockingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()));
// signStatus = disStockListDetailEntities.stream().anyMatch(p->p.getStockSignfoStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue()));
stockUpStatus = disStockListDetailEntities.stream().allMatch(p -> p.getStockStatus().equals(OrderPackageStockupStatusConstant.yibeihu.getValue()));
}

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

@ -69,6 +69,7 @@ import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.billLading.BillLadingStatusConstant;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.delivery.DeliveryLoadingStatusConstant;
import org.springblade.common.constant.delivery.DeliveryStartStatusConstant;
import org.springblade.common.constant.delivery.DeliveryStatusConstant;
import org.springblade.common.constant.loading.*;
import org.springblade.common.constant.orderpackage.*;
@ -775,7 +776,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
packageData.setPackageCode(distributionLoadscaninvnEntity.getOrderPackageCode());
packageData.setBrand(byIds.getBrandName());
// packageData.setProductName(byId.getDescriptionGoods());
packageData.setMallName(StringUtil.isBlank(byIds.getMallName())? byIds.getMarketName():byIds.getMallName());
packageData.setMallName(StringUtil.isBlank(byIds.getMallName()) ? byIds.getMarketName() : byIds.getMallName());
packageData.setMaterialCode(byIds.getCargoNumber());
packageData.setMaterialName(byIds.getDescriptionGoods());
@ -2659,8 +2660,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
List<String> orderPackageCodes = new ArrayList<>();
List<JSONObject> aaa = new ArrayList<>();
List<DistributionLoadscanEntity> pushList = new ArrayList<>();
List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId());
@ -2696,8 +2695,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (loadscanEntity.getSignforState().equals(2)) {
return Resp.scanFail("重复扫描", "包件已签收");
}
//存在装车记录,进行修改即可
//进行签收记录数据的维护
loadscanEntity.setSigningTime(singleTime);
@ -2707,7 +2704,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
loadscanEntity.setIsInsert(2);
loadscanEntity.setReceivedQuantity(loadscanEntity.getLoadedNub());
packageLockIds.add(loadscanEntity.getPackageId());
loadscanEntity.setSigningUser(nickName);
loadscanEntity.setSigningUserId(userId);
loadscanEntity.setSignforType(LoadScanSigningTypeStatusConstant.sijiqianshou.getValue());
@ -2852,9 +2848,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
log.warn("#####################distributionParcelListEntities窜货 {}", distributionParcelListEntities);
return Resp.scanFail("窜货", "窜货");
} else {
//判断该货物是否属于该客户
// 异常签收
// return Resp.scanFail("异常签收包件","异常签收包件");
//判断客户
boolean flag = judgmentClient(distributionReservationEntity, parcelListEntity.getStockArticleId());
if (flag) {
@ -2912,7 +2905,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 节点作业推送
sendNodeWorkDataBroadcast(parcelListEntity, distributionReservationEntity, singleTime, myCurrentWarehouse);
// 构建新作业节点回传
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity,distributionReservationEntity, pushList);
@ -2959,7 +2951,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
packageData.setPackageCode(distributionParcelListEntity.getOrderPackageCode());
packageData.setBrand(byIds.getBrandName());
packageData.setMallName(StringUtil.isBlank(byIds.getMallName())? byIds.getMarketName():byIds.getMallName());
packageData.setMallName(StringUtil.isBlank(byIds.getMallName()) ? byIds.getMarketName() : byIds.getMallName());
// packageData.setProductName(byId.getDescriptionGoods());
packageData.setMaterialCode(byIds.getCargoNumber());
packageData.setMaterialName(byIds.getDescriptionGoods());
@ -7334,6 +7326,510 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return resultMap;
}
@Override
public R newSignfor(DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) {
String method = "#################################DistributionSignforServiceImpl.newSignfor";
//参数校验
if (Func.isEmpty(distrilbutionloadingscanDTO.getDeliveryId())) {
log.error(method + "DeliveryId参数缺失");
return Resp.scanFail("参数缺失,请联系管理员", "参数缺失,请联系管理员");
}
if (Func.isEmpty(distrilbutionloadingscanDTO.getReservationId())) {
log.error(method + "ReservationId参数缺失");
return Resp.scanFail("参数缺失,请联系管理员", "参数缺失,请联系管理员");
}
if (Func.isEmpty(distrilbutionloadingscanDTO.getType())) {
log.error(method + "Type参数缺失");
return Resp.scanFail("参数缺失,请联系管理员", "参数缺失,请联系管理员");
}
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)) {
return R.fail(403, "仓库信息不能为空");
}
Long deliveryId = distrilbutionloadingscanDTO.getDeliveryId();
Long reservationId = distrilbutionloadingscanDTO.getReservationId();
Integer type = distrilbutionloadingscanDTO.getType();
String barcode = "";
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(deliveryId);
if (Objects.isNull(deliveryListEntity)) {
log.error(method + "查询配送信息错误,deliveryId:{}",deliveryId);
return Resp.scanFail("查询配送信息错误,请联系管理员", "查询配送信息错误,请联系管理员");
}
if (DeliveryStatusConstant.yiwancheng.getValue().equals(deliveryListEntity.getDeliveryStatus())){
log.error(method + "当前配送已完成,deliveryId:{}",deliveryId);
return Resp.scanFail("当前配送已完成", "当前配送已完成");
}
DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId);
if (Objects.isNull(reservationEntity)) {
log.error(method + "查询预约计划错误,reservationId:{}",reservationId);
return Resp.scanFail("查询配送信息错误,请联系管理员", "查询配送信息错误,请联系管理员");
}
//查询是否完成复核
DistributionSignforEntity signforEntity = this.getOne(Wrappers.<DistributionSignforEntity>query().lambda()
.eq(DistributionSignforEntity::getReservationId, reservationId)
);
if (Objects.isNull(signforEntity)) {
//查询签收信息错误
log.error("签收扫描查询签收表信息错误reservationId:{}", distrilbutionloadingscanDTO.getReservationId());
return R.fail(403, "配送任务错误");
}
if (SignforStatusConstant.yiqianshou.getValue().equals(signforEntity.getSigningStatus())) {
return Resp.scanFail("此任务已完成复核", "此任务已完成复核");
}
BladeUser user = AuthUtil.getUser();
List<Long> packageLockIds = new ArrayList<>();
List<String> orderCodes = new ArrayList<>();
List<DistributionLoadscanEntity> pushList = new ArrayList<>();
//配置项
boolean isConfig = false;
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, distrilbutionloadingscanDTO.getDeliveryId())
);
} else {
DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectOne(new QueryWrapper<DistributionDeliveryTripartiteEntity>().lambda()
.eq(DistributionDeliveryTripartiteEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()));
BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity);
}
switch (type) {
case 1:
if (Func.isEmpty(distrilbutionloadingscanDTO.getBarcode())) {
log.error(method + "Barcode参数缺失");
return Resp.scanFail("参数缺失,请联系管理员", "参数缺失,请联系管理员");
}
barcode = distrilbutionloadingscanDTO.getBarcode();
DistributionParcelListEntity parcelListEntity = distributionParcelListService.selectByOrderPackageCode(distrilbutionloadingscanDTO.getBarcode(), myCurrentWarehouse.getId());
if (Objects.isNull(parcelListEntity)) {
List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getStockPackageCode, distrilbutionloadingscanDTO.getBarcode())
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
if (!list.isEmpty()){
return Resp.scanFail("请在库存品扫描此码", "请在库存品扫描此码");
}
return Resp.scanFail("系统无编码", "系统无编码");
}
if (parcelListEntity.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) {
return Resp.scanFail("包件已签收", "包件已签收");
}
List<JSONObject> aaa = new ArrayList<>();
DistributionReservationPackageEntity planPackage = distributionReservationPackageService.getPlanPackageByReservationAndCode(reservationId,barcode);
if (Objects.isNull(planPackage)){
List<DistributionLoadscanAbnormalEntity> abnormalEntities = distributionLoadscanAbnormalService.list(Wrappers.<DistributionLoadscanAbnormalEntity>query().lambda()
.eq(DistributionLoadscanAbnormalEntity::getPackageCode, barcode)
.eq(DistributionLoadscanAbnormalEntity::getGoodsType, 1)
.eq(DistributionLoadscanAbnormalEntity::getAbnormalType, 3)
.eq(DistributionLoadscanAbnormalEntity::getAuditingStatus, LoadingAbnormalAuditingStatusConstant.daishenhe.getValue())
//修改 状态
);
if (!abnormalEntities.isEmpty()) {
//判断是否是本车次的异常操作
boolean isFlag = abnormalEntities.stream().allMatch(a -> reservationId.equals(a.getReservationId()));
if (!isFlag){
return Resp.scanFail("存在异常未处理","存在异常未处理");
}
}
//查询此包件是否有进行装车
DistributionLoadscanEntity loadscanEntity = distributionLoadscanService.getOne(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, deliveryId)
.eq(DistributionLoadscanEntity::getReservationId, reservationId)
.eq(DistributionLoadscanEntity::getOrderPackageCode, barcode)
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
DistributionLoadscanEntity distributionLoadscanEntity = new DistributionLoadscanEntity();
if (!Objects.isNull(loadscanEntity)) {
distributionLoadscanEntity = updateSignDistributionLoadscanEntity(loadscanEntity,user,parcelListEntity);
distributionLoadscanService.updateById(distributionLoadscanEntity);
//缺少一个异步维护包件签收的方法
distributionSignforMapper.updateSignforNum(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
//更新签收人
distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), user);
//维护订单状态
String content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntity.getSigningUser() + "扫描签收,装车方式:扫描装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
aaa.add(trunklinePackageTrackLog);
} else {
//存在配置要求必须装车才能进行签收
if (isConfig){
return Resp.scanFail("当前包件未装车","当前包件未装车");
}
distributionLoadscanEntity = createdSignDistributionLoadscanEntity(parcelListEntity,deliveryListEntity,reservationEntity,user,myCurrentWarehouse,distributionDeliverySelfEntity);
//不存在装车需要进行补录
distributionLoadscanService.save(distributionLoadscanEntity);
//进行签收数量的修改
distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新装车包件数和签收包件数
distributionSignforMapper.updateSignforByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
//更新签收人
distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser());
String content = "包件在" + myCurrentWarehouse.getName() + "由" + distributionLoadscanEntity.getSigningUser() + "扫描签收,装车方式:补录装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
aaa.add(trunklinePackageTrackLog);
}
//下架解托
if (StringUtils.isNotBlank(distributionLoadscanEntity.getOrderPackageCode())) {
warehouseUpdownTypeClient.downPackageOrDelTray(distributionLoadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
}
pushList.add(distributionLoadscanEntity);
packageLockIds.add(distributionLoadscanEntity.getPackageId());
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
distributionParcelListService.updateById(parcelListEntity);
//维护签收包件状态
orderCodes.add(parcelListEntity.getOrderCode());
} else {
//判断当前包件是否已进行签收
//判断客户
boolean flag = judgmentClient(reservationEntity, parcelListEntity.getStockArticleId());
if (flag) {
return R.fail(3006, null);
} else {
return Resp.scanFail("不属于当前签收客户", "不属于当前签收客户");
}
}
//维护客户
distributionReservationService.maintenanceReservationInfo(distrilbutionloadingscanDTO.getReservationId());
//维护配送任务
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId());
trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
String singleTime = simpleDateFormat.format(new Date());
// 节点作业推送
sendNodeWorkDataBroadcast(parcelListEntity, reservationEntity, singleTime, myCurrentWarehouse);
// 构建新作业节点回传
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity,reservationEntity, pushList);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
break;
case 2:
//零担
if (Func.isEmpty(distrilbutionloadingscanDTO.getParcelListDTOS())) {
log.error(method + "ParcelListDTOS参数缺失");
return Resp.scanFail("参数缺失,请联系管理员", "参数缺失,请联系管理员");
}
List<DistributionParcelNumberDTO> parcelNumberDTOS = distrilbutionloadingscanDTO.getParcelListDTOS();
Integer loadedNumber = signforEntity.getLoadedNumber();
Integer receivedQuantity = signforEntity.getReceivedQuantity();
if (!parcelNumberDTOS.isEmpty()) {
List<Long> packageIds = parcelNumberDTOS.stream().map(DistributionParcelNumberDTO::getParcelListId).collect(Collectors.toList());
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())
.eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
.eq(DistributionLoadscanEntity::getOrderId, distrilbutionloadingscanDTO.getOrderId())
.in(DistributionLoadscanEntity::getPackageId, packageIds)
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
Map<Long, List<DistributionLoadscanEntity>> loadingMap = null;
Map<Long, List<DistributionReservationZeroPackageEntity>> reservationMap = null;
if (!loadscanEntityList.isEmpty()) {
int sum1 = loadscanEntityList.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum();
int sum2 = loadscanEntityList.stream().mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum();
loadedNumber = loadedNumber - sum1;
receivedQuantity = receivedQuantity - sum2;
loadingMap = loadscanEntityList.stream().collect(Collectors.groupingBy(DistributionLoadscanEntity::getPackageId));
}
//查询对应的计划品类
List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntity = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
.eq(DistributionReservationZeroPackageEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())
.in(DistributionReservationZeroPackageEntity::getParcelListId, packageIds)
.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()));
if (!reservationZeroPackageEntity.isEmpty()) {
reservationMap = reservationZeroPackageEntity.stream().collect(Collectors.groupingBy(DistributionReservationZeroPackageEntity::getParcelListId));
}
List<JSONObject> jsonObjects = new ArrayList<>();
for (DistributionParcelNumberDTO parcelNumberDTO : parcelNumberDTOS) {
List<DistributionReservationZeroPackageEntity> zeroPackageEntities = reservationMap.get(parcelNumberDTO.getParcelListId());
DistributionParcelNumberEntity distributionParcelNumberEntity = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().lambda()
.eq(DistributionParcelNumberEntity::getParcelListId, parcelNumberDTO.getParcelListId())
);
DistributionParcelListEntity zeroParcelListEntity = distributionParcelListService.getById(parcelNumberDTO.getParcelListId());
orderCodes.add(zeroParcelListEntity.getOrderCode());
packageLockIds.add(zeroParcelListEntity.getId());
if (zeroPackageEntities.size() == 1) {
DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = zeroPackageEntities.get(0);
//查询是否存在装车
Integer deliveryNumber = 0;
Integer handQuantity = 0;
Integer outboundQuantity = 0;
Integer signinQuantity = 0;
if (Func.isNotEmpty(loadingMap)) {
//存在装车数据,进行是否签收判断
List<DistributionLoadscanEntity> entityList = loadingMap.get(parcelNumberDTO.getParcelListId());
if (entityList.size() == 1) {
DistributionLoadscanEntity distributionLoadscanEntity = entityList.get(0);
if (parcelNumberDTO.getSigningNum() > distributionReservationZeroPackageEntity.getQuantity()) {
log.info("#############零担签收超过计划数量ParcelListId:{},计划:{}录入,:{}", parcelNumberDTO.getParcelListId(), distributionReservationZeroPackageEntity.getQuantity(), parcelNumberDTO.getSigningNum());
}
int a = 0;
if (distributionLoadscanEntity.getLoadedNub() < parcelNumberDTO.getSigningNum()) {
//将装车和签收进行统一数量
distributionLoadscanEntity.setLoadedNub(parcelNumberDTO.getSigningNum());
distributionLoadscanEntity.setPackageNub(parcelNumberDTO.getSigningNum());
a = parcelNumberDTO.getSigningNum() - distributionLoadscanEntity.getLoadedNub();
}
deliveryNumber = distributionParcelNumberEntity.getDeliveryQuantity() + distributionLoadscanEntity.getReceivedQuantity() - parcelNumberDTO.getSigningNum();
handQuantity = distributionParcelNumberEntity.getHandQuantity() + distributionLoadscanEntity.getReceivedQuantity() - parcelNumberDTO.getSigningNum();
outboundQuantity = distributionParcelNumberEntity.getOutboundQuantity() - distributionLoadscanEntity.getReceivedQuantity() + parcelNumberDTO.getSigningNum();
signinQuantity = distributionParcelNumberEntity.getSigninQuantity() - distributionLoadscanEntity.getReceivedQuantity() + parcelNumberDTO.getSigningNum();
distributionLoadscanEntity.setWarehouseId(myCurrentWarehouse.getId());
distributionLoadscanEntity.setWarehouseName(myCurrentWarehouse.getName());
distributionLoadscanEntity.setReceivedQuantity(parcelNumberDTO.getSigningNum());
distributionLoadscanEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue());
distributionLoadscanEntity.setScanTime(simpleDateFormat.format(new Date()));
distributionLoadscanEntity.setSigningUser(user.getNickName());
distributionLoadscanEntity.setSigningUserId(user.getUserId());
distributionLoadscanEntity.setSignforType(LoadScanSigningTypeStatusConstant.sijiqianshou.getValue());
distributionLoadscanEntity.setSigningTime(simpleDateFormat.format(new Date()));
distributionLoadscanEntity.setSigningUser(user.getNickName());
loadedNumber += parcelNumberDTO.getSigningNum();
receivedQuantity += parcelNumberDTO.getSigningNum();
//进行签收数量的统计
distributionLoadscanService.updateById(distributionLoadscanEntity);
pushList.add(distributionLoadscanEntity);
JSONObject jsonObject = new JSONObject();
jsonObject.put("code", zeroParcelListEntity.getOrderCode());
jsonObject.put("warehouseId", myCurrentWarehouse.getId());
jsonObject.put("taskId", distributionLoadscanEntity.getReservationId());
jsonObject.put("type", 3);
jsonObject.put("num", a);
jsonObject.put("remark", "签收下架");
jsonObjects.add(jsonObject);
} else {
log.info("#############零担签收存在多个装车记录ParcelListId:{}", parcelNumberDTO.getParcelListId());
}
} else {
//签收装车数据一起进行补录
DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity();
loadscanEntity.setPackageId(distributionParcelNumberEntity.getParcelListId());
loadscanEntity.setOrderId(distributionParcelNumberEntity.getStockArticleId());
loadscanEntity.setDeliveryId(signforEntity.getDeliveryId());
loadscanEntity.setReservationId(signforEntity.getReservationId());
loadscanEntity.setScanUser(user.getNickName());
loadscanEntity.setWarehouseId(myCurrentWarehouse.getId());
loadscanEntity.setWarehouseName(myCurrentWarehouse.getName());
loadscanEntity.setScanTime(simpleDateFormat.format(new Date()));
loadscanEntity.setSigningUser(user.getNickName());
loadscanEntity.setPackageNub(parcelNumberDTO.getSigningNum());
loadscanEntity.setLoadedNub(parcelNumberDTO.getSigningNum());
loadscanEntity.setSigningUserId(user.getUserId());
assert distributionDeliverySelfEntity != null;
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverId())) {
loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) {
loadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())) {
loadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())) {
loadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) {
loadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
loadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString());
loadscanEntity.setScanStatus(LoadingStatusConstant.buluzhuangche.getValue());
loadscanEntity.setIsInsert(LoadingIsInsertConstant.bulu.getValue());
loadscanEntity.setScanType("1");
loadscanEntity.setType(2);
loadscanEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue());
loadscanEntity.setIsSignfor(1);
loadscanEntity.setReceivedQuantity(parcelNumberDTO.getSigningNum());
loadscanEntity.setOneClick(2);
loadscanEntity.setOneQclick(2);
loadscanEntity.setSigningTime(simpleDateFormat.format(new Date()));
distributionLoadscanService.save(loadscanEntity);
pushList.add(loadscanEntity);
loadedNumber += loadscanEntity.getLoadedNub();
receivedQuantity += loadscanEntity.getReceivedQuantity();
//维护零担品类信息
deliveryNumber = distributionParcelNumberEntity.getDeliveryQuantity() - parcelNumberDTO.getSigningNum();
handQuantity = distributionParcelNumberEntity.getHandQuantity() - parcelNumberDTO.getSigningNum();
outboundQuantity = distributionParcelNumberEntity.getOutboundQuantity() + parcelNumberDTO.getSigningNum();
signinQuantity = distributionParcelNumberEntity.getSigninQuantity() + parcelNumberDTO.getSigningNum();
JSONObject jsonObject = new JSONObject();
jsonObject.put("code", parcelListEntity.getOrderCode());
jsonObject.put("warehouseId", myCurrentWarehouse.getId());
jsonObject.put("taskId", loadscanEntity.getReservationId());
jsonObject.put("type", 3);
jsonObject.put("num", loadscanEntity.getLoadedNub());
jsonObject.put("remark", "签收下架");
jsonObjects.add(jsonObject);
warehouseUpdownStockUpAreaClient.downStockUpShelf(jsonObjects);
}
//维护订单
if (outboundQuantity.equals(distributionParcelNumberEntity.getQuantity())) {
zeroParcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
}
if (handQuantity == 0) {
zeroParcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue());
}
if (receivedQuantity.equals(distributionParcelNumberEntity.getQuantity())) {
zeroParcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
}
distributionParcelListService.updateById(zeroParcelListEntity);
DistributionParcelNumberEntity parcelNumberEntity = new DistributionParcelNumberEntity();
parcelNumberEntity.setId(distributionParcelNumberEntity.getId());
parcelNumberEntity.setDeliveryQuantity(deliveryNumber);
parcelNumberEntity.setOutboundQuantity(outboundQuantity);
parcelNumberEntity.setSigninQuantity(signinQuantity);
parcelNumberEntity.setHandQuantity(handQuantity);
distributionParcelNumberService.updateById(parcelNumberEntity);
} else {
log.info("#############零担签收查询计划错误ParcelListId:{}", parcelNumberDTO.getParcelListId());
}
}
}
break;
case 3:
if (Func.isEmpty(distrilbutionloadingscanDTO.getBarcode())) {
log.error(method + "Barcode参数缺失");
return Resp.scanFail("参数缺失,请联系管理员", "参数缺失,请联系管理员");
}
//库存品
List<DisStockListDetailEntity> detailEntities = distributionReservationMapper.selectInventoryListByReservation(distrilbutionloadingscanDTO.getReservationId());
if (detailEntities.isEmpty()) {
DistributionParcelListEntity isFlag = distributionParcelListService.selectByOrderPackageCode(distrilbutionloadingscanDTO.getBarcode(), myCurrentWarehouse.getId());
if (!Objects.isNull(isFlag)) {
return Resp.scanFail("请在订制品扫描此码","请在订制品扫描此码");
}
return Resp.scanFail("系统无编码","系统无编码");
}
boolean isHaveCode = detailEntities.stream().allMatch(inven -> Func.isEmpty(inven.getStockPackageCode()));
if (isHaveCode) {
return Resp.scanFail("库存品未备货","库存品未备货");
}
List<DisStockListDetailEntity> inventoryPakcgaeList = detailEntities.stream().filter(f -> barcode.equals(f.getStockPackageCode())).collect(Collectors.toList());
if (!inventoryPakcgaeList.isEmpty()) {
if (inventoryPakcgaeList.size() == 1) {
DisStockListDetailEntity disStockListDetailEntity = inventoryPakcgaeList.get(0);
DistributionLoadscaninvnEntity loadscaninvnEntity = distributionLoadscaninvnService.getOne(Wrappers.<DistributionLoadscaninvnEntity>query().lambda()
.eq(DistributionLoadscaninvnEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())
.eq(DistributionLoadscaninvnEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
.eq(DistributionLoadscaninvnEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())
.ne(DistributionLoadscaninvnEntity::getScanStatus, 1));
}
}
break;
}
if (!packageLockIds.isEmpty()) {
List<Long> a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryListEntity.getTrainNumber() + "orderPackageCode:" + packageLockIds);
if (Func.isNotEmpty(a)) {
boolean flag = a.stream().anyMatch(any -> packageLockIds.contains(any));
if (flag) {
//正在操作,请稍后重试
throw new CustomerException("该包件正在被操作,请稍后再试!!!");
} else {
packageLockIds.addAll(a);
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryListEntity.getTrainNumber() + "orderPackageCode:" + packageLockIds, packageLockIds, 60L);
}
} else {
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryListEntity.getTrainNumber() + "orderPackageCode:" + packageLockIds, packageLockIds, 60L);
}
}
if (!orderCodes.isEmpty()) {
String collect = orderCodes.stream().distinct().collect(Collectors.joining(","));
distributionStockArticleService.maintenanceOrderInfo(collect, myCurrentWarehouse.getId());
}
String str = checkSignNum(distrilbutionloadingscanDTO);
return Resp.scanSuccess("签收成功", str);
}
/**
* 修改装车为签收数据
* @param loadscanEntity
* @param user
* @param parcelListEntity
* @return
*/
private DistributionLoadscanEntity updateSignDistributionLoadscanEntity(DistributionLoadscanEntity loadscanEntity, BladeUser user, DistributionParcelListEntity parcelListEntity) {
String now = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date());
loadscanEntity.setSigningTime(now);
loadscanEntity.setSignforState(2);
loadscanEntity.setOneClick(1);
loadscanEntity.setOneQclick(1);
loadscanEntity.setIsInsert(2);
loadscanEntity.setReceivedQuantity(parcelListEntity.getQuantity());
loadscanEntity.setSigningUser(user.getNickName());
loadscanEntity.setSigningUserId(user.getUserId());
loadscanEntity.setSignforType(LoadScanSigningTypeStatusConstant.sijiqianshou.getValue());
return loadscanEntity;
}
/**
* 进行签收补录装车数据
* @param parcelListEntity
* @param deliveryListEntity
* @param reservationEntity
* @param user
* @param myCurrentWarehouse
* @param distributionDeliverySelfEntity
* @return
*/
private DistributionLoadscanEntity createdSignDistributionLoadscanEntity(DistributionParcelListEntity parcelListEntity, DistributionDeliveryListEntity deliveryListEntity, DistributionReservationEntity reservationEntity, BladeUser user, BasicdataWarehouseEntity myCurrentWarehouse, DistributionDeliverySelfEntity distributionDeliverySelfEntity) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
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(parcelListEntity.getId());
distributionLoadscanEntity.setWarehouseId(myCurrentWarehouse.getId());
distributionLoadscanEntity.setWarehouseName(myCurrentWarehouse.getName());
distributionLoadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode());
Date signingTime = new Date(System.currentTimeMillis() + (1000 * 60));
distributionLoadscanEntity.setSigningTime(simpleDateFormat.format(signingTime));
distributionLoadscanEntity.setReceivedQuantity(parcelListEntity.getQuantity());
distributionLoadscanEntity.setReservationId(reservationEntity.getId());
distributionLoadscanEntity.setIsSignfor(2);
distributionLoadscanEntity.setIsInsert(2);
distributionLoadscanEntity.setSignforState(2);
distributionLoadscanEntity.setOneClick(1);
distributionLoadscanEntity.setOneQclick(1);
distributionLoadscanEntity.setIsInsert(2);
distributionLoadscanEntity.setTrainNumber(deliveryListEntity.getTrainNumber());
distributionLoadscanEntity.setPackageNub(parcelListEntity.getQuantity());
distributionLoadscanEntity.setOrderId(parcelListEntity.getStockArticleId());
distributionLoadscanEntity.setLoadedNub(parcelListEntity.getQuantity());
distributionLoadscanEntity.setDeliveryId(deliveryListEntity.getId());
distributionLoadscanEntity.setScanUser(AuthUtil.getUser().getNickName());
distributionLoadscanEntity.setSigningUser(AuthUtil.getUser().getNickName());
distributionLoadscanEntity.setSigningUserId(AuthUtil.getUser().getUserId());
distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.buluzhuangche.getValue());
distributionLoadscanEntity.setSignforType(LoadScanSigningTypeStatusConstant.sijiqianshou.getValue());
return distributionLoadscanEntity;
}
private void buildNameAndPhone(List<SignPushDataUnitDTO> pushOldPackageSigning) {
for (SignPushDataUnitDTO signPushDataUnitDTO : pushOldPackageSigning) {
User user = bladeRedis.get(RedisKeyConstant.USER_NAME_PHONE_KEY + signPushDataUnitDTO.getAdministratorsId());

1
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseRetentionApiController.java

@ -74,6 +74,7 @@ public class WarehouseRetentionApiController {
return R.data(warehouseRetentionRecordVO);
}
@PostMapping("/saveRetentionList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "保存滞留扫描列表", notes = "传入trayTypeDTO")

6
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java

@ -184,11 +184,15 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
log.error("############用户提交空滞留列表");
return Resp.scanFail("操作失败", "无滞留包件信息");
}
//对滞留订制品包件进行去重
BladeUser user = AuthUtil.getUser();
AtomicInteger retentionTotal = new AtomicInteger();
AtomicBoolean saveFlah = new AtomicBoolean(false);
//查询出该滞留任务是否存在
List<WarehouseRetentionScanEntity> retentionScanEntityList = warehouseRetentionScanService.list(Wrappers.<WarehouseRetentionScanEntity>query().lambda()
.eq(WarehouseRetentionScanEntity::getDeliveryId, warehouseRetentionRecordDTO.getDeliveryId())
);
warehouseRetentionScanDTOS.forEach(r -> {
//查询是否进行多次滞留
WarehouseRetentionScanEntity retentionScanServiceOne = warehouseRetentionScanService.getOne(Wrappers.<WarehouseRetentionScanEntity>query().lambda()

Loading…
Cancel
Save