白色不要做ai和车辆的数据权限
This commit is contained in:
parent
bb61add63c
commit
640fe5c635
@ -13,6 +13,7 @@ import com.zhgd.xmgl.modules.worker.service.impl.UserEnterpriseServiceImpl;
|
||||
import com.zhgd.xmgl.modules.xz.service.impl.XzSupplierQualificationApplyServiceImpl;
|
||||
import com.zhgd.xmgl.security.entity.UserInfo;
|
||||
import com.zhgd.xmgl.security.util.SecurityUtils;
|
||||
import com.zhgd.xmgl.util.EnvironmentUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.jsqlparser.JSQLParserException;
|
||||
import net.sf.jsqlparser.expression.Alias;
|
||||
@ -44,6 +45,9 @@ import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
public class DataScopeHandler implements DataPermissionHandler {
|
||||
@Lazy
|
||||
@Autowired
|
||||
EnvironmentUtil environmentUtil;
|
||||
@Lazy
|
||||
@Autowired
|
||||
IAiAnalyseHardWareRecordService aiAnalyseHardWareRecordService;
|
||||
@ -85,15 +89,17 @@ public class DataScopeHandler implements DataPermissionHandler {
|
||||
tables.put("xz_task_progress_content", "enterprise_id");
|
||||
tables.put("xz_task_progress_alarm", "enterprise_id");
|
||||
tables.put("xz_task_progress", "enterprise_id");
|
||||
tables.put("enterprise_info", "id");
|
||||
tables.put("quality_inspection_record", "enterprise_id");
|
||||
tables.put("worker_info_audit_record", "enterprise_id");
|
||||
tables.put("car_info", "enterprise_id");
|
||||
tables.put("xz_material", "enterprise_id");
|
||||
tables.put("inspect_task_record", "enterprise_id");
|
||||
tables.put("xz_security_inspect_task_record", "enterprise_id");
|
||||
tables.put("xz_security_quality_inspection_record", "enterprise_id");
|
||||
tables.put("team_info", "enterprise_id");
|
||||
if (!environmentUtil.isBaise()) {
|
||||
tables.put("car_info", "enterprise_id");
|
||||
tables.put("enterprise_info", "id");
|
||||
}
|
||||
return tables;
|
||||
}
|
||||
|
||||
@ -105,7 +111,9 @@ public class DataScopeHandler implements DataPermissionHandler {
|
||||
|
||||
private HashMap<String, String> getFieldAiTables() {
|
||||
HashMap<String, String> tables = new HashMap<>();
|
||||
tables.put("ai_analyse_hard_ware_alarm_record", "hardware_id");
|
||||
if (!environmentUtil.isBaise()) {
|
||||
tables.put("ai_analyse_hard_ware_alarm_record", "hardware_id");
|
||||
}
|
||||
return tables;
|
||||
}
|
||||
|
||||
|
||||
@ -17,15 +17,15 @@ public class EnvironmentUtil {
|
||||
*/
|
||||
private static String activeEnvironment;
|
||||
|
||||
public static String getActiveEnvironment() {
|
||||
return activeEnvironment;
|
||||
}
|
||||
|
||||
@Value("${active.environment.name}")
|
||||
public void setActiveEnvironment(String activeEnvironment) {
|
||||
EnvironmentUtil.activeEnvironment = activeEnvironment;
|
||||
}
|
||||
|
||||
public static String getActiveEnvironment() {
|
||||
return activeEnvironment;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否本地开发环境
|
||||
*
|
||||
@ -125,4 +125,13 @@ public class EnvironmentUtil {
|
||||
return Stream.of("gxlt-prod", "gxlt-dev").anyMatch(s -> s.equals(activeEnvironment));
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否baise环境
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isBaise() {
|
||||
return Stream.of("baise").anyMatch(s -> s.equals(activeEnvironment));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user