Commit 72f66588 by liuyang

2024-10-19 生产驾驶舱接口调整

parent 171fa8d1
...@@ -361,4 +361,30 @@ public class ServiceHGSC007 extends ServiceEPBase { ...@@ -361,4 +361,30 @@ public class ServiceHGSC007 extends ServiceEPBase {
} }
return inInfo; return inInfo;
} }
@OperationLogAnnotation(operModul = "生产任务", operType = "APP查询工厂", operDesc = "APP查询当前登录用户角色所属工厂")
public EiInfo getByRoleFactory(EiInfo inInfo) {
List<Org> factoryCodes = new ArrayList<>();
try {
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
Optional.ofNullable(roleCompanyCode).orElse(new ArrayList<>()).stream().forEach(code -> {
factoryCodes.addAll(HGXSTools.XsOrg.queryByParent(code, OrgTypeEnum.FACTORY.getCode()));
});
//List<Map<String,Object>> mapList = getOrg();
//factoryCodes.addAll(mapList);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "APP查询工厂失败");
}
List list = factoryCodes.stream()
.filter(o -> com.baosight.hggp.util.StringUtils.equals(o.getOrgType(), OrgTypeEnum.FACTORY.getCode()))
.map(item -> new Factory(item.getCompanyCode(), item.getCompanyName(), item.getFactoryCode(),
item.getFactoryName())).collect(Collectors.collectingAndThen(
Collectors.toMap(Factory::getFactoryCode, Function.identity(),
(oldValue, newValue) -> oldValue),
// 将Map转回List
m -> new ArrayList<>(m.values())
));
inInfo.set(EiConstant.resultBlock, list);
return inInfo;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment