|
@@ -1,11 +1,13 @@
|
|
|
package com.energy.manage.service.service.system.impl;
|
|
|
|
|
|
import com.energy.manage.common.enums.TypeRelationEnum;
|
|
|
+import com.energy.manage.common.po.powerwordcriterion.PowerWordCriterionPO;
|
|
|
import com.energy.manage.common.po.system.SysOrganizationAuthPO;
|
|
|
import com.energy.manage.service.mappers.system.SysOrganizationAuthMapper;
|
|
|
import com.energy.manage.service.service.system.SysOrganizationAuthService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import tk.mybatis.mapper.entity.Example;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -14,6 +16,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 企业风场关系
|
|
|
+ *
|
|
|
* @author chy
|
|
|
* @date 2024/5/21 09:36
|
|
|
* @desc
|
|
@@ -31,15 +34,27 @@ public class SysOrganizationAuthServiceImpl implements SysOrganizationAuthServic
|
|
|
|
|
|
/**
|
|
|
* 根据角色id获取风场编号列表
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public Map<String, List<SysOrganizationAuthPO>> queryCodeNunByRoleId(Integer roleId){
|
|
|
- Map<String,List<SysOrganizationAuthPO>> returnMap = new HashMap<>();
|
|
|
+ public Map<String, List<SysOrganizationAuthPO>> queryCodeNunByRoleId(Integer roleId) {
|
|
|
+ Map<String, List<SysOrganizationAuthPO>> returnMap = new HashMap<>();
|
|
|
List<SysOrganizationAuthPO> authPoList = sysOrganizationAuthMapper.selectByRoleId(roleId);
|
|
|
authPoList.parallelStream().filter(po -> po.getCodeType().equals(TypeRelationEnum.WIND_FIELD_NUMBER.getCode()))
|
|
|
- .collect(Collectors.toList());
|
|
|
- returnMap.put(FILE_CODE_LIST_KEY,authPoList);
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ returnMap.put(FILE_CODE_LIST_KEY, authPoList);
|
|
|
return returnMap;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean verifySysOrganizationAuthByType(String codeName, String type) {
|
|
|
+ Example queryExample = new Example(SysOrganizationAuthPO.class);
|
|
|
+ Example.Criteria criteria = queryExample.createCriteria();
|
|
|
+ criteria.andEqualTo("codeNumber", codeName);
|
|
|
+ criteria.andEqualTo("codeType", type);
|
|
|
+ return sysOrganizationAuthMapper.selectCountByExample(queryExample) > 0 ? false : true;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|