|
|
@ -2,6 +2,7 @@ package com.dreamchaser.depository_manage.service.impl; |
|
|
|
|
|
|
|
|
import com.dreamchaser.depository_manage.entity.Depository; |
|
|
import com.dreamchaser.depository_manage.entity.Depository; |
|
|
import com.dreamchaser.depository_manage.entity.MaterialType; |
|
|
import com.dreamchaser.depository_manage.entity.MaterialType; |
|
|
|
|
|
import com.dreamchaser.depository_manage.exception.MyException; |
|
|
import com.dreamchaser.depository_manage.mapper.DepositoryMapper; |
|
|
import com.dreamchaser.depository_manage.mapper.DepositoryMapper; |
|
|
import com.dreamchaser.depository_manage.mapper.MaterialTypeMapper; |
|
|
import com.dreamchaser.depository_manage.mapper.MaterialTypeMapper; |
|
|
import com.dreamchaser.depository_manage.mapper.RoleMapper; |
|
|
import com.dreamchaser.depository_manage.mapper.RoleMapper; |
|
|
@ -95,6 +96,7 @@ public class RoleServiceImpl implements RoleService { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 根据仓库获取userId |
|
|
* 根据仓库获取userId |
|
|
|
|
|
* |
|
|
* @param did |
|
|
* @param did |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
@ -105,6 +107,7 @@ public class RoleServiceImpl implements RoleService { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 根据类型id获取userId |
|
|
* 根据类型id获取userId |
|
|
|
|
|
* |
|
|
* @param mtId |
|
|
* @param mtId |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
@ -188,13 +191,14 @@ public class RoleServiceImpl implements RoleService { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 查询当前物料类型的管理人员 |
|
|
* 查询当前物料类型的管理人员 |
|
|
|
|
|
* |
|
|
* @param mtId 待查询类型id |
|
|
* @param mtId 待查询类型id |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public List<RoleAndMaterialType> findRoleAndMaterialTypeByMtId(Long mtId) { |
|
|
public List<RoleAndMaterialType> findRoleAndMaterialTypeByMtId(Long mtId) { |
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
map.put("mtid",mtId); |
|
|
map.put("mtid", mtId); |
|
|
return roleMapper.findRoleAndMaterialTypeByCondition(map); |
|
|
return roleMapper.findRoleAndMaterialTypeByCondition(map); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -266,6 +270,42 @@ public class RoleServiceImpl implements RoleService { |
|
|
return roleMapper.findRoleAndDepositoryByCondition(map); |
|
|
return roleMapper.findRoleAndDepositoryByCondition(map); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 用于添加添加仓库可见范围 |
|
|
|
|
|
* |
|
|
|
|
|
* @param map 添加具体数据 |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public Integer addWarehouseVisiblePermission(Map<String, Object> map) { |
|
|
|
|
|
// 获取当前赋值的权限类型
|
|
|
|
|
|
String type = (String) map.get("type"); |
|
|
|
|
|
// 定义返回结果
|
|
|
|
|
|
Integer result = 0; |
|
|
|
|
|
// 用于插入权限列表
|
|
|
|
|
|
Map<String, Object> paramForInsert = new HashMap<>(); |
|
|
|
|
|
paramForInsert.put("userId", map.get("userId")); |
|
|
|
|
|
paramForInsert.put("time", System.currentTimeMillis()); |
|
|
|
|
|
paramForInsert.put("depositoryIdList", map.get("depositoryIds")); |
|
|
|
|
|
paramForInsert.put("state", 1); |
|
|
|
|
|
List<Object> userIds = (List<Object>) map.get("userIds"); |
|
|
|
|
|
if ("person".equals(type)) { |
|
|
|
|
|
// 如果是对人员赋权
|
|
|
|
|
|
paramForInsert.put("type", 1); |
|
|
|
|
|
} else if ("post".equals(type)) { |
|
|
|
|
|
// 如果是对岗位赋权
|
|
|
|
|
|
paramForInsert.put("type", 2); |
|
|
|
|
|
} else { |
|
|
|
|
|
throw new MyException("未知参数错误"); |
|
|
|
|
|
} |
|
|
|
|
|
for (Object userId : userIds |
|
|
|
|
|
) { |
|
|
|
|
|
paramForInsert.put("uid", userId); |
|
|
|
|
|
result += roleMapper.addWarehouseVisiblePermission(paramForInsert); |
|
|
|
|
|
} |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 获取当前仓库的子仓库 |
|
|
* 获取当前仓库的子仓库 |
|
|
|