|
@@ -1,15 +1,22 @@
|
|
|
package com.rongwei.sfcommon.sys.service.impl;
|
|
|
|
|
|
+import com.rongwei.rwcommon.base.R;
|
|
|
import com.rongwei.safecommon.utils.CXCommonUtils;
|
|
|
+import com.rongwei.sfcommon.sys.dao.DangerousDao;
|
|
|
import com.rongwei.sfcommon.sys.service.SafeCheckSendNotifyService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashSet;
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import static com.rongwei.safecommon.utils.SaveConstans.DEFAULT_SEPARATOR;
|
|
|
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyContent.DANGEROUS_CONTENT;
|
|
|
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyTitle.DANGEROUS_TITLE;
|
|
|
import static com.rongwei.safecommon.utils.SaveConstans.NotifyTitle.INSPECTION_TASKS_TITLE;
|
|
|
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyType.DANGEROUS;
|
|
|
import static com.rongwei.safecommon.utils.SaveConstans.NotifyType.INSPECTIONTASKS;
|
|
|
|
|
|
/**
|
|
@@ -20,6 +27,9 @@ import static com.rongwei.safecommon.utils.SaveConstans.NotifyType.INSPECTIONTAS
|
|
|
*/
|
|
|
@Service
|
|
|
public class SafeCheckSendNotifyServiceImpl implements SafeCheckSendNotifyService {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private DangerousDao dangerousDao;
|
|
|
@Override
|
|
|
public void inspectionTasks() {
|
|
|
|
|
@@ -35,4 +45,43 @@ public class SafeCheckSendNotifyServiceImpl implements SafeCheckSendNotifyServic
|
|
|
new ArrayList<>(v), k.split(DEFAULT_SEPARATOR)[1], INSPECTIONTASKS);
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 危险作业每日处罚提醒
|
|
|
+ */
|
|
|
+ public void dangerousDailyNotify() {
|
|
|
+ List<Map<String, Object>> dangerous = dangerousDao.getDangerousDailyNotify();
|
|
|
+ if (dangerous != null) {
|
|
|
+ for (Map<String, Object> item : dangerous) {
|
|
|
+ String punishPersonnelId = (String) item.get("PUNISHPERSONNELID");
|
|
|
+ List<String> personnelIdList = new ArrayList<>();
|
|
|
+ personnelIdList.add(punishPersonnelId);
|
|
|
+ CXCommonUtils.sendNotify(DANGEROUS_TITLE, String.format(DANGEROUS_CONTENT,
|
|
|
+ item.get("JOBTYPE"), item.get("ASSIGNMENTTIMESTART"), item.get("ASSIGNMENTTIMEEND"),
|
|
|
+ item.get("PENALTYAMOUNT"), item.get("MODIFYDATE")),
|
|
|
+ "", personnelIdList, null, DANGEROUS);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 危险作业处罚提醒
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public R sendDangerousTimelyNotify(String id) {
|
|
|
+ Map<String, Object> dangerous = dangerousDao.getDangerousNotify(id);
|
|
|
+ if (dangerous != null) {
|
|
|
+ String punishPersonnelId = (String) dangerous.get("PUNISHPERSONNELID");
|
|
|
+ List<String> personnelIdList = new ArrayList<>();
|
|
|
+ personnelIdList.add(punishPersonnelId);
|
|
|
+ CXCommonUtils.sendNotify(DANGEROUS_TITLE, String.format(DANGEROUS_CONTENT,
|
|
|
+ dangerous.get("JOBTYPE"), dangerous.get("ASSIGNMENTTIMESTART"), dangerous.get("ASSIGNMENTTIMEEND"),
|
|
|
+ dangerous.get("PENALTYAMOUNT"), dangerous.get("MODIFYDATE")),
|
|
|
+ "", personnelIdList, null, DANGEROUS);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
}
|