Browse Source

司机批量签收推送BUG修复

visual
汤建军 5 months ago
parent
commit
312ca9c1bb
  1. 5
      blade-biz-common/src/main/java/org/springblade/common/constant/basiccode/BasicCodeTypeConstant.java
  2. 45
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  3. 24
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  4. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

5
blade-biz-common/src/main/java/org/springblade/common/constant/basiccode/BasicCodeTypeConstant.java

@ -34,13 +34,14 @@ public enum BasicCodeTypeConstant {
//配送计划 自提单 预约单 备货码
DELIVERY_PLAN_CODE("配送计划码","20"),
DELIVERY_PLAN_CODE("配送码","20"),
// 自提单码
PICKUP_ORDER_CODE("自提单码","21"),
// 预约单码
APPOINTMENT_CODE("预约单码","22"),
// 备货码
STOCK_CODE("备货码","23");
STOCK_CODE("备货码","23"),
RENTION_CODE("回库码","23");
/**

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

@ -23,6 +23,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.logpm.basic.entity.BasicTenantCodeEntity;
import com.logpm.basic.feign.IBasicTenantCodeClient;
import com.logpm.basicdata.entity.BasicdataClientUserEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataClientClient;
@ -75,6 +77,8 @@ import org.springblade.common.constant.Inventory.InventoryTypeConstant;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.basiccode.BasicCodeShowConstant;
import org.springblade.common.constant.basiccode.BasicCodeTypeConstant;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.delivery.DeliveryLoadingStatusConstant;
import org.springblade.common.constant.delivery.DeliveryStartStatusConstant;
@ -285,6 +289,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
@Autowired
private IDistributionNodeWorkService distributionNodeWorkService;
@Autowired
private IBasicTenantCodeClient basicTenantCodeClient;
@Override
public IPage<DistributionReservationVO> selectDistrbutionReservationPage(IPage<DistributionReservationVO> page, DistributionReservationVO distrbutionReservation) {
@ -897,7 +904,14 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
public String bianMa() {
// String code ="BH";
StringBuilder sb = new StringBuilder();
sb.append("BH");
BasicTenantCodeEntity basicTenantCodeByCodeAndShowType = basicTenantCodeClient.findBasicTenantCodeByCodeAndShowType(BasicCodeTypeConstant.STOCK_CODE.getValue(), BasicCodeShowConstant.QR_CODE.getValue());
String tenantCode = "BH";
if (ObjectUtils.isNull(basicTenantCodeByCodeAndShowType)) {
log.error("获取货区码失败");
} else {
tenantCode = basicTenantCodeByCodeAndShowType.getCode();
}
sb.append(tenantCode);
BladeUser user = AuthUtil.getUser();
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
String format1 = format.format(new Date());
@ -905,13 +919,13 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
if (ObjectUtil.isNotEmpty(warehouseByDepartment)) {
sb.append(warehouseByDepartment.getWarehouseCode());
sb.append(format1);
String s = "BH" + warehouseByDepartment.getWarehouseCode();
String s = tenantCode + warehouseByDepartment.getWarehouseCode();
String s1 = jiShuan(s);
sb.append(s1);
} else {
sb.append("00000");
sb.append(format1);
String s = "BH" + "00000";
String s = tenantCode + "00000";
String s1 = jiShuan(s);
sb.append(s1);
}
@ -921,7 +935,14 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
@Override
public String reservationMa() {
StringBuilder sb = new StringBuilder();
sb.append("YY");
BasicTenantCodeEntity basicTenantCodeByCodeAndShowType = basicTenantCodeClient.findBasicTenantCodeByCodeAndShowType(BasicCodeTypeConstant.APPOINTMENT_CODE.getValue(), BasicCodeShowConstant.QR_CODE.getValue());
String tenantCode = "YY";
if (ObjectUtils.isNull(basicTenantCodeByCodeAndShowType)) {
log.error("获取货区码失败");
} else {
tenantCode = basicTenantCodeByCodeAndShowType.getCode();
}
sb.append(tenantCode);
BladeUser user = AuthUtil.getUser();
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
String format1 = format.format(new Date());
@ -929,13 +950,13 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
if (ObjectUtil.isNotEmpty(warehouseByDepartment)) {
sb.append(warehouseByDepartment.getWarehouseCode());
sb.append(format1);
String s = "YY" + warehouseByDepartment.getWarehouseCode();
String s = tenantCode + warehouseByDepartment.getWarehouseCode();
String s1 = jiShuan(s);
sb.append(s1);
} else {
sb.append("00000");
sb.append(format1);
String s = "YY" + "00000";
String s = tenantCode + "00000";
String s1 = jiShuan(s);
sb.append(s1);
}
@ -945,7 +966,13 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
@Override
public String retentionMa() {
StringBuilder sb = new StringBuilder();
sb.append("HK");
BasicTenantCodeEntity basicTenantCodeByCodeAndShowType = basicTenantCodeClient.findBasicTenantCodeByCodeAndShowType(BasicCodeTypeConstant.APPOINTMENT_CODE.getValue(), BasicCodeShowConstant.QR_CODE.getValue());
String tenantCode = "HK";
if (ObjectUtils.isNull(basicTenantCodeByCodeAndShowType)) {
log.error("获取货区码失败");
} else {
tenantCode = basicTenantCodeByCodeAndShowType.getCode();
}
BladeUser user = AuthUtil.getUser();
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
String format1 = format.format(new Date());
@ -953,13 +980,13 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
if (ObjectUtil.isNotEmpty(warehouseByDepartment)) {
sb.append(warehouseByDepartment.getWarehouseCode());
sb.append(format1);
String s = "YY" + warehouseByDepartment.getWarehouseCode();
String s = tenantCode + warehouseByDepartment.getWarehouseCode();
String s1 = jiShuan(s);
sb.append(s1);
} else {
sb.append("00000");
sb.append(format1);
String s = "YY" + "00000";
String s = tenantCode + "00000";
String s1 = jiShuan(s);
sb.append(s1);
}

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

@ -5476,7 +5476,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (!packageLoadingData.isEmpty()) {
receivedQuantity += packageLoadingData.stream().mapToInt(DistributionLoadscanEntity::getPackageNub).sum();
//进行订制品和零担的批量签收
handlePackageLoadingData(packageLoadingData, user, distributionLoadscanEntityLists, orderCodes);
handlePackageLoadingData(packageLoadingData, user, distributionLoadscanEntityLists, orderCodes,distributionDeliveryListEntity,reservationEntity,myCurrentWarehouse,packageCodes,aaa);
}
if (!inventoryLoadingData.isEmpty()) {
@ -5839,7 +5839,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
jsonObject.put("remark", "批量签收下架");
jsonObjects.add(jsonObject);
content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntity.getSigningUser() + "司机批量签收,装车方式:扫描装车,配送车次号:" + distributionDeliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_ABNORMAL_SIGN_FOR.getCode(), distributionDeliveryListEntity.getTrainNumber(), parcelListEntity.getWarehouseEntryTimeEnd());
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), distributionDeliveryListEntity.getTrainNumber(), parcelListEntity.getWarehouseEntryTimeEnd());
//distributionAsyncService.sendFactory(parcelListEntity, loadscanEntity.getSigningTime(), reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getName(), user.getNickName());
sendNodeWorkDataBroadcast(parcelListEntity, reservationEntity, loadscanEntity.getSigningTime(), myCurrentWarehouse);
} else {
@ -5859,7 +5859,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanEntityLists.add(loadscanEntities);
packageLockIds.add(loadscanEntities.getPackageId());
content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntities.getSigningUser() + "司机批量签收,装车方式:补录装车,配送车次号:" + distributionDeliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_ABNORMAL_SIGN_FOR.getCode(), distributionDeliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), distributionDeliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
// 节点作业推送
sendNodeWorkDataBroadcast(parcelListEntity, reservationEntity, loadscanEntities.getSigningTime(), myCurrentWarehouse);
}
@ -6007,7 +6007,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
private void handlePackageLoadingData(List<DistributionLoadscanEntity> packageLoadingData, BladeUser user, List<DistributionLoadscanEntity> distributionLoadscanEntityLists, List<String> orderCodes) {
private void handlePackageLoadingData(List<DistributionLoadscanEntity> packageLoadingData,
BladeUser user,
List<DistributionLoadscanEntity> distributionLoadscanEntityLists,
List<String> orderCodes,DistributionDeliveryListEntity deliveryListEntity,
DistributionReservationEntity reservationEntity,
BasicdataWarehouseEntity myCurrentWarehouse,
List<String> orderPckageCodes,
List<JSONObject> aaa ) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
List<DistributionLoadscanEntity> updatePackageLoadingData = new ArrayList<>();
List<Long> packageIds = new ArrayList<>();
@ -6026,8 +6033,15 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
updatePackageLoadingData.add(packageLoadingDatum);
distributionLoadscanEntityLists.add(packageLoadingDatum);
if (Integer.parseInt(IsOrNoConstant.no.getValue()) == packageLoadingDatum.getIsZero()) {
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(packageLoadingDatum.getPackageId());
//非零担标注出库
packageIds.add(packageLoadingDatum.getPackageId());
String content = "包件在" + myCurrentWarehouse.getName() + "由" + packageLoadingDatum.getSigningUser() + "司机批量签收,装车方式:补录装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), packageLoadingDatum.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
// 节点作业推送
sendNodeWorkDataBroadcast(parcelListEntity, reservationEntity, packageLoadingDatum.getSigningTime(), myCurrentWarehouse);
orderPckageCodes.add(parcelListEntity.getOrderPackageCode());
aaa.add(trunklinePackageTrackLog);
} else {
//查询出对应的零担包件
DistributionParcelNumberEntity distributionParcelNumberEntity = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().lambda()
@ -6054,7 +6068,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
orderCodes.addAll(distributionStockArticleEntities.stream().map(DistributionStockArticleEntity::getOrderCode).collect(Collectors.toList()));
}
}
//查询所有订单
}

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

@ -633,6 +633,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String format = dateFormat.format(new Date());
distrilbutionBillLading.setPickupBatch("ZT" + format);//批次号
if (ObjectUtils.isNull(myCurrentWarehouse)) {
throw new ServiceException("请选择仓库在操作!!!");

Loading…
Cancel
Save