Commit cd364bb0 by 宋祥

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

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