Browse Source

Merge branch 'dev' into pre-production

# Conflicts:
#	blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java
newStockUp
zhenghaoyu 1 year ago
parent
commit
d2e07ad694
  1. 32
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientUserServiceImpl.java
  2. 33
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

32
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientUserServiceImpl.java

@ -1,19 +1,26 @@
package com.logpm.basicdata.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataClientUserEntity;
import com.logpm.basicdata.entity.BasicdataStorageServicesEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.mapper.BasicdataClientUserMapper;
import com.logpm.basicdata.service.IBasicdataClientService;
import com.logpm.basicdata.service.IBasicdataClientUserService;
import com.logpm.basicdata.service.IBasicdataStorageServicesService;
import com.logpm.basicdata.service.IBasicdataWarehouseService;
import com.logpm.basicdata.vo.BasicdataClientAccountVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.DictBizCache;
import org.springblade.system.entity.User;
import org.springblade.system.entity.UserInfo;
@ -33,6 +40,10 @@ public class BasicdataClientUserServiceImpl extends BaseServiceImpl<BasicdataCli
private final IBasicdataClientService basicdataClientService;
private final IBasicdataStorageServicesService basicdataStorageServicesService;
private final IBasicdataWarehouseService basicdataWarehouseService;
@Override
public List<BasicdataClientEntity> getBasicdataClientUserEntityListByUserId(Long userId) {
return baseMapper.getBasicdataClientUserEntityListByUserId(userId);
@ -114,7 +125,26 @@ public class BasicdataClientUserServiceImpl extends BaseServiceImpl<BasicdataCli
String defaultRoleId = DictBizCache.getValue(DictBizConstant.DEFAULT_MALL_ROLE_ID, DictBizConstant.DEFAULT_MALL_ROLE_ID);
u.setRoleId(defaultRoleId);
String defaultDeptId = DictBizCache.getValue(DictBizConstant.DEFAULT_DEPT_ID, DictBizConstant.DEFAULT_DEPT_ID);
// String defaultDeptId = DictBizCache.getValue(DictBizConstant.DEFAULT_DEPT_ID, DictBizConstant.DEFAULT_DEPT_ID);
String defaultDeptId = "";
QueryWrapper<BasicdataStorageServicesEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("client_id",clientId)
.eq("is_deleted",0);
List<BasicdataStorageServicesEntity> storageServicesEntityList = basicdataStorageServicesService.list(queryWrapper);
if(storageServicesEntityList.size() == 0){
throw new CustomerException(403,"该用户未配置服务仓");
}
for (BasicdataStorageServicesEntity storageServicesEntity:storageServicesEntityList){
Long serveWarehouseId = storageServicesEntity.getServeWarehouseId();//服务仓id
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseService.getById(serveWarehouseId);
Long department = warehouseEntity.getDepartment();
if(StringUtil.isBlank(defaultDeptId)){
defaultDeptId = defaultDeptId + department;
}else{
defaultDeptId = defaultDeptId + "," + department;
}
}
u.setDeptId(defaultDeptId);
userClient.saveUser(u);

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

@ -2072,20 +2072,24 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
Long trayTypeId = targetTrayTypeEntity.getId();
List<WarehouseTrayGoodsEntity> addList = new ArrayList<>();
for (WarehouseTrayGoodsEntity trayGoodsEntity:sourceTrayGoodsList){
Long associationId = trayGoodsEntity.getAssociationId();
String associationValue = trayGoodsEntity.getAssociationValue();
Long marketId = trayGoodsEntity.getMarketId();
String incomingBatch = trayGoodsEntity.getIncomingBatch();
Integer newNum = trayGoodsEntity.getNum();
QueryWrapper<WarehouseTrayGoodsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("association_id",associationId)
.eq("association_value",associationValue)
.eq("market_id",marketId)
.eq("incoming_batch",incomingBatch)
.eq("tray_type_id",trayTypeId);
WarehouseTrayGoodsEntity oldTrayGoodsEntity = warehouseTrayGoodsService.getOne(queryWrapper);
if(!Objects.isNull(oldTrayGoodsEntity)){
Integer num = oldTrayGoodsEntity.getNum();
oldTrayGoodsEntity.setNum(num+newNum);
addList.add(oldTrayGoodsEntity);
sourceTrayGoodsList.remove(trayGoodsEntity);
warehouseTrayGoodsService.updateById(oldTrayGoodsEntity);
// addList.add(oldTrayGoodsEntity);
// sourceTrayGoodsList.remove(trayGoodsEntity);
continue;
}
@ -2097,7 +2101,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
trayGoodsEntity.setTrayCode(trayCode);
trayGoodsEntity.setTrayTypeId(trayTypeId);
}
sourceTrayGoodsList.addAll(addList);
// sourceTrayGoodsList.addAll(addList);
}
private void panduanStockByMaterialName(List<WarehouseTrayGoodsEntity> sourceTrayGoodsList, Long filterId, String filterValue,WarehouseTrayTypeEntity targetTrayTypeEntity) {
@ -2108,17 +2112,22 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
for (WarehouseTrayGoodsEntity trayGoodsEntity:sourceTrayGoodsList){
Long associationId = trayGoodsEntity.getAssociationId();
String associationValue = trayGoodsEntity.getAssociationValue();
Long marketId = trayGoodsEntity.getMarketId();
String incomingBatch = trayGoodsEntity.getIncomingBatch();
Integer newNum = trayGoodsEntity.getNum();
QueryWrapper<WarehouseTrayGoodsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("association_id",associationId)
.eq("association_value",associationValue)
.eq("market_id",marketId)
.eq("incoming_batch",incomingBatch)
.eq("tray_type_id",trayTypeId);
WarehouseTrayGoodsEntity oldTrayGoodsEntity = warehouseTrayGoodsService.getOne(queryWrapper);
if(!Objects.isNull(oldTrayGoodsEntity)){
Integer num = oldTrayGoodsEntity.getNum();
oldTrayGoodsEntity.setNum(num+newNum);
addList.add(oldTrayGoodsEntity);
sourceTrayGoodsList.remove(trayGoodsEntity);
warehouseTrayGoodsService.updateById(oldTrayGoodsEntity);
// addList.add(oldTrayGoodsEntity);
// sourceTrayGoodsList.remove(trayGoodsEntity);
continue;
}
@ -2130,7 +2139,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
trayGoodsEntity.setTrayCode(trayCode);
trayGoodsEntity.setTrayTypeId(trayTypeId);
}
sourceTrayGoodsList.addAll(addList);
// sourceTrayGoodsList.addAll(addList);
}
private void panduanZeroByOrderCode(List<WarehouseTrayGoodsEntity> sourceTrayGoodsList, Long filterId, String filterValue,WarehouseTrayTypeEntity targetTrayTypeEntity) {
@ -2150,8 +2159,9 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
if(!Objects.isNull(oldTrayGoodsEntity)){
Integer num = oldTrayGoodsEntity.getNum();
oldTrayGoodsEntity.setNum(num+newNum);
addList.add(oldTrayGoodsEntity);
sourceTrayGoodsList.remove(trayGoodsEntity);
warehouseTrayGoodsService.updateById(oldTrayGoodsEntity);
// addList.add(oldTrayGoodsEntity);
// sourceTrayGoodsList.remove(trayGoodsEntity);
continue;
}
@ -2186,8 +2196,9 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
if(!Objects.isNull(oldTrayGoodsEntity)){
Integer num = oldTrayGoodsEntity.getNum();
oldTrayGoodsEntity.setNum(num+newNum);
addList.add(oldTrayGoodsEntity);
sourceTrayGoodsList.remove(trayGoodsEntity);
warehouseTrayGoodsService.updateById(oldTrayGoodsEntity);
// addList.add(oldTrayGoodsEntity);
// sourceTrayGoodsList.remove(trayGoodsEntity);
continue;
}

Loading…
Cancel
Save