Browse Source

1.完成商户账号创建没有服务仓的问题

training
zhenghaoyu 2 years ago
parent
commit
cf27c8da50
  1. 2
      blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java
  2. 32
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientUserServiceImpl.java
  3. 33
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

2
blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java

@ -8,7 +8,7 @@ public interface ModuleNameConstant {
/** /**
* 如果不需要 "" * 如果不需要 ""
*/ */
public static final String DEVAUTH ="-pref"; public static final String DEVAUTH ="-zhy";
/** /**
* 工厂对接服务名称 * 工厂对接服务名称

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; package com.logpm.basicdata.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.entity.BasicdataClientEntity; import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataClientUserEntity; 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.mapper.BasicdataClientUserMapper;
import com.logpm.basicdata.service.IBasicdataClientService; import com.logpm.basicdata.service.IBasicdataClientService;
import com.logpm.basicdata.service.IBasicdataClientUserService; 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 com.logpm.basicdata.vo.BasicdataClientAccountVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.DictBizCache; import org.springblade.system.cache.DictBizCache;
import org.springblade.system.entity.User; import org.springblade.system.entity.User;
import org.springblade.system.entity.UserInfo; import org.springblade.system.entity.UserInfo;
@ -33,6 +40,10 @@ public class BasicdataClientUserServiceImpl extends BaseServiceImpl<BasicdataCli
private final IBasicdataClientService basicdataClientService; private final IBasicdataClientService basicdataClientService;
private final IBasicdataStorageServicesService basicdataStorageServicesService;
private final IBasicdataWarehouseService basicdataWarehouseService;
@Override @Override
public List<BasicdataClientEntity> getBasicdataClientUserEntityListByUserId(Long userId) { public List<BasicdataClientEntity> getBasicdataClientUserEntityListByUserId(Long userId) {
return baseMapper.getBasicdataClientUserEntityListByUserId(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); String defaultRoleId = DictBizCache.getValue(DictBizConstant.DEFAULT_MALL_ROLE_ID, DictBizConstant.DEFAULT_MALL_ROLE_ID);
u.setRoleId(defaultRoleId); 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); u.setDeptId(defaultDeptId);
userClient.saveUser(u); 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(); Long trayTypeId = targetTrayTypeEntity.getId();
List<WarehouseTrayGoodsEntity> addList = new ArrayList<>(); List<WarehouseTrayGoodsEntity> addList = new ArrayList<>();
for (WarehouseTrayGoodsEntity trayGoodsEntity:sourceTrayGoodsList){ for (WarehouseTrayGoodsEntity trayGoodsEntity:sourceTrayGoodsList){
Long associationId = trayGoodsEntity.getAssociationId(); Long associationId = trayGoodsEntity.getAssociationId();
String associationValue = trayGoodsEntity.getAssociationValue(); String associationValue = trayGoodsEntity.getAssociationValue();
Long marketId = trayGoodsEntity.getMarketId();
String incomingBatch = trayGoodsEntity.getIncomingBatch();
Integer newNum = trayGoodsEntity.getNum(); Integer newNum = trayGoodsEntity.getNum();
QueryWrapper<WarehouseTrayGoodsEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<WarehouseTrayGoodsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("association_id",associationId) queryWrapper.eq("association_id",associationId)
.eq("association_value",associationValue) .eq("association_value",associationValue)
.eq("market_id",marketId)
.eq("incoming_batch",incomingBatch)
.eq("tray_type_id",trayTypeId); .eq("tray_type_id",trayTypeId);
WarehouseTrayGoodsEntity oldTrayGoodsEntity = warehouseTrayGoodsService.getOne(queryWrapper); WarehouseTrayGoodsEntity oldTrayGoodsEntity = warehouseTrayGoodsService.getOne(queryWrapper);
if(!Objects.isNull(oldTrayGoodsEntity)){ if(!Objects.isNull(oldTrayGoodsEntity)){
Integer num = oldTrayGoodsEntity.getNum(); Integer num = oldTrayGoodsEntity.getNum();
oldTrayGoodsEntity.setNum(num+newNum); oldTrayGoodsEntity.setNum(num+newNum);
addList.add(oldTrayGoodsEntity); warehouseTrayGoodsService.updateById(oldTrayGoodsEntity);
sourceTrayGoodsList.remove(trayGoodsEntity); // addList.add(oldTrayGoodsEntity);
// sourceTrayGoodsList.remove(trayGoodsEntity);
continue; continue;
} }
@ -2097,7 +2101,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
trayGoodsEntity.setTrayCode(trayCode); trayGoodsEntity.setTrayCode(trayCode);
trayGoodsEntity.setTrayTypeId(trayTypeId); trayGoodsEntity.setTrayTypeId(trayTypeId);
} }
sourceTrayGoodsList.addAll(addList); // sourceTrayGoodsList.addAll(addList);
} }
private void panduanStockByMaterialName(List<WarehouseTrayGoodsEntity> sourceTrayGoodsList, Long filterId, String filterValue,WarehouseTrayTypeEntity targetTrayTypeEntity) { 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){ for (WarehouseTrayGoodsEntity trayGoodsEntity:sourceTrayGoodsList){
Long associationId = trayGoodsEntity.getAssociationId(); Long associationId = trayGoodsEntity.getAssociationId();
String associationValue = trayGoodsEntity.getAssociationValue(); String associationValue = trayGoodsEntity.getAssociationValue();
Long marketId = trayGoodsEntity.getMarketId();
String incomingBatch = trayGoodsEntity.getIncomingBatch();
Integer newNum = trayGoodsEntity.getNum(); Integer newNum = trayGoodsEntity.getNum();
QueryWrapper<WarehouseTrayGoodsEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<WarehouseTrayGoodsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("association_id",associationId) queryWrapper.eq("association_id",associationId)
.eq("association_value",associationValue) .eq("association_value",associationValue)
.eq("market_id",marketId)
.eq("incoming_batch",incomingBatch)
.eq("tray_type_id",trayTypeId); .eq("tray_type_id",trayTypeId);
WarehouseTrayGoodsEntity oldTrayGoodsEntity = warehouseTrayGoodsService.getOne(queryWrapper); WarehouseTrayGoodsEntity oldTrayGoodsEntity = warehouseTrayGoodsService.getOne(queryWrapper);
if(!Objects.isNull(oldTrayGoodsEntity)){ if(!Objects.isNull(oldTrayGoodsEntity)){
Integer num = oldTrayGoodsEntity.getNum(); Integer num = oldTrayGoodsEntity.getNum();
oldTrayGoodsEntity.setNum(num+newNum); oldTrayGoodsEntity.setNum(num+newNum);
addList.add(oldTrayGoodsEntity); warehouseTrayGoodsService.updateById(oldTrayGoodsEntity);
sourceTrayGoodsList.remove(trayGoodsEntity); // addList.add(oldTrayGoodsEntity);
// sourceTrayGoodsList.remove(trayGoodsEntity);
continue; continue;
} }
@ -2130,7 +2139,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
trayGoodsEntity.setTrayCode(trayCode); trayGoodsEntity.setTrayCode(trayCode);
trayGoodsEntity.setTrayTypeId(trayTypeId); trayGoodsEntity.setTrayTypeId(trayTypeId);
} }
sourceTrayGoodsList.addAll(addList); // sourceTrayGoodsList.addAll(addList);
} }
private void panduanZeroByOrderCode(List<WarehouseTrayGoodsEntity> sourceTrayGoodsList, Long filterId, String filterValue,WarehouseTrayTypeEntity targetTrayTypeEntity) { 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)){ if(!Objects.isNull(oldTrayGoodsEntity)){
Integer num = oldTrayGoodsEntity.getNum(); Integer num = oldTrayGoodsEntity.getNum();
oldTrayGoodsEntity.setNum(num+newNum); oldTrayGoodsEntity.setNum(num+newNum);
addList.add(oldTrayGoodsEntity); warehouseTrayGoodsService.updateById(oldTrayGoodsEntity);
sourceTrayGoodsList.remove(trayGoodsEntity); // addList.add(oldTrayGoodsEntity);
// sourceTrayGoodsList.remove(trayGoodsEntity);
continue; continue;
} }
@ -2186,8 +2196,9 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
if(!Objects.isNull(oldTrayGoodsEntity)){ if(!Objects.isNull(oldTrayGoodsEntity)){
Integer num = oldTrayGoodsEntity.getNum(); Integer num = oldTrayGoodsEntity.getNum();
oldTrayGoodsEntity.setNum(num+newNum); oldTrayGoodsEntity.setNum(num+newNum);
addList.add(oldTrayGoodsEntity); warehouseTrayGoodsService.updateById(oldTrayGoodsEntity);
sourceTrayGoodsList.remove(trayGoodsEntity); // addList.add(oldTrayGoodsEntity);
// sourceTrayGoodsList.remove(trayGoodsEntity);
continue; continue;
} }

Loading…
Cancel
Save