|
|
@@ -221,12 +221,19 @@ public class GxtOrderMineServiceImpl implements IGxtOrderMineService {
|
|
|
repairFilterSql.append("t.work_order_status = 'to_approve'");
|
|
|
hasConditions = true;
|
|
|
}
|
|
|
-
|
|
|
- // completed状态且有复运权限
|
|
|
+
|
|
|
+ /*// completed状态且有复运权限
|
|
|
if (hasPermi(userId, "gxt:repairOrder:restart")) {
|
|
|
if (hasConditions) repairFilterSql.append(" OR ");
|
|
|
repairFilterSql.append("t.work_order_status = 'completed' and t.restart_time is null ");
|
|
|
hasConditions = true;
|
|
|
+ }*/
|
|
|
+
|
|
|
+ // 有复运权限,且未复运过,且不是to_issue、auto_suspend或accept_return状态
|
|
|
+ if (hasPermi(userId, "gxt:repairOrder:restart")) {
|
|
|
+ if (hasConditions) repairFilterSql.append(" OR ");
|
|
|
+ repairFilterSql.append("t.restart_time is null and t.work_order_status != 'to_issue' and t.work_order_status != 'auto_suspend' and t.work_order_status != 'accept_return'");
|
|
|
+ hasConditions = true;
|
|
|
}
|
|
|
|
|
|
// to_issue、accept_return状态且有编辑权限,且当前用户是创建人本部门的人
|
|
|
@@ -275,12 +282,19 @@ public class GxtOrderMineServiceImpl implements IGxtOrderMineService {
|
|
|
workFilterSql.append("t.work_order_status = 'to_approve'");
|
|
|
hasConditions = true;
|
|
|
}
|
|
|
-
|
|
|
- // completed状态且有复运权限
|
|
|
+
|
|
|
+ /*// completed状态且有复运权限
|
|
|
if (hasPermi(userId, "gxt:maintenance:order:restart")) {
|
|
|
if (hasConditions) workFilterSql.append(" OR ");
|
|
|
workFilterSql.append("t.work_order_status = 'completed' and t.restart_time is null");
|
|
|
hasConditions = true;
|
|
|
+ }*/
|
|
|
+
|
|
|
+ // 有复运权限,且未复运过,且不是to_issue或auto_suspend状态
|
|
|
+ if (hasPermi(userId, "gxt:maintenance:order:restart")) {
|
|
|
+ if (hasConditions) workFilterSql.append(" OR ");
|
|
|
+ workFilterSql.append("t.restart_time is null and t.work_order_status != 'to_issue' and t.work_order_status != 'auto_suspend'");
|
|
|
+ hasConditions = true;
|
|
|
}
|
|
|
|
|
|
// to_issue状态且有编辑权限
|
|
|
@@ -289,6 +303,14 @@ public class GxtOrderMineServiceImpl implements IGxtOrderMineService {
|
|
|
workFilterSql.append("t.work_order_status = 'to_issue' ");
|
|
|
hasConditions = true;
|
|
|
}
|
|
|
+
|
|
|
+ // 停机权限,且未停机过,且不在某些特定状态
|
|
|
+ if (hasPermi(userId, "gxt:maintenance:order:shutdown")) {
|
|
|
+ if (hasConditions) workFilterSql.append(" OR ");
|
|
|
+ workFilterSql.append("t.pause_time is null and t.work_order_status != 'to_issue' and t.work_order_status != 'auto_suspend' and t.work_order_status != 'completed' and t.work_order_status != 'archived' and t.work_order_status != 'invalid'");
|
|
|
+ hasConditions = true;
|
|
|
+ }
|
|
|
+
|
|
|
// 如果没有任何权限,则不返回任何数据
|
|
|
if (!hasConditions) {
|
|
|
workFilterSql = new StringBuilder();
|