Browse Source

1.修复导出的报错

2,修复首页数据缓存爆粗
dist.1.3.0
pref_mail@163.com 9 months ago
parent
commit
3401c63ae6
  1. 199
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  2. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java

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

@ -251,11 +251,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 获取当前登录人仓库
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if(null == myCurrentWarehouse){
if (null == myCurrentWarehouse) {
List<BasicdataWarehouseEntity> myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse();
List<Long> collect = myWatchWarehouse.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
distributionSignfor.setWarehouseIdList(collect);
}else{
} else {
List<Long> collect = new ArrayList<>();
collect.add(myCurrentWarehouse.getId());
distributionSignfor.setWarehouseIdList(collect);
@ -266,7 +266,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
try {
distributionSignforVOS = baseMapper.selectDistributionSignforPage(page, distributionSignfor);
} catch (Exception e) {
log.error(">>> selectDistributionSignforPage",e);
log.error(">>> selectDistributionSignforPage", e);
// 这里应该记录日志或者进行一些错误处理
return page.setRecords(Collections.emptyList());
}
@ -283,10 +283,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
private void processReservationIds(List<DistributionSignforVO> distributionSignforVOS, List<Long> reservationIds) {
List<DistributionParcelListVO> distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationIds(reservationIds);
List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.in(DisStockListDetailEntity::getReservationId, reservationIds)
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
// List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
// .in(DisStockListDetailEntity::getReservationId, reservationIds)
// .ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
// );
List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntities = distributionReservationZeroPackageService.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
.in(DistributionReservationZeroPackageEntity::getReservationId, reservationIds)
.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
@ -1717,8 +1717,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
private List<DeliveryNodeVo> handleStockUp(DistributionStockupEntity distributionStockupEntity) {
List<DeliveryNodeVo> nodeVos = new ArrayList<>();
try {
@ -2384,102 +2382,82 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Override
public List<DistributionSignforOwnExcel> exportDistributionSignforOwn(DistributionSignforVO distributionSignforVO) {
// 转换创建时间
try {
// 转换创建时间
distributionSignforVO.setCreateTime_query(DateUtil.format(distributionSignforVO.getCreateTime(), "yyyy:MM:dd HH:mm:ss"));
// 获取当前登录人仓库
// 获取当前登录人仓库
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if(null == myCurrentWarehouse){
List<BasicdataWarehouseEntity> myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse();
List<Long> collect = myWatchWarehouse.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
distributionSignforVO.setWarehouseIdList(collect);
}else{
List<Long> collect = new ArrayList<>();
collect.add(myCurrentWarehouse.getId());
distributionSignforVO.setWarehouseIdList(collect);
}
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (null == myCurrentWarehouse) {
List<BasicdataWarehouseEntity> myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse();
List<Long> collect = myWatchWarehouse.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
distributionSignforVO.setWarehouseIdList(collect);
} else {
List<Long> collect = new ArrayList<>();
collect.add(myCurrentWarehouse.getId());
distributionSignforVO.setWarehouseIdList(collect);
}
List<DistributionSignforVO> distributionSignforVOS;
try {
distributionSignforVOS = baseMapper.selectDistributionSignforPage(null, distributionSignforVO);
} catch (Exception e) {
log.error(">>> selectDistributionSignforPage",e);
// 这里应该记录日志或者进行一些错误处理
return Collections.emptyList();
}
List<DistributionSignforVO> distributionSignforVOS;
try {
distributionSignforVOS = baseMapper.selectDistributionSignforPage(null, distributionSignforVO);
} catch (Exception e) {
log.error(">>> selectDistributionSignforPage", e);
// 这里应该记录日志或者进行一些错误处理
return Collections.emptyList();
}
if (Func.isNotEmpty(distributionSignforVOS)) {
List<Long> reservationIds = distributionSignforVOS.stream().map(DistributionSignforVO::getReservationId).collect(Collectors.toList());
processReservationIds(distributionSignforVOS, reservationIds);
}
if (Func.isNotEmpty(distributionSignforVOS)) {
List<Long> reservationIds = distributionSignforVOS.stream().map(DistributionSignforVO::getReservationId).collect(Collectors.toList());
processReservationIds(distributionSignforVOS, reservationIds);
}
List<DistributionSignforOwnExcel> a = new ArrayList<>();
distributionSignforVOS.forEach(d -> {
d.setDeliveryTypeName(getDeliveryTypeName(d.getDeliveryType()));
List<DistributionSignforOwnExcel> a = new ArrayList<>();
distributionSignforVOS.forEach(d -> {
d.setDeliveryTypeName(getDeliveryTypeName(d.getDeliveryType()));
DistributionSignforOwnExcel signforExcel = new DistributionSignforOwnExcel();
DistributionSignforOwnExcel signforExcel = new DistributionSignforOwnExcel();
// BeanUtils.copyProperties(d, signforExcel);
signforExcel.setTrainNumber(d.getTrainNumber());
signforExcel.setReservationCode(d.getReservationCode());
signforExcel.setDeliveryDriverName(d.getDriverName());
signforExcel.setDeliveryDriverPhone(d.getDriverPhone());
signforExcel.setVehicleName(d.getVehicleName());
signforExcel.setTaskTime(d.getTaskTime());
signforExcel.setOrderCode(d.getStockArticleId());
signforExcel.setDeliveryTypeName(d.getDeliveryTypeName());
signforExcel.setSigningStatusName(d.getSigningStatusName());
signforExcel.setSigningTime(d.getSigningTime());
signforExcel.setDeliveryStatusName(d.getDeliveryStatusName());
signforExcel.setDeliveryPhone(d.getDriverPhone());
signforExcel.setLoadedNumber(d.getLoadedNumber());
signforExcel.setReceivedQuantity(d.getReceivedQuantity());
signforExcel.setReservationNum(d.getReservationNum());
signforExcel.setDeliveryAddress(d.getDeliveryAddress());
signforExcel.setWithoutScanning(d.getWithoutScanning());
signforExcel.setLoadingTime(d.getSigningTime());
signforExcel.setConsignee(d.getConsignee());
signforExcel.setDeliveryPhone(d.getDeliveryPhone());
signforExcel.setDeliveryTypeName(d.getDeliveryTypeName());
signforExcel.setSjsigningTime(d.getSjsigningTime());
signforExcel.setSigneeName(d.getSigneeName());
signforExcel.setSigningStatusName(d.getSigningStatus());
signforExcel.setDeliveryStatusName(d.getSijiSigningStatus());
signforExcel.setExamineUserName(d.getExamineUserName());
signforExcel.setWarehouseName(d.getWarehouseName());
signforExcel.setUnsigneds(d.getTotalNum() - d.getSigningNum());
a.add(signforExcel);
});
return a;
signforExcel.setTrainNumber(d.getTrainNumber());
signforExcel.setReservationCode(d.getReservationCode());
signforExcel.setDeliveryDriverName(d.getDriverName());
signforExcel.setDeliveryDriverPhone(d.getDriverPhone());
signforExcel.setVehicleName(d.getVehicleName());
signforExcel.setTaskTime(d.getTaskTime());
signforExcel.setOrderCode(d.getStockArticleId());
signforExcel.setDeliveryTypeName(d.getDeliveryTypeName());
signforExcel.setSigningStatusName(d.getSigningStatusName());
signforExcel.setSigningTime(d.getSigningTime());
signforExcel.setDeliveryStatusName(d.getDeliveryStatusName());
signforExcel.setDeliveryPhone(d.getDriverPhone());
signforExcel.setLoadedNumber(d.getLoadedNumber());
signforExcel.setReceivedQuantity(d.getReceivedQuantity());
signforExcel.setReservationNum(d.getReservationNum());
signforExcel.setDeliveryAddress(d.getDeliveryAddress());
signforExcel.setWithoutScanning(d.getWithoutScanning());
signforExcel.setLoadingTime(d.getSigningTime());
signforExcel.setConsignee(d.getConsignee());
signforExcel.setDeliveryPhone(d.getDeliveryPhone());
signforExcel.setDeliveryTypeName(d.getDeliveryTypeName());
signforExcel.setSjsigningTime(d.getSjsigningTime());
signforExcel.setSigneeName(d.getSigneeName());
signforExcel.setSigningStatusName(d.getSigningStatus());
signforExcel.setDeliveryStatusName(d.getSijiSigningStatus());
signforExcel.setExamineUserName(d.getExamineUserName());
signforExcel.setWarehouseName(d.getWarehouseName());
int unsigneds =d.getReservationNum() - d.getReceivedQuantity();
signforExcel.setUnsigneds(unsigneds);
a.add(signforExcel);
});
return a;
} catch (Exception e) {
e.printStackTrace();
}
return null;
// List<DistributionSignforVO> distributionSignforList = baseMapper.exportDistributionSignforSigningOwn(distributionSignforVO);
//
// List<DistributionSignforOwnExcel> list = new ArrayList<>();
// distributionSignforList.forEach(d -> {
// DistributionSignforOwnExcel signforExcel = Func.copy(d, DistributionSignforOwnExcel.class);
// assert signforExcel != null;
// signforExcel.setLoadingTime(d.getLoadingTime());
// signforExcel.setDeliveryDriverPhone(d.getDriverPhone());
// signforExcel.setDeliveryDriverName(d.getDriverName());
// signforExcel.setReservationNum(d.getTotalNum());
// signforExcel.setLoadedNumber(d.getPackageLoadingNum() + d.getInventoryLoadingNum());
// signforExcel.setReceivedQuantity(d.getPackageSigningNum() + d.getInventorySigningNum());
// signforExcel.setDeliveryStatusName(d.getDeliveryStatusName());
// signforExcel.setDeliveryPhone(d.getDeliveryPhone());
// signforExcel.setWithoutScanning(d.getTotalNum() - (d.getPackageLoadingNum() + d.getInventoryLoadingNum()));
// signforExcel.setUnsigneds(d.getTotalNum() - (d.getPackageSigningNum() + d.getInventorySigningNum()));
// signforExcel.setConsignee(d.getConsignee());
// list.add(signforExcel);
// });
// return list;
}
@Override
@ -2532,7 +2510,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
List<Long> packageLockIds = new ArrayList<>();
try {
@ -2773,10 +2750,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
.eq(DistributionLoadscanAbnormalEntity::getPackageCode, distrilbutionloadingscanDTO.getBarcode())
);
//查询是否存在驳回操作
if (!Func.isEmpty(abnormalEntity)){
if (abnormalEntity.getAuditingStatus().equals(3)) {
return Resp.scanFail("包件异常已驳回,请扫滞留", "包件异常已驳回,请扫滞留");
}
if (!Func.isEmpty(abnormalEntity)) {
if (abnormalEntity.getAuditingStatus().equals(3)) {
return Resp.scanFail("包件异常已驳回,请扫滞留", "包件异常已驳回,请扫滞留");
}
}
return R.fail(3006, null);
@ -3120,8 +3097,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (!packageLockIds.isEmpty()) {
List<Long> a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryListEntity.getTrainNumber() + "orderPackageCode:");
if (Func.isNotEmpty(a)) {
assert a != null;
boolean flag = a.stream().anyMatch(any -> packageLockIds.contains(any));
assert a != null;
boolean flag = a.stream().anyMatch(any -> packageLockIds.contains(any));
if (flag) {
//正在操作,请稍后重试
throw new RuntimeException("该包件正在被操作,请稍后再试!!!");
@ -3965,7 +3942,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
List<DistributionStockArticleEntity> distributionStockArticleEntities = distributionStockArticleService.listByIds(orderIds);
List<DistributionReservationStockarticleEntity> reservationOrders = distributionReservationStockarticleService.list(Wrappers.<DistributionReservationStockarticleEntity>query().lambda()
.eq(DistributionReservationStockarticleEntity::getReservationId, distributionDeliveryList.getReservationId())
.in(DistributionReservationStockarticleEntity::getStockArticleId, orderIds)
@ -4105,6 +4081,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
/**
* 寻找预约单中订单
*
* @param reservationOrders
* @param id
* @return
@ -6413,7 +6390,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return selectDistributionSignforPageCount;
}
@Override
@ -6706,11 +6682,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
private void buildReservationNameAndPhone(List<SignPushDataContactDTO> customers) {
for (SignPushDataContactDTO signPushDataUnitDTO : customers) {
User user = bladeRedis.get(RedisKeyConstant.USER_NAME_PHONE_KEY + signPushDataUnitDTO.getSignUserId());
log.info("buildNameAndPhone >>> 获取缓存的中的用户信息{}",user);
log.info("buildNameAndPhone >>> 获取缓存的中的用户信息{}", user);
if (user == null) {
R<User> userT = userClient.userInfoById(signPushDataUnitDTO.getSignUserId());
if (userT.isSuccess()) {
@ -6721,13 +6696,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (ObjectUtils.isNotNull(user)) {
assert user != null;
signPushDataUnitDTO.setSignUserName(user.getName());
if (ObjectUtils.isNotEmpty(user.getPhone())){
if (ObjectUtils.isNotEmpty(user.getPhone())) {
signPushDataUnitDTO.setSignUserPhone(user.getPhone());
}else {
if (ObjectUtils.isNotEmpty(user.getAccount())){
} else {
if (ObjectUtils.isNotEmpty(user.getAccount())) {
signPushDataUnitDTO.setSignUserPhone(user.getAccount());
}else {
log.info("用户无电话号码且账号信息为空>>用户名称:{}",user.getName());
} else {
log.info("用户无电话号码且账号信息为空>>用户名称:{}", user.getName());
}
}
}

2
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java

@ -119,7 +119,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
public IndexHandOrderDataVO handOrderData(IndexDTO indexDTO) {
//增加缓存
BladeUser user = AuthUtil.getUser();
String key = CacheNames.tenantKey(user.getTenantId(), user.getUserId() + "", "allocationData");
String key = CacheNames.tenantKey(user.getTenantId(), user.getUserId() + "", "handOrderData");
IndexHandOrderDataVO indexHandOrderDataVO = bladeRedis.get(key);
if (Objects.isNull(indexHandOrderDataVO)) {

Loading…
Cancel
Save