Commit cd364bb0 by 宋祥

1.生产任务根据名称进行过滤

parent 70908f2b
......@@ -154,6 +154,27 @@ public class UserSessionUtils extends UserSession {
}
/**
* 获取登录用户的所有组名称
*
* @return
*/
public static List<String> getAllGroupName() {
List<Org> orgs = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isEmpty(orgs)) {
return new ArrayList<>();
}
List<String> allGroupNames = new ArrayList<>();
for (Org org : orgs) {
if (OrgTypeEnum.PROD_GROUP.getCode().equals(org.getOrgType())
|| OrgTypeEnum.CUT_GROUP.getCode().equals(org.getOrgType())
|| OrgTypeEnum.SYN_GROUP.getCode().equals(org.getOrgType())) {
allGroupNames.add(org.getOrgCname());
}
}
return allGroupNames.stream().distinct().collect(Collectors.toList());
}
/**
* 获取登录用户所有角色
*
* @return
......
......@@ -92,10 +92,10 @@ public class ServiceHGSC007 extends ServiceEPBase {
queryMap.put(HGSC007.FIELD_created_time, StringUtil.removeHorizontalLine(creatTime));
}
// 仅查询自己所在组的任务 added by songx at 20240820
List<String> allGroupCodes = UserSessionUtils.getAllGroupCode();
// 当用户无组的时候,集合中添加一个不存在的组用于查询,如果不加会查询出所有的数据
allGroupCodes.add("GROUP_CODE");
queryMap.put("groupCodes", allGroupCodes);
List<String> allGroupNames = UserSessionUtils.getAllGroupName();
// 当用户无组的时候,集合中添加空字符串用于查询,如果不加会查询出所有的数据
allGroupNames.add(" ");
queryMap.put("groupNames", allGroupNames);
inInfo = super.query(inInfo, HGSC007.QUERY, new HGSC007());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......
......@@ -40,10 +40,10 @@ public class ServiceHGSC008 extends ServiceEPBase {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
// 仅查询自己所在组的任务 added by songx at 20240820
List<String> allGroupCodes = UserSessionUtils.getAllGroupCode();
List<String> allGroupNames = UserSessionUtils.getAllGroupName();
// 当用户无组的时候,集合中添加一个不存在的组用于查询,如果不加会查询出所有的数据
allGroupCodes.add("GROUP_CODE");
queryMap.put("groupCodes", allGroupCodes);
allGroupNames.add(" ");
queryMap.put("groupNames", allGroupNames);
inInfo = super.query(inInfo, HGSC008.QUERY, new HGSC008());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......
......@@ -165,6 +165,9 @@
<isNotEmpty prepend=" AND " property="groupCodes">
A.GROUP_CODE IN <iterate close=")" open="(" conjunction="," property="groupCodes">#groupCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupNames">
A.GROUP_NAME IN <iterate close=")" open="(" conjunction="," property="groupNames">#groupNames[]#</iterate>
</isNotEmpty>
</sql>
<sql id="appCondition">
......
......@@ -140,6 +140,9 @@
<isNotEmpty prepend=" AND " property="groupCodes">
A.GROUP_CODE IN <iterate close=")" open="(" conjunction="," property="groupCodes">#groupCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupNames">
A.GROUP_NAME IN <iterate close=")" open="(" conjunction="," property="groupNames">#groupNames[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.sc.domain.HGSC008">
......
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