Browse Source

add:

1.增签收作业的作业方式
dist.1.3.0
pref_mail@163.com 7 months ago
parent
commit
91ab527db4
  1. 11
      blade-biz-common/src/main/java/org/springblade/common/constant/OperatModeConstant.java
  2. 4
      blade-biz-common/src/main/java/org/springblade/common/model/DistributionSignforVO.java
  3. 157
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  4. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionNodeWorkServiceImpl.java
  5. 25
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

11
blade-biz-common/src/main/java/org/springblade/common/constant/OperatModeConstant.java

@ -0,0 +1,11 @@
package org.springblade.common.constant;
/**
* 操作方式常量类
*/
public interface OperatModeConstant {
public static final String SCAN = "扫描";
public static final String BATCH = "批量";
}

4
blade-biz-common/src/main/java/org/springblade/common/model/DistributionSignforVO.java

@ -33,6 +33,10 @@ public class DistributionSignforVO implements Serializable {
*/
private String reservationCode;
/**
* 操作方式 扫描 | 批量
*/
private String operatMode;
/**
* 预约数据列表
* 包含包件 零担 库存破

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

@ -1053,7 +1053,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
if(CollUtil.isNotEmpty(pushNodeList)){
if (CollUtil.isNotEmpty(pushNodeList)) {
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(distrilbutionloadingscanDTO.getDeliveryId());
@ -1109,7 +1109,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
private NodeFanoutMsg<DistributionLoadVO> buildNodeFanoutMsgByPackage(DistributionDeliveryListEntity distributionDeliveryListEntity, List<DistributionLoadscanEntity> pushNodeList) {
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD);
@ -1200,7 +1199,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return jsonArray;
}
private NodeFanoutMsg<DistributionLoadVO> buildNodeFanoutMsgByStock(DistributionDeliveryListEntity distributionDeliveryListEntity,DistributionReservationEntity reservationEntity, List<DistributionLoadscaninvnEntity> ts) {
private NodeFanoutMsg<DistributionLoadVO> buildNodeFanoutMsgByStock(DistributionDeliveryListEntity distributionDeliveryListEntity, DistributionReservationEntity reservationEntity, List<DistributionLoadscaninvnEntity> ts) {
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD);
nodeFanoutMsg.setNode(WorkNodeEnums.DISTRIBUTION_LOADING);
@ -1259,7 +1258,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
packageData.setMallName(stockListEntity.getMallName());
BasicMaterialEntity materialOwnId = basicMaterialClient.getMaterialOwnId(stockListEntity.getMaterialId());
if(materialOwnId!=null){
if (materialOwnId != null) {
packageData.setMaterialCode(materialOwnId.getProductCode());
}
packageData.setMaterialName(stockListEntity.getDescriptionGoods());
@ -1967,7 +1966,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(distrilbutionloadingscanDTO.getDeliveryId());
DistributionReservationEntity reservationEntity = distributionReservationService.getById(distrilbutionloadingscanDTO.getReservationId());
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByStock(deliveryListEntity,reservationEntity, ts);
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByStock(deliveryListEntity, reservationEntity, ts);
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser());
String msg = getLoadingMsg(distrilbutionloadingscanDTO);
return Resp.scanSuccess("扫描成功", msg);
@ -2685,7 +2684,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getValue());
reservationEntity.setSigningStatus(ReservationSigningStatusConstant.daiqianshou.getValue());
reservationEntity.setStatus(1);
Map<String,List> map = new HashMap<>();
Map<String, List> map = new HashMap<>();
String waybillNumbers = v.stream().map(DistributionStockArticleEntity::getWaybillNumber).distinct().collect(Collectors.joining(","));
String storeCodes = v.stream().map(DistributionStockArticleEntity::getStoreCode).distinct().collect(Collectors.joining(","));
List<Long> waybillIds = v.stream().map(DistributionStockArticleEntity::getWaybillId).distinct().collect(Collectors.toList());
@ -2878,7 +2877,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
}
if (!zeroPackageEntityList.isEmpty()) {
map.put("2",zeroPackageEntityList);
map.put("2", zeroPackageEntityList);
}
} else {
log.error("########################订单isZero字段错误,订单ID:{}", s.getId());
@ -2930,7 +2929,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionReservationMapper.updateById(reservationEntity);
//推送广播
//进行节点推送
NodeFanoutMsg<ReservationVO> nodeFanoutMsg = distributionReservationService.buildNodeFanoutMsgByReservation(reservationEntity,map,BizOperationEnums.ADD);
NodeFanoutMsg<ReservationVO> nodeFanoutMsg = distributionReservationService.buildNodeFanoutMsgByReservation(reservationEntity, map, BizOperationEnums.ADD);
distributionNodeWorkService.planReservation(nodeFanoutMsg, user);
deliveryWarehouseName.add(reservationEntity.getWarehouseName());
deliveryPackageTotal.getAndAdd(reservationEntity.getReservationNum());
@ -3573,7 +3572,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
@Override
public NodeFanoutMsg<DistributionTaskVO> buildNodeFanoutMsgForPlan(DistributionDeliveryListEntity distributionDeliveryListEntity, BladeUser user, BizOperationEnums bizOperation){
public NodeFanoutMsg<DistributionTaskVO> buildNodeFanoutMsgForPlan(DistributionDeliveryListEntity distributionDeliveryListEntity, BladeUser user, BizOperationEnums bizOperation) {
NodeFanoutMsg<DistributionTaskVO> nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setBizOperation(bizOperation);
nodeFanoutMsg.setNode(WorkNodeEnums.PLAN_DELIVERY);
@ -3592,25 +3591,25 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
@NotNull
private DistributionTaskVO getDistributionTaskVO(DistributionDeliveryListEntity distributionDeliveryListEntity) {
private DistributionTaskVO getDistributionTaskVO(DistributionDeliveryListEntity distributionDeliveryListEntity) {
DistributionTaskVO distributionTaskVO = new DistributionTaskVO();
distributionTaskVO.setId(distributionDeliveryListEntity.getId());
distributionTaskVO.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
distributionTaskVO.setKind(distributionDeliveryListEntity.getKind());
distributionTaskVO.setType(distributionDeliveryListEntity.getType());
String kindName = distributionDeliveryListEntity.getKind().equals(ServiceConstant.DELIVERLIST_KIND_SELF) ? "自主配送" : "三方配送";
String typeName = distributionDeliveryListEntity.getType().equals("2") ? "市配" : "商配";
distributionTaskVO.setKind(kindName);
distributionTaskVO.setType(typeName);
distributionTaskVO.setDistributionCompany(distributionDeliveryListEntity.getDistributionCompany());
distributionTaskVO.setTaskTime(distributionDeliveryListEntity.getTaskTime());
List<ReservationVO> reservationVOList= distributionDeliveryListService.getDeliveryreBroadcastData(distributionDeliveryListEntity.getId(), distributionDeliveryListEntity.getWarehouseId());
List<ReservationVO> reservationVOList = distributionDeliveryListService.getDeliveryreBroadcastData(distributionDeliveryListEntity.getId(), distributionDeliveryListEntity.getWarehouseId());
distributionTaskVO.setReservationVOList(reservationVOList);
return distributionTaskVO;
}
private boolean checkList(List<DistributionReservationPackageEntity> list, Long id, Long stockArticleId, String orderPackageCode) {
return list.stream().anyMatch(e -> e.getStockArticleId().equals(stockArticleId) && e.getPacketBarCode().equals(orderPackageCode) && e.getReservationId().equals(id));
@ -4605,7 +4604,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Override
public R loadingStart(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
String method = "#########################DistributionStockArticleController.loadingStart";
String method = "#########################DistributionStockArticleController.loadingStart";
if (Objects.isNull(distrilbutionloadingscanDTO.getDeliveryId())) {
log.error(method + "参数缺失DeliveryId()");
return Resp.fail("参数缺失,请联系管理员");
@ -4624,7 +4623,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return Resp.scanFail("该车次已发车!", "该车次已发车!");
}
Boolean isDriverFlag = judgeIsDriver(user);
if (!isDriverFlag){
if (!isDriverFlag) {
return Resp.scanFail("当前操作人必须是司机!", "当前操作人必须是司机!");
}
String format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date());
@ -4633,12 +4632,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
Boolean isEnd = false;
//防止司机进行重复发车点击
Long isRepeat = bladeRedis.get(AuthUtil.getTenantId() + "warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + distributionDeliveryListEntity.getTrainNumber() + "driverId:");
if (Func.isNotEmpty(isRepeat)){
return Resp.scanFail("请勿重复发车","请勿重复发车");
if (Func.isNotEmpty(isRepeat)) {
return Resp.scanFail("请勿重复发车", "请勿重复发车");
}
if ("1".equals(distributionDeliveryListEntity.getKind())) {
DistributionDeliverySelfEntity distributionDeliverySelfEntity = getDriver(distributionDeliveryListEntity,user,distrilbutionloadingscanDTO,isDriverFlag);
DistributionDeliverySelfEntity distributionDeliverySelfEntity = getDriver(distributionDeliveryListEntity, user, distrilbutionloadingscanDTO, isDriverFlag);
distributionDeliverySelfEntity.setDepartureTime(format);
b = distributionDeliverySelfService.updateById(distributionDeliverySelfEntity);
isEnd = isEndDriver(distributionDeliveryListEntity.getId());
@ -4651,13 +4650,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//处理最后一个司机进行发车
//判断是否是最后一个司机点发车
distributionDeliveryListEntity.setIsStart(DeliveryStartStatusConstant.bufenfache.getValue());
if (isEnd){
if (isEnd) {
distributionDeliveryListEntity.setIsStart(DeliveryStartStatusConstant.yifache.getValue());
//进行实际装车和计划数据比对
contrastPlanAndLoading(distributionDeliveryListEntity,myCurrentWarehouse);
contrastPlanAndLoading(distributionDeliveryListEntity, myCurrentWarehouse);
//进行发车日志记录
}
bladeRedis.setEx(AuthUtil.getTenantId() + "warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + distributionDeliveryListEntity.getTrainNumber() + "driverId:" , user.getUserId(),60L*30L);
bladeRedis.setEx(AuthUtil.getTenantId() + "warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + distributionDeliveryListEntity.getTrainNumber() + "driverId:", user.getUserId(), 60L * 30L);
//修改主表状态
distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue());
baseMapper.updateById(distributionDeliveryListEntity);
@ -4711,9 +4710,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! ", customerException);
}
//发车日志记录
handleLoadingStartLog(distributionDeliveryListEntity,user,myCurrentWarehouse,builder.toString());
NodeFanoutMsg<CarStartVO> nodeFanoutMsg = builderNodeFanoutMsgByCarStart(distributionDeliveryListEntity,user);
distributionNodeWorkService.carStart(nodeFanoutMsg,user);
handleLoadingStartLog(distributionDeliveryListEntity, user, myCurrentWarehouse, builder.toString());
NodeFanoutMsg<CarStartVO> nodeFanoutMsg = builderNodeFanoutMsgByCarStart(distributionDeliveryListEntity, user);
distributionNodeWorkService.carStart(nodeFanoutMsg, user);
// 推送数据
return Resp.scanSuccess("发车成功", builder.toString());
@ -4721,12 +4720,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
/**
* 发车日志记录
*
* @param distributionDeliveryListEntity
* @param user
* @param myCurrentWarehouse
*/
private void handleLoadingStartLog(DistributionDeliveryListEntity distributionDeliveryListEntity, BladeUser user, BasicdataWarehouseEntity myCurrentWarehouse,String str) {
String content = user.getNickName()+"在"+myCurrentWarehouse.getName()+"点击发车,"+str;
private void handleLoadingStartLog(DistributionDeliveryListEntity distributionDeliveryListEntity, BladeUser user, BasicdataWarehouseEntity myCurrentWarehouse, String str) {
String content = user.getNickName() + "在" + myCurrentWarehouse.getName() + "点击发车," + str;
DistributionPlanLogEntity distributionPlanLogEntity = new DistributionPlanLogEntity();
distributionPlanLogEntity.setContent(content);
distributionPlanLogEntity.setRefId(distributionDeliveryListEntity.getId());
@ -4741,26 +4741,26 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
/**
* 比对计划和实际装车进行装车异常数据记录
*/
private void contrastPlanAndLoading(DistributionDeliveryListEntity distributionDeliveryList,BasicdataWarehouseEntity warehouseEntity) {
private void contrastPlanAndLoading(DistributionDeliveryListEntity distributionDeliveryList, BasicdataWarehouseEntity warehouseEntity) {
List<DistributionParcelListEntity> distributionParcelListEntities = baseMapper.selectPackageListByDeliveryListId(distributionDeliveryList.getId());
List<DistributionLoadscanAbnormalEntity> abnormalEntityList = new ArrayList<>();
if (!distributionParcelListEntities.isEmpty()) {
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) {
DistributionLoadscanAbnormalEntity packageLoadscanAbnormalEntity =createdPakcageAbnormal(distributionDeliveryList,distributionParcelListEntity,warehouseEntity);
DistributionLoadscanAbnormalEntity packageLoadscanAbnormalEntity = createdPakcageAbnormal(distributionDeliveryList, distributionParcelListEntity, warehouseEntity);
abnormalEntityList.add(packageLoadscanAbnormalEntity);
}
}
List<DisStockListDetailEntity> disStockListDetailEntities = baseMapper.selectInventoryListByDeliveryListId(distributionDeliveryList.getId());
if (!disStockListDetailEntities.isEmpty()) {
for (DisStockListDetailEntity disStockListDetailEntity : disStockListDetailEntities) {
DistributionLoadscanAbnormalEntity inventoryLoadscanAbnormalEntity = createdInventoryPakcageAbnormal(distributionDeliveryList,disStockListDetailEntity,warehouseEntity);
DistributionLoadscanAbnormalEntity inventoryLoadscanAbnormalEntity = createdInventoryPakcageAbnormal(distributionDeliveryList, disStockListDetailEntity, warehouseEntity);
abnormalEntityList.add(inventoryLoadscanAbnormalEntity);
}
}
//零担
List<DistributionLoadscanAbnormalEntity> zeroLoadscanAbnormalList = baseMapper.selectZeroListByDeliveryId(distributionDeliveryList.getId());
if (!zeroLoadscanAbnormalList.isEmpty()){
abnormalEntityList.addAll(zeroLoadscanAbnormalList);
if (!zeroLoadscanAbnormalList.isEmpty()) {
abnormalEntityList.addAll(zeroLoadscanAbnormalList);
}
if (!abnormalEntityList.isEmpty()) {
//进行装车异常生成
@ -4812,7 +4812,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.eq(DistributionDeliverySelfEntity::getDeliveryId, deliveryId)
);
if (!deliverySelfEntities.isEmpty()) {
return deliverySelfEntities.stream().allMatch(f -> !Objects.isNull(f.getDepartureTime()));
return deliverySelfEntities.stream().allMatch(f -> !Objects.isNull(f.getDepartureTime()));
}
return false;
}
@ -4822,7 +4822,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.eq(DistributionDeliverySelfEntity::getDeliveryId, deliveryId)
);
if (!deliverySelfEntities.isEmpty()) {
return deliverySelfEntities.stream().allMatch(f -> Objects.isNull(f.getDepartureTime()));
return deliverySelfEntities.stream().allMatch(f -> Objects.isNull(f.getDepartureTime()));
}
return false;
}
@ -5850,7 +5850,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
// 发送作业节点数据
if(CollUtil.isNotEmpty(pushNodeList)){
if (CollUtil.isNotEmpty(pushNodeList)) {
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByPackage(deliveryListEntity, pushNodeList);
distributionNodeWorkService.abnormalLoading(nodeFanoutMsg, AuthUtil.getUser());
}
@ -6229,14 +6229,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
}
if(CollUtil.isNotEmpty(pushNodeList)){
if (CollUtil.isNotEmpty(pushNodeList)) {
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(distrilbutionloadingscanDTO.getDeliveryId());
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByZeroOrder(deliveryListEntity, pushNodeList);
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser());
}
return Resp.scanSuccess("装车成功", str.toString());
}
@ -6276,8 +6275,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionLoadVO.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
List<PackageData> data = new ArrayList<>();
for (DistributionLoadscanEntity distributionLoadscanEntity : pushNodeList) {
@ -7969,13 +7966,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Transactional
public R cancelStart(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
String method = "######################DistributionDeliveryListServiceImpl.cancelStart";
if (Objects.isNull(distrilbutionloadingscanDTO.getDeliveryId())){
if (Objects.isNull(distrilbutionloadingscanDTO.getDeliveryId())) {
log.error(method + "参数缺失DeliveryId");
return Resp.fail("参数缺失,请联系管理员");
}
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)){
return R.fail(403,"未授权!!!");
if (Objects.isNull(myCurrentWarehouse)) {
return R.fail(403, "未授权!!!");
}
//获取当前用户司机
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId());
@ -7988,11 +7985,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//校验当前人是否为司机
BladeUser user = AuthUtil.getUser();
Boolean driver = judgeIsDriver(user);
if (!driver){
if (!driver) {
return Resp.scanFail("此按钮只能司机操作!", "此按钮只能司机操作!");
}
DistributionDeliverySelfEntity deliverySelfEntity = getDriver(distributionDeliveryListEntity, user, distrilbutionloadingscanDTO, driver);
if (Objects.isNull(deliverySelfEntity)){
if (Objects.isNull(deliverySelfEntity)) {
return Resp.scanFail("当前司机不属于该车次!", "当前司机不属于该车次!");
}
Boolean b = false;
@ -8021,12 +8018,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
baseMapper.updateById(distributionDeliveryListEntity);
//取消发车日志记录
handleCancelStartLog(distributionDeliveryListEntity,deliverySelfEntity,user,myCurrentWarehouse);
handleCancelStartLog(distributionDeliveryListEntity, deliverySelfEntity, user, myCurrentWarehouse);
return R.success("取消发车成功");
}
private void handleCancelStartLog(DistributionDeliveryListEntity distributionDeliveryListEntity, DistributionDeliverySelfEntity deliverySelfEntity, BladeUser user, BasicdataWarehouseEntity myCurrentWarehouse) {
String content = user.getNickName()+"在"+myCurrentWarehouse.getName()+"对配送计划:"+distributionDeliveryListEntity.getTrainNumber()+"取消发车,当前配送司机配置-->["+distributionDeliveryListEntity.getDriverName()+"]";
String content = user.getNickName() + "在" + myCurrentWarehouse.getName() + "对配送计划:" + distributionDeliveryListEntity.getTrainNumber() + "取消发车,当前配送司机配置-->[" + distributionDeliveryListEntity.getDriverName() + "]";
DistributionPlanLogEntity distributionPlanLogEntity = new DistributionPlanLogEntity();
distributionPlanLogEntity.setContent(content);
distributionPlanLogEntity.setRefId(distributionDeliveryListEntity.getId());
@ -8040,7 +8037,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
private void deletedAbnormalData(Long deliveryId) {
distributionLoadscanAbnormalService.remove(Wrappers.<DistributionLoadscanAbnormalEntity>update().lambda()
.eq(DistributionLoadscanAbnormalEntity::getDeliveryListId,deliveryId)
.eq(DistributionLoadscanAbnormalEntity::getDeliveryListId, deliveryId)
);
}
@ -8390,17 +8387,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (!broadcastDataByArticles.isEmpty()) {
broadcastDataByArticles.forEach(map -> {
DistributionReservationEntity reservationEntity = distributionReservationService.getById(map.get("reservationId").toString());
DistributionReservationEntity reservationEntity = distributionReservationService.getById(map.get("reservationId").toString());
ReservationVO reservationVO = checkListForReservationVO(data, reservationEntity);
List<PackageData> packageDataList = reservationVO.getPackageDataList();
if(packageDataList==null){
if (packageDataList == null) {
packageDataList = new ArrayList<>();
reservationVO.setPackageDataList(packageDataList);
}
PackageData packageData =new PackageData();
PackageData packageData = new PackageData();
packageData.setPackageCode((String) map.get("packageCode"));
PackageTypeEnums type = PackageTypeEnums.CMP;
packageData.setPackageType(type);
@ -8416,12 +8413,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (!broadcastDataByStock.isEmpty()) {
for (Map<String, Object> map : broadcastDataByStock) {
DistributionReservationEntity reservationEntity = distributionReservationService.getById(map.get("reservationId").toString());
DistributionReservationEntity reservationEntity = distributionReservationService.getById(map.get("reservationId").toString());
ReservationVO reservationVO = checkListForReservationVO(data, reservationEntity);
List<PackageData> packageDataList = reservationVO.getPackageDataList();
if(packageDataList==null){
if (packageDataList == null) {
packageDataList = new ArrayList<>();
reservationVO.setPackageDataList(packageDataList);
}
@ -8438,12 +8435,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<Map<String, Object>> broadcastDataByZeroOrder = baseMapper.getBroadcastDataByZeroOrder(id, warehouseId);
if (!broadcastDataByZeroOrder.isEmpty()) {
broadcastDataByZeroOrder.forEach(map -> {
DistributionReservationEntity reservationEntity = distributionReservationService.getById(map.get("reservationId").toString());
DistributionReservationEntity reservationEntity = distributionReservationService.getById(map.get("reservationId").toString());
ReservationVO reservationVO = checkListForReservationVO(data, reservationEntity);
List<PackageData> packageDataList = reservationVO.getPackageDataList();
if(packageDataList==null){
if (packageDataList == null) {
packageDataList = new ArrayList<>();
reservationVO.setPackageDataList(packageDataList);
}
@ -8482,8 +8479,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
break;
}
}
if(temp==null){
temp=distributionReservationService.getReservationVO(reservationEntity);
if (temp == null) {
temp = distributionReservationService.getReservationVO(reservationEntity);
data.add(temp);
}
@ -8614,8 +8611,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//日志信息收集
List<JSONObject> packageLogs = new ArrayList<>();
//查询司机信息
DistributionDeliverySelfEntity distributionDeliverySelfEntity = getDriver(deliveryListEntity,user,distrilbutionloadingscanDTO,isDriverFlag);
if (Objects.isNull(distributionDeliverySelfEntity)){
DistributionDeliverySelfEntity distributionDeliverySelfEntity = getDriver(deliveryListEntity, user, distrilbutionloadingscanDTO, isDriverFlag);
if (Objects.isNull(distributionDeliverySelfEntity)) {
return Resp.fail("当前操作人不合法");
}
switch (type) {
@ -8656,7 +8653,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
Boolean isAbnormalLoadingFlag = judgeIsAbnormalLoading(deliveryId, parcelListEntity, reservationId);
if (isAbnormalLoadingFlag) {
log.info("异常装车判定成功>>>>>>packageCode:{},reservationId:{}", distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getReservationId());
if (Objects.isNull(distrilbutionloadingscanDTO.getReservationId())){
if (Objects.isNull(distrilbutionloadingscanDTO.getReservationId())) {
return Resp.scanFail("请指定客户进行异常装车", "请指定客户进行异常装车");
}
return R.fail(5000, "异常装车");
@ -8837,9 +8834,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
String inventoryPackageCode = distrilbutionloadingscanDTO.getBarcode();
//查询库存品
reservationId = baseMapper.selectInventoryPackageByDeliveryIdAndInventoryPackageCode(deliveryId,inventoryPackageCode);
if (Objects.isNull(reservationId)){
parcelListEntity = distributionParcelListMapper.selectByOrderPackageCode(inventoryPackageCode, myCurrentWarehouse.getId());
reservationId = baseMapper.selectInventoryPackageByDeliveryIdAndInventoryPackageCode(deliveryId, inventoryPackageCode);
if (Objects.isNull(reservationId)) {
parcelListEntity = distributionParcelListMapper.selectByOrderPackageCode(inventoryPackageCode, myCurrentWarehouse.getId());
if (!Objects.isNull(parcelListEntity)) {
return Resp.scanFail("请在定制品页面扫描此码", "请在定制品页面扫描此码");
} else {
@ -9085,27 +9082,27 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return Resp.scanFail("仓库信息不能为空", "仓库信息不能为空");
}
String barcode = distrilbutionloadingscanDTO.getBarcode();
Long deliveryId= distrilbutionloadingscanDTO.getDeliveryId();
Long deliveryId = distrilbutionloadingscanDTO.getDeliveryId();
Long reservationId = distrilbutionloadingscanDTO.getReservationId();
//校验配送任务是否正常
DistributionDeliveryListVO deliveryList = this.getDeliveryList(deliveryId);
if (Objects.isNull(deliveryList)){
log.error(method + "QUERY DELIVERY IS FAIL,DELIVERYID:{}",deliveryId);
if (Objects.isNull(deliveryList)) {
log.error(method + "QUERY DELIVERY IS FAIL,DELIVERYID:{}", deliveryId);
return Resp.fail("参数缺失,请联系管理员");
}
if (Integer.parseInt(IsOrNoConstant.yes.getValue())== deliveryList.getIsStart()){
log.error(method + "QUERY DELIVERY IS FAIL,DELIVERYID:{}",deliveryId);
return Resp.scanFail("异常装车失败,当前车次已发车","异常装车失败,当前车次已发车");
if (Integer.parseInt(IsOrNoConstant.yes.getValue()) == deliveryList.getIsStart()) {
log.error(method + "QUERY DELIVERY IS FAIL,DELIVERYID:{}", deliveryId);
return Resp.scanFail("异常装车失败,当前车次已发车", "异常装车失败,当前车次已发车");
}
//校验此包件是否存在
DistributionParcelListEntity parcelListEntity = distributionParcelListMapper.selectByOrderPackageCode(barcode, myCurrentWarehouse.getId());
if (Objects.isNull(parcelListEntity)){
return Resp.scanFail("系统无编码","系统无编码");
if (Objects.isNull(parcelListEntity)) {
return Resp.scanFail("系统无编码", "系统无编码");
}
//查询当前异常包件锁关联的订单信息
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId());
if (Objects.isNull(parcelListEntity)){
return Resp.scanFail("订单信息错误","订单信息错误");
if (Objects.isNull(parcelListEntity)) {
return Resp.scanFail("订单信息错误", "订单信息错误");
}
//查询是否在本车次进行异常装车
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
@ -9116,13 +9113,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (!Objects.isNull(loadscanEntityList)) {
//校验是否重复扫描
boolean isRepeatFlag = loadscanEntityList.stream().anyMatch(f -> reservationId.equals(f.getReservationId()));
if (isRepeatFlag){
if (isRepeatFlag) {
//当前客户存在异常装车
return Resp.scanFail("重复扫描","重复扫描");
}else {
return Resp.scanFail("重复扫描", "重复扫描");
} else {
//校验是否在其他车次存在异常
String abnormalTrainNumber = loadscanEntityList.stream().map(DistributionLoadscanEntity::getTrainNumber).distinct().collect(Collectors.joining(","));
return Resp.scanFail("此包件在"+abnormalTrainNumber+"存在异常操作","此包件在"+abnormalTrainNumber+"存在异常操作");
return Resp.scanFail("此包件在" + abnormalTrainNumber + "存在异常操作", "此包件在" + abnormalTrainNumber + "存在异常操作");
}
}
BladeUser user = AuthUtil.getUser();
@ -9131,7 +9128,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<String> orderPackageCodes = new ArrayList<>();
List<JSONObject> aaa = new ArrayList<>();
//查询当前司机信息
DistributionDeliverySelfEntity distributionDeliverySelfEntity = getDriver(deliveryList,user,distrilbutionloadingscanDTO,isDriverFlag);
DistributionDeliverySelfEntity distributionDeliverySelfEntity = getDriver(deliveryList, user, distrilbutionloadingscanDTO, isDriverFlag);
DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity();
DistributionReservationEntity reservationEntity = null;
switch (deliveryList.getType()) {
@ -9161,7 +9158,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//市配
break;
default:
log.error(method+"DELIVERY TYPE IS UNKONWN,DELIVERYID IS :{}",deliveryList.getId());
log.error(method + "DELIVERY TYPE IS UNKONWN,DELIVERYID IS :{}", deliveryList.getId());
break;
}
DistributionLoadscanEntity distributionLoadscanEntity = createdDistributionLoadscanEntity(deliveryList, distributionDeliverySelfEntity, reservationId, parcelListEntity, myCurrentWarehouse, user);
@ -9440,7 +9437,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//查看是否存在满足条件的预约单
boolean flag = reservationEntityList.stream().anyMatch(r -> Func.isNotEmpty(r.getConsignee()) && r.getConsignee().equals(stockArticleEntity.getCustomerName()) && r.getDeliveryAddress().equals(stockArticleEntity.getCustomerAddress()) && r.getDeliveryPhone().equals(stockArticleEntity.getCustomerTelephone()) && r.getMallName().equals(stockArticleEntity.getMallName()) && r.getId().equals(reservationId));
//存在多个,操作人指定具体客户即可
if ( flag) {
if (flag) {
List<DistributionReservationEntity> reservationEntities = reservationEntityList.stream().filter(r -> Func.isNotEmpty(r.getConsignee()) && r.getConsignee().equals(stockArticleEntity.getCustomerName()) && r.getDeliveryAddress().equals(stockArticleEntity.getCustomerAddress()) && r.getDeliveryPhone().equals(stockArticleEntity.getCustomerTelephone()) && r.getMallName().equals(stockArticleEntity.getMallName()) && r.getId().equals(reservationId)).collect(Collectors.toList());
return true;

15
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionNodeWorkServiceImpl.java

@ -132,21 +132,6 @@ public class DistributionNodeWorkServiceImpl implements IDistributionNodeWorkSer
@Override
public void signFor(DistributionParcelListEntity parcelListEntity, Long taskId, String operationTime, String destinationWarehouse) {
// log.info(">>>>>>>>>> signFor 签收扫描 {}", parcelListEntity.getOrderPackageCode());
// BroadcastNodeData broadcastNodeData = new BroadcastNodeData();
// broadcastNodeData.put("orderPackageCode", parcelListEntity.getOrderPackageCode());
// broadcastNodeData.put("distributionContactId", taskId);
//// broadcastNodeData.put("distributionContactCode", distributionReservationEntity.getReservationCode());
// broadcastNodeData.put("destinationWarehouse", destinationWarehouse);
// broadcastNodeData.put("brand", parcelListEntity.getBrandName());
// broadcastNodeData.setOperationTime(operationTime);
// broadcastNodeData.setUserName(AuthUtil.getUserName());
// broadcastNodeData.setTenantId(AuthUtil.getTenantId());
//
// FanoutMsg build = FanoutMsg.builder().msg(broadcastNodeData.toJSONString())
// .exchange(FanoutConstants.distribution.signfor.EXCHANGE).build();
//
// sendFanoutMsg(build);
try {
JSONObject main = new JSONObject();
main.set("boId", taskId.toString());

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

@ -61,12 +61,9 @@ import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.springblade.common.constant.DistributionTypeConstant;
import org.springblade.common.constant.*;
import org.springblade.common.constant.Inventory.InventoryLoadingStatusConstant;
import org.springblade.common.constant.Inventory.InventorySigningStatusConstant;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.RedisKeyConstant;
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;
@ -2914,7 +2911,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 构建新作业节点回传
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity, distributionReservationEntity, pushList);
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity, distributionReservationEntity, pushList, OperatModeConstant.SCAN);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
@ -2927,7 +2924,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
private NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> buildDistributionSignforVOByStock(DistributionDeliveryListEntity distributionDeliveryListEntity, List<DistributionLoadscaninvnEntity> pushList) {
private NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> buildDistributionSignforVOByStock(DistributionDeliveryListEntity distributionDeliveryListEntity, List<DistributionLoadscaninvnEntity> pushList,String operatMode) {
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD);
@ -2972,13 +2969,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
distributionLoadVO.setPackageDataList(data);
distributionLoadVO.setOperatMode(operatMode);
nodeFanoutMsg.setMain(distributionLoadVO);
return nodeFanoutMsg;
}
private NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> buildDistributionSignforVO(DistributionDeliveryListEntity distributionDeliveryListEntity, DistributionReservationEntity distributionReservationEntity, List<DistributionLoadscanEntity> pushList) {
private NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> buildDistributionSignforVO(DistributionDeliveryListEntity distributionDeliveryListEntity, DistributionReservationEntity distributionReservationEntity, List<DistributionLoadscanEntity> pushList,String operatMode) {
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD);
@ -2997,6 +2995,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadVO.setReservationCode(distributionReservationEntity.getReservationCode());
distributionLoadVO.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
distributionLoadVO.setReservationId(distributionReservationEntity.getId());
distributionLoadVO.setOperatMode(operatMode);
List<PackageData> data = new ArrayList<>();
@ -3358,7 +3357,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 推送作业节点
// 作业节点数据推送
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity, distributionReservationEntity, pushDatas);
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity, distributionReservationEntity, pushDatas,OperatModeConstant.BATCH);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
@ -3813,7 +3812,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 作业节点数据推送
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVO(distributionDeliveryListEntity, reservationEntity, pushList);
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVO(distributionDeliveryListEntity, reservationEntity, pushList,OperatModeConstant.SCAN);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
return Resp.scanSuccess("操作成功", s);
@ -4196,7 +4195,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 作业节点数据推送
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVOByStock(deliveryListEntity, pushList);
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVOByStock(deliveryListEntity, pushList,OperatModeConstant.SCAN);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
@ -7628,7 +7627,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 节点作业推送
sendNodeWorkDataBroadcast(parcelListEntity, reservationEntity, singleTime, myCurrentWarehouse);
// 构建新作业节点回传
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity,reservationEntity, pushList);
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity,reservationEntity, pushList,OperatModeConstant.BATCH);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
break;
case 2:
@ -7951,12 +7950,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (!pushInventoryList.isEmpty()) {
// 作业节点数据推送
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVOByStock(deliveryListEntity, pushInventoryList);
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVOByStock(deliveryListEntity, pushInventoryList, OperatModeConstant.SCAN);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
}
if (!pushList.isEmpty()) {
// 构建新作业节点回传
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity,reservationEntity, pushList);
NodeFanoutMsg<org.springblade.common.model.DistributionSignforVO> nodeFanoutMsg = buildDistributionSignforVO(deliveryListEntity,reservationEntity, pushList,OperatModeConstant.SCAN);
iDistributionNodeWorkService.signFor(nodeFanoutMsg, AuthUtil.getUser());
}
if (!orderCodes.isEmpty()) {

Loading…
Cancel
Save