|
@@ -19,7 +19,6 @@ import com.rongwei.rwcommon.base.R;
|
|
import com.rongwei.rwcommon.utils.SecurityUtil;
|
|
import com.rongwei.rwcommon.utils.SecurityUtil;
|
|
import com.rongwei.rwcommon.utils.StringUtils;
|
|
import com.rongwei.rwcommon.utils.StringUtils;
|
|
import com.rongwei.rwcommon.vo.MailDo;
|
|
import com.rongwei.rwcommon.vo.MailDo;
|
|
-import com.rongwei.rwcommonentity.commonservers.vo.SysSerialVo;
|
|
|
|
import com.rongwei.sfcommon.sys.dao.SaveCheckCommonDao;
|
|
import com.rongwei.sfcommon.sys.dao.SaveCheckCommonDao;
|
|
import com.rongwei.sfcommon.sys.service.SaveCheckItemService;
|
|
import com.rongwei.sfcommon.sys.service.SaveCheckItemService;
|
|
import com.rongwei.sfcommon.sys.service.ThemeCheckItemService;
|
|
import com.rongwei.sfcommon.sys.service.ThemeCheckItemService;
|
|
@@ -59,6 +58,9 @@ public class SaveCheckItemServiceImpl implements SaveCheckItemService {
|
|
private SysSerialNumberService sysSerialNumberService;
|
|
private SysSerialNumberService sysSerialNumberService;
|
|
@Autowired
|
|
@Autowired
|
|
private HiddenDangerTrackServiceImpl hiddenDangerTrackService;
|
|
private HiddenDangerTrackServiceImpl hiddenDangerTrackService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private SafeCheckSendNotifyServiceImpl sendNotifyService;
|
|
|
|
+
|
|
private static final String SPECIALCHECK_MAIL_SUBJECT = "周五专项检查结果";
|
|
private static final String SPECIALCHECK_MAIL_SUBJECT = "周五专项检查结果";
|
|
private static final String TYPE_DAYCHECK_MAIL_SUBJECT = "主管经理检查结果";
|
|
private static final String TYPE_DAYCHECK_MAIL_SUBJECT = "主管经理检查结果";
|
|
private static final String DISCOVERY_ITEM_MAIL_CONTENT = "检查主题:%s \n组长:%s\n组员:%s\n检查工段:%s\n" +
|
|
private static final String DISCOVERY_ITEM_MAIL_CONTENT = "检查主题:%s \n组长:%s\n组员:%s\n检查工段:%s\n" +
|
|
@@ -100,13 +102,13 @@ public class SaveCheckItemServiceImpl implements SaveCheckItemService {
|
|
log.error("无法通过ID:{}获取到检查项信息", id);
|
|
log.error("无法通过ID:{}获取到检查项信息", id);
|
|
}
|
|
}
|
|
// 任务生成
|
|
// 任务生成
|
|
- generateHiddenDangerTrack(checkItemDo, themeCheck, aspCheckDiscoveryItemDos);
|
|
|
|
|
|
+ List<HiddenDangerTrackDo> sendNotifyData = generateHiddenDangerTrack(checkItemDo, themeCheck, aspCheckDiscoveryItemDos);
|
|
// 更新任务状态
|
|
// 更新任务状态
|
|
List<String> discoverIds = aspCheckDiscoveryItemDos.stream().map(AspCheckDiscoveryItemDo::getId).collect(Collectors.toList());
|
|
List<String> discoverIds = aspCheckDiscoveryItemDos.stream().map(AspCheckDiscoveryItemDo::getId).collect(Collectors.toList());
|
|
aspCheckDiscoveryItemService.update(new LambdaUpdateWrapper<AspCheckDiscoveryItemDo>()
|
|
aspCheckDiscoveryItemService.update(new LambdaUpdateWrapper<AspCheckDiscoveryItemDo>()
|
|
.set(AspCheckDiscoveryItemDo::getCreatetask,1)
|
|
.set(AspCheckDiscoveryItemDo::getCreatetask,1)
|
|
.eq(AspCheckDiscoveryItemDo::getId,discoverIds));
|
|
.eq(AspCheckDiscoveryItemDo::getId,discoverIds));
|
|
-
|
|
|
|
|
|
+ sendNotifyService.sendDangerTasksNotify(sendNotifyData);
|
|
// ThreadPoolExecutor threadPool = ExecutorBuilder.create()
|
|
// ThreadPoolExecutor threadPool = ExecutorBuilder.create()
|
|
// .setCorePoolSize(1)
|
|
// .setCorePoolSize(1)
|
|
// .setMaxPoolSize(3)
|
|
// .setMaxPoolSize(3)
|
|
@@ -124,9 +126,11 @@ public class SaveCheckItemServiceImpl implements SaveCheckItemService {
|
|
/**
|
|
/**
|
|
* 生成隐患跟踪任务
|
|
* 生成隐患跟踪任务
|
|
* 每一个检查项生成一个隐患跟踪任务
|
|
* 每一个检查项生成一个隐患跟踪任务
|
|
|
|
+ *
|
|
|
|
+ * @return
|
|
*/
|
|
*/
|
|
- public void generateHiddenDangerTrack(ThemeCheckItemDo checkItemDo, ThemeCheckDo themeCheck,
|
|
|
|
- List<AspCheckDiscoveryItemDo> aspCheckDiscoveryItemDos) {
|
|
|
|
|
|
+ public List<HiddenDangerTrackDo> generateHiddenDangerTrack(ThemeCheckItemDo checkItemDo, ThemeCheckDo themeCheck,
|
|
|
|
+ List<AspCheckDiscoveryItemDo> aspCheckDiscoveryItemDos) {
|
|
if (MlConstants.CHECK_RESULT_TRACK.equals(checkItemDo.getCheckresult()) || aspCheckDiscoveryItemDos.isEmpty()) {
|
|
if (MlConstants.CHECK_RESULT_TRACK.equals(checkItemDo.getCheckresult()) || aspCheckDiscoveryItemDos.isEmpty()) {
|
|
log.debug("检查结果为正常或无发现项,无需生成检查任务");
|
|
log.debug("检查结果为正常或无发现项,无需生成检查任务");
|
|
}
|
|
}
|
|
@@ -191,6 +195,7 @@ public class SaveCheckItemServiceImpl implements SaveCheckItemService {
|
|
hiddenDangerTrackService.saveBatch(addList);
|
|
hiddenDangerTrackService.saveBatch(addList);
|
|
checkItemDo.setSaved("1");
|
|
checkItemDo.setSaved("1");
|
|
themeCheckItemService.saveOrUpdate(checkItemDo);
|
|
themeCheckItemService.saveOrUpdate(checkItemDo);
|
|
|
|
+ return addList;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|