Browse Source

寻找仓库报错

single_db
pref_mail@163.com 1 year ago
parent
commit
458c94119a
  1. 28
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java
  2. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java
  3. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/StockupStateUpdateHandler.java
  4. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java

28
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java

@ -168,7 +168,7 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl<BasicdataWare
// 最大的管理员
if(StringUtil.isBlank(user.getRoleId())){
if (StringUtil.isBlank(user.getRoleId())) {
return null;
}
@ -245,18 +245,26 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl<BasicdataWare
@Override
public BasicdataWarehouseEntity getMyCurrentWarehouse() {
// 根据当前登陆人的信息和角色判断查询是所属仓库 还是服务仓库
BladeUser user = AuthUtil.getUser();
String json = redis.get(CacheNames.tenantKeyObj(user.getTenantId(), CacheNames.USER_WAREHOUSE_KEY, user.getUserId()));
if (StringUtil.isBlank(json)) {
List<BasicdataWarehouseEntity> myWarehouseList = getMyWarehouseList();
if (myWarehouseList != null) {
if (myWarehouseList.size() == 1) {
return myWarehouseList.get(0);
try {
BladeUser user = AuthUtil.getUser();
String json = redis.get(CacheNames.tenantKeyObj(user.getTenantId(), CacheNames.USER_WAREHOUSE_KEY, user.getUserId()));
if (StringUtil.isBlank(json)) {
List<BasicdataWarehouseEntity> myWarehouseList = getMyWarehouseList();
if (myWarehouseList != null) {
if (myWarehouseList.size() == 1) {
return myWarehouseList.get(0);
}
}
}
BasicdataWarehouseEntity o = JSONObject.parseObject(json, BasicdataWarehouseEntity.class);
return o;
} catch (Exception e) {
log.error(">>>>>> 获取仓库信息错误",e);
}
BasicdataWarehouseEntity o = JSONObject.parseObject(json, BasicdataWarehouseEntity.class);
return o;
return null;
}
@Override

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java

@ -65,6 +65,7 @@ import org.springblade.common.constant.reservation.ReservationPackageStatusConst
import org.springblade.common.constant.reservation.ReservationSigningStatusConstant;
import org.springblade.common.constant.stockup.StockupStatusConstant;
import org.springblade.common.constant.stockup.StockupTypeStatusConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.exception.ServiceException;
@ -1505,6 +1506,8 @@ public class DistributionStockupAppController extends BladeController {
*/
@NotNull
private R stockupScanByCustom(StockupDTO stockupDTO) {
//包件扫描
String orderCode = stockupDTO.getOrderCode();//订单自编号
String packetBarCode = stockupDTO.getPacketBarCode();//包件码
@ -1589,9 +1592,16 @@ public class DistributionStockupAppController extends BladeController {
map.put("logId", entity.getId());
map.put("messageData", entity);
map.put("createTime", new Date().getTime());
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
log.info(">>>> find bug myCurrentWarehouse {}",myCurrentWarehouse);
if (Objects.isNull(myCurrentWarehouse)) {
throw new CustomerException(403, "仓库信息不能为空");
}
//将消息携带绑定键值
rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_SCAN_EXCHANGE, RabbitConstant.STOCKUP_SCAN_ROUTING, map);
//查询是否货位数据是否该下架
Map<String, Object> mapState = new HashMap<>();
mapState.put("messageId", CommonUtil.getUUID());
@ -1601,6 +1611,7 @@ public class DistributionStockupAppController extends BladeController {
mapState.put("reservationId", stockupDTO.getReservationId());
mapState.put("logId", entity.getId());
mapState.put("messageData", entity);
mapState.put("warehouseId",myCurrentWarehouse.getId());
mapState.put("createTime", new Date().getTime());

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/StockupStateUpdateHandler.java

@ -40,6 +40,7 @@ public class StockupStateUpdateHandler {
messageData.setStockupId((Long) map.get("stockupId"));
messageData.setTypeService(String.valueOf( map.get("typeService")));
messageData.setReservationId((Long) map.get("reservationId"));
messageData.setWarehouseId((Long)map.get("warehouseId"));
//查询是否货位数据是否该下架
distributionAsyncService.stockupSelfOffShelf(messageData);
log.info("######STOCKUP_STATE_UPDATE_QUEUE:备货下架查询成功");

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java

@ -643,11 +643,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
*/
@Override
public void stockupSelfOffShelf(StockupDTO stockupDTO) throws InterruptedException {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
log.info(">>>> find bug {}",myCurrentWarehouse);
if (Objects.isNull(myCurrentWarehouse)) {
throw new CustomerException(403, "仓库信息不能为空");
}
//判断类型
List<DistributionStockupSelfVO> distributionStockupSelfVO = new ArrayList<>();
@ -656,7 +652,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
distributionStockupSelfVO = distributionStockupMapper.stockupSelfOffShelf(stockupDTO);
} else {
//商 市
log.info(">>>> find bug {}",stockupDTO);
log.info(">>>> find bug stockupDTO {}",stockupDTO);
distributionStockupSelfVO = distributionStockupMapper.stockupOffShelf(stockupDTO);
}
//有
@ -678,7 +674,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
if (a.get() == b.get()) {
//下架
list.forEach(i -> {
warehouseUpdownTypeClient.downPackage(i, myCurrentWarehouse.getId());
warehouseUpdownTypeClient.downPackage(i, stockupDTO.getWarehouseId());
});
}

Loading…
Cancel
Save