Browse Source

1.仓配代码bug修改

training
zhenghaoyu 2 years ago
parent
commit
c0b26b1aa3
  1. 68
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java
  2. 5
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/wrapper/WarehouseGoodsAreaWrapper.java
  3. 22
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  4. 10
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java
  5. 29
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java
  6. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/UpdownTypeDTO.java
  7. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

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

@ -45,9 +45,7 @@ import org.springblade.system.feign.IDeptClient;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.*;
/**
* 仓库 服务实现类
@ -164,28 +162,31 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl<BasicdataWare
@Override
public List<BasicdataWarehouseEntity> getMyWarehouseList() {
Set<Long> deptIds = new HashSet<>();
// 获取当前登陆人
BladeUser user = AuthUtil.getUser();
//查询出部门表
String deptId = user.getDeptId();
List<Dept> userDeptNode = deptClient.getUserDeptNode(Long.parseLong(deptId));
String[] split = deptId.split(",");
for (String s : split) {
List<Dept> userDeptNode = deptClient.getUserDeptNode(Long.parseLong(s));
if (Func.isEmpty(userDeptNode)) {
continue;
} else {
userDeptNode.forEach(u -> {
deptIds.add(u.getId());
});
}
}
List<Long> deptIds = new ArrayList<>();
if (Func.isEmpty(userDeptNode)) {
log.error("userDeptNode用户部门信息有误+{" + userDeptNode + "}");
return null;
} else {
userDeptNode.forEach(u -> {
deptIds.add(u.getId());
});
}
List<BasicdataWarehouseEntity> warehouseEntityList = baseMapper.selectList(Wrappers.<BasicdataWarehouseEntity>query().lambda().in(BasicdataWarehouseEntity::getDepartment, deptIds));
// String json = redis.get(CacheNames.tenantKeyObj(user.getTenantId(), CacheNames.USER_WAREHOUSE_KEY, user.getUserId()));
if (warehouseEntityList.size() <= 1) {
redis.setEx(CacheNames.tenantKeyObj(user.getTenantId(), CacheNames.USER_WAREHOUSE_KEY, user.getUserId()), warehouseEntityList.get(0), 30 * 24 * 60 * 60L);
}
// if (warehouseEntityList.size() <= 1) {
// redis.setEx(CacheNames.tenantKeyObj(user.getTenantId(), CacheNames.USER_WAREHOUSE_KEY, user.getUserId()), warehouseEntityList.get(0), 30 * 24 * 60 * 60L);
// }
return warehouseEntityList;
}
@ -193,18 +194,31 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl<BasicdataWare
public BasicdataWarehouseEntity getMyWarehouseList(String deptId, String tenantId, Long userId) {
//查询出部门表
List<Dept> userDeptNode = deptClient.getUserDeptNode(Long.parseLong(deptId));
// List<Dept> userDeptNode = deptClient.getUserDeptNode(Long.parseLong(deptId));
Set<Long> deptIds = new HashSet<>();
// String deptId = user.getDeptId();
String[] split = deptId.split(",");
for (String s : split) {
List<Dept> userDeptNode = deptClient.getUserDeptNode(Long.parseLong(s));
if (Func.isEmpty(userDeptNode)) {
continue;
} else {
userDeptNode.forEach(u -> {
deptIds.add(u.getId());
});
}
}
List<Long> deptIds = new ArrayList<>();
if (Func.isEmpty(userDeptNode)) {
log.error("userDeptNode用户部门信息有误+{" + userDeptNode + "}");
return null;
} else {
userDeptNode.forEach(u -> {
deptIds.add(u.getId());
});
}
// if (Func.isEmpty(userDeptNode)) {
// log.error("userDeptNode用户部门信息有误+{" + userDeptNode + "}");
// return null;
// } else {
// userDeptNode.forEach(u -> {
// deptIds.add(u.getId());
// });
// }
BasicdataWarehouseEntity warehouseEntity = null;
List<BasicdataWarehouseEntity> warehouseEntityList = baseMapper.selectList(Wrappers.<BasicdataWarehouseEntity>query().lambda().in(BasicdataWarehouseEntity::getDepartment, deptIds));
// String json = redis.get(CacheNames.tenantKeyObj(user.getTenantId(), CacheNames.USER_WAREHOUSE_KEY, user.getUserId()));

5
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/wrapper/WarehouseGoodsAreaWrapper.java

@ -17,6 +17,7 @@
package com.logpm.basicdata.wrapper;
import com.logpm.basicdata.vo.BasicdataGoodsAreaVO;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
@ -33,6 +34,7 @@ import java.util.Objects;
* @since 2023-08-08
*/
@Slf4j
public class WarehouseGoodsAreaWrapper extends BaseEntityWrapper<BasicdataGoodsAreaVO, BasicdataGoodsAreaVO> {
IUserClient userCliient = SpringUtil.getBean(IUserClient.class);
public static WarehouseGoodsAreaWrapper build() {
@ -42,7 +44,10 @@ public class WarehouseGoodsAreaWrapper extends BaseEntityWrapper<BasicdataGoodsA
@Override
public BasicdataGoodsAreaVO entityVO(BasicdataGoodsAreaVO warehouseWaybill) {
BasicdataGoodsAreaVO basicdataGoodsAreaVO = Objects.requireNonNull(BeanUtil.copy(warehouseWaybill, BasicdataGoodsAreaVO.class));
log.info("##############basicdataGoodsAreaVO={}",basicdataGoodsAreaVO);
log.info("##############userCliient={}",userCliient);
basicdataGoodsAreaVO.setCreateUserName(userCliient.userInfoById(basicdataGoodsAreaVO.getCreateUser()).getData().getName());
basicdataGoodsAreaVO.setAreaTypeName(DictBizCache.getValue(DictBizConstant.AREA_TYPE,basicdataGoodsAreaVO.getAreaType()));
return basicdataGoodsAreaVO;
}

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

@ -32,21 +32,21 @@ import com.logpm.distribution.dto.*;
import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO;
import com.logpm.distribution.dto.app.DistrilbutionloadingscanDTO;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.excel.DisStockListDetailExcel;
import com.logpm.distribution.excel.DistributionDeliveryListExcel;
import com.logpm.distribution.mapper.*;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.vo.app.*;
import com.logpm.distribution.wrapper.*;
import com.logpm.distribution.wrapper.DistributionDeliveryListWrapper;
import com.logpm.distribution.wrapper.DistributionParcelListWrapper;
import com.logpm.distribution.wrapper.DistributionReservationWrapper;
import com.logpm.distribution.wrapper.DistributionStockArticleWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.springblade.common.constant.DistributionTypeConstant;
import org.springblade.common.constant.Inventory.InventoryLoadingStatusConstant;
import org.springblade.common.constant.Inventory.InventoryPackageStatusConstant;
import org.springblade.common.constant.Inventory.InventorySigningStatusConstant;
import org.springblade.common.constant.delivery.DeliveryLoadingStatusConstant;
import org.springblade.common.constant.delivery.DeliveryStatusConstant;
import org.springblade.common.constant.loading.LoadingIsInsertConstant;
@ -68,6 +68,7 @@ import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.DictBizCache;
import org.springblade.system.feign.IDictBizClient;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@ -1569,15 +1570,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//判断当前登录人是否为司机
List<DistributionAppDeliveryListVO> distributionAppDeliveryListVOS = new ArrayList<>();
boolean delivery = false;
if (roleId.contains(",")) {
String[] split = roleId.split(",");
for (int i = 0; i < split.length; i++) {
R<String> value = dictBizClient.getValue("role_class", split[i]);
if (value.getData().trim().equals("delivery_driver")) {
delivery = true;
}
}
}
String value1 = DictBizCache.getValue("role_class", "delivery_driver");
if(roleId.contains(value1)) delivery = true;
// R<String> value = dictBizClient.getValue("role_class", roleId);
if (delivery) {
//查询当前登录人的配送任务

10
blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java

@ -484,6 +484,8 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.bufenruku.getValue());
distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.bufenshouhuo.getValue());
distributionStockArticleEntity.setWarehouseEntryTime(date);
id = distributionStockArticleClient.addData(distributionStockArticleEntity);
distributionStockArticleEntity.setId(id);
if (id == 0) {
@ -571,7 +573,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
*/
private void saveOrderPackage(String unitNo, DistributionStockArticleEntity distributionStockArticleEntity, BasicdataWarehouseEntity basicdataWarehouseEntity, String waybillNo) {
DistributionParcelListEntityVO vo = advanceDetailClient.getByUnitNo(unitNo);
WarehouseWaybillEntity warehouseWaybill = warehouseWaybillClient.findByWaybillNo(waybillNo);
// WarehouseWaybillEntity warehouseWaybill = warehouseWaybillClient.findByWaybillNo(waybillNo);
DistributionParcelListEntity entity = new DistributionParcelListEntity();
BeanUtil.copyProperties(vo, entity);
@ -588,9 +590,9 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
entity.setOrderCode(distributionStockArticleEntity.getOrderCode());
entity.setServiceNumber(distributionStockArticleEntity.getServiceNumber());
entity.setWaybillNumber(waybillNo);
if(ObjectUtil.isNotEmpty(warehouseWaybill)){
entity.setWarehouseId(warehouseWaybill.getId());
}
// if(ObjectUtil.isNotEmpty(warehouseWaybill)){
// entity.setWarehouseId(warehouseWaybill.getId());
// }
// 增加 进销商 名称 编码 发站仓

29
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java

@ -104,6 +104,35 @@ public class WarehouseUpdownTypeApiController {
}
}
// @ResponseBody
// @PostMapping("/orderUpshelfDetail")
// @ApiOperationSupport(order = 1)
// @ApiOperation(value = "已上架订单详情", notes = "传入trayTypeDTO")
// public R upShelfScanAllocation(@RequestBody UpdownTypeDTO updownTypeDTO ) {
// String method = "###########orderUpshelfDetail: ";
// log.info(method + "已上架订单详情 updownTypeDTO={}", updownTypeDTO);
// String orderCode = updownTypeDTO.getOrderCode();
// try{
//
// if(StringUtil.isBlank(orderCode)){
// log.warn(method+"订单编码不能为空 orderCode={}",orderCode);
// return R.fail(403,"订单编码不能为空");
// }
//
// //查询该库位的货物信息
// PositionVO upShelfAllocationVO = warehouseUpdownTypeService.upShelfScanAllocation(allocationId,myCurrentWarehouse.getId());
// return R.data(upShelfAllocationVO);
// }catch (CustomerException e){
// log.warn(e.message);
// return R.fail(e.code,e.message);
// }catch (Exception e){
// log.error(method+"系统异常,联系管理员",e);
// return R.fail(500,"系统异常,联系管理员");
// }
//
// }
@ResponseBody
@PostMapping("/upShelfOrder")
@ApiOperationSupport(order = 1)

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/UpdownTypeDTO.java

@ -51,4 +51,6 @@ public class UpdownTypeDTO implements Serializable {
@ApiModelProperty(name = "托盘码列表",notes = "托盘码列表")
private List<String> trayCodes;//托盘码s
private String orderCode;//订单号
}

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

@ -368,7 +368,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
String orderCode = parcelListEntity.getOrderCode();//订单自编码
Long wid = parcelListEntity.getWarehouseId();
if(!wid.equals(warehouseId)){
log.warn("##############orderScanOrderPackageCode: 包件不在当前仓 orderPackageCode={} wid={}",orderPackageCode,wid);
log.warn("##############orderScanOrderPackageCode: 包件不在当前仓 orderPackageCode={} wid={} warehouseId={}",orderPackageCode,wid,warehouseId);
return R.fail(403,"包件不在当前仓");
}

Loading…
Cancel
Save