|
@@ -113,10 +113,10 @@ public class AnalysisServiceImpl implements AnalysisService {
|
|
|
private AnalysisResultReportMapper resultReportMapper;
|
|
|
|
|
|
@Autowired
|
|
|
- private WindFieldMapper windFieldMapper;
|
|
|
+ private SysOrganizationAuthMapper sysOrganizationAuthMapper;
|
|
|
|
|
|
@Autowired
|
|
|
- private SysOrganizationAuthMapper sysOrganizationAuthMapper;
|
|
|
+ private WindFieldMapper windFieldMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private AlgorithmProperties algorithmProperties;
|
|
@@ -154,6 +154,9 @@ public class AnalysisServiceImpl implements AnalysisService {
|
|
|
*/
|
|
|
private final static String SEPARATOR = "-";
|
|
|
|
|
|
+
|
|
|
+ private final static String ZREO_STR = "0";
|
|
|
+
|
|
|
/**
|
|
|
* 风机编号正则
|
|
|
*/
|
|
@@ -375,9 +378,32 @@ public class AnalysisServiceImpl implements AnalysisService {
|
|
|
*/
|
|
|
@Override
|
|
|
public List<Map<String, Object>> getAnalysisCodeInfo(Integer roleId) {
|
|
|
-// List<CompanyFieldAndBatchTreeVo> list = sysOrganizationAuthMapper.selectSysOrganizationAuthTreeByRoleId(roleId);
|
|
|
+ //查询所有权限风场
|
|
|
+ List<SysOrganizationAuthVo> list = sysOrganizationAuthMapper.selectInfoByRoleId(roleId);
|
|
|
+ List<CompanyFieldAndBatchTreeVo> transferList = new ArrayList<>();
|
|
|
+ list.stream().forEachOrdered(item -> transferList.add(transferVo(item)));
|
|
|
+ return TreeUtil.getJava8ResultTree(BeanMapUtils.listBeanToListMap(transferList));
|
|
|
+ }
|
|
|
|
|
|
- return null;
|
|
|
+ /**
|
|
|
+ * 转换vo
|
|
|
+ * @param authVo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private CompanyFieldAndBatchTreeVo transferVo(SysOrganizationAuthVo authVo){
|
|
|
+ CompanyFieldAndBatchTreeVo treeVo = new CompanyFieldAndBatchTreeVo();
|
|
|
+ treeVo.setCodeNumber(authVo.getCodeNumber())
|
|
|
+ .setCodeType(authVo.getCodeType());
|
|
|
+ if(StringUtils.isBlank(authVo.getCompanyCode())){
|
|
|
+ treeVo.setFieldOrCompanyName(authVo.getCompanyName())
|
|
|
+ .setParentCode(ZREO_STR);
|
|
|
+ }else{
|
|
|
+ treeVo.setFieldOrCompanyName(authVo.getFieldName())
|
|
|
+ .setCodeNumber(authVo.getCodeNumber())
|
|
|
+ .setParentCode(authVo.getCompanyCode())
|
|
|
+ .setBatchCodes(analysisResultMapper.selectShortInfoByFieldCode(authVo.getCodeNumber()));
|
|
|
+ }
|
|
|
+ return treeVo;
|
|
|
}
|
|
|
|
|
|
/**
|