|
@@ -885,21 +885,41 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
String accidentDay = day + "T";
|
|
String accidentDay = day + "T";
|
|
|
// 异常情况
|
|
// 异常情况
|
|
|
String malfunction = StrUtil.blankToDefault(dailyReport.getMalfunction(), "无");
|
|
String malfunction = StrUtil.blankToDefault(dailyReport.getMalfunction(), "无");
|
|
|
- Long projectId = dailyReport.getProjectId();
|
|
|
|
|
DeptDO dept = deptService.getDept(deptId);
|
|
DeptDO dept = deptService.getDept(deptId);
|
|
|
- // 查询当前队伍的上级项目部
|
|
|
|
|
- DeptDO projectDept = deptService.getDept(dept.getParentId());
|
|
|
|
|
|
|
+
|
|
|
|
|
+ List<String> projectDeptNames = new ArrayList<>();
|
|
|
|
|
+ // 查询瑞鹰 163l 下具有以上角色的人员 查询集团(科瑞石油技术) 拥有以上角色的人员
|
|
|
|
|
+ Set<Long> userIds = new HashSet<>();
|
|
|
|
|
+ Set<Long> deptIds = new HashSet<>();
|
|
|
|
|
+ DataPermissionUtils.executeIgnore(() -> {
|
|
|
|
|
+ // 封装以上消息内容 发送到公司 角色 (生产异常通知)
|
|
|
|
|
+ // 查询瑞恒 157l 下具有以上角色的人员 查询集团(科瑞石油技术) 拥有以上角色的人员
|
|
|
|
|
+ deptIds.add(157l);
|
|
|
|
|
+ List<AdminUserDO> companyUsers = adminUserService.getUserListByDeptIds(deptIds);
|
|
|
|
|
+ if (CollUtil.isNotEmpty(companyUsers)) {
|
|
|
|
|
+ companyUsers.forEach(user -> {
|
|
|
|
|
+ userIds.add(user.getId());
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ deptIds.clear();
|
|
|
|
|
+ deptIds.add(156l);
|
|
|
|
|
+ List<AdminUserDO> groupUsers = adminUserService.getUserListByDeptIds(deptIds);
|
|
|
|
|
+ if (CollUtil.isNotEmpty(groupUsers)) {
|
|
|
|
|
+ groupUsers.forEach(user -> {
|
|
|
|
|
+ userIds.add(user.getId());
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ // 查询当前队伍的上级项目部 过滤掉数据权限
|
|
|
|
|
+ DeptDO projectDept = deptService.getDept(dept.getParentId());
|
|
|
|
|
+ if (ObjUtil.isNotEmpty(projectDept)) {
|
|
|
|
|
+ projectDeptNames.add(projectDept.getName());
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
// 队伍名称
|
|
// 队伍名称
|
|
|
String deptName = ObjUtil.isNotEmpty(dept) ? dept.getName() : StrUtil.EMPTY;
|
|
String deptName = ObjUtil.isNotEmpty(dept) ? dept.getName() : StrUtil.EMPTY;
|
|
|
// 项目部名称
|
|
// 项目部名称
|
|
|
- String projectDeptName = ObjUtil.isNotEmpty(projectDept) ? projectDept.getName() : StrUtil.EMPTY;
|
|
|
|
|
- String contract = "无";
|
|
|
|
|
- if (ObjUtil.isNotEmpty(projectId)) {
|
|
|
|
|
- IotProjectInfoDO project = iotProjectInfoMapper.selectById(projectId);
|
|
|
|
|
- if (ObjUtil.isNotEmpty(project)) {
|
|
|
|
|
- contract = project.getContractName();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ String projectDeptName = CollUtil.isNotEmpty(projectDeptNames) ? projectDeptNames.get(0) : StrUtil.EMPTY;
|
|
|
String wellName = "无";
|
|
String wellName = "无";
|
|
|
if (ObjUtil.isNotEmpty(taskId)) {
|
|
if (ObjUtil.isNotEmpty(taskId)) {
|
|
|
IotProjectTaskDO task = iotProjectTaskMapper.selectById(taskId);
|
|
IotProjectTaskDO task = iotProjectTaskMapper.selectById(taskId);
|
|
@@ -927,28 +947,6 @@ public class IotRhDailyReportServiceImpl implements IotRhDailyReportService {
|
|
|
malfunction, brief, nextPlan, accidentDay
|
|
malfunction, brief, nextPlan, accidentDay
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- Set<Long> userIds = new HashSet<>();
|
|
|
|
|
- Set<Long> deptIds = new HashSet<>();
|
|
|
|
|
- DataPermissionUtils.executeIgnore(() -> {
|
|
|
|
|
- // 封装以上消息内容 发送到公司 角色 (生产异常通知)
|
|
|
|
|
- // 查询瑞恒 157l 下具有以上角色的人员 查询集团(科瑞石油技术) 拥有以上角色的人员
|
|
|
|
|
- deptIds.add(157l);
|
|
|
|
|
- List<AdminUserDO> companyUsers = adminUserService.getUserListByDeptIds(deptIds);
|
|
|
|
|
- if (CollUtil.isNotEmpty(companyUsers)) {
|
|
|
|
|
- companyUsers.forEach(user -> {
|
|
|
|
|
- userIds.add(user.getId());
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- deptIds.clear();
|
|
|
|
|
- deptIds.add(156l);
|
|
|
|
|
- List<AdminUserDO> groupUsers = adminUserService.getUserListByDeptIds(deptIds);
|
|
|
|
|
- if (CollUtil.isNotEmpty(groupUsers)) {
|
|
|
|
|
- groupUsers.forEach(user -> {
|
|
|
|
|
- userIds.add(user.getId());
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
RoleDO role = roleService.getRoleByCode("生产异常通知");
|
|
RoleDO role = roleService.getRoleByCode("生产异常通知");
|
|
|
if (ObjUtil.isNotEmpty(role)) {
|
|
if (ObjUtil.isNotEmpty(role)) {
|
|
|
Set<Long> roleIds = new HashSet<>();
|
|
Set<Long> roleIds = new HashSet<>();
|