|
@@ -11,6 +11,7 @@ import com.rongwei.rwcommon.base.QueryPar;
|
|
|
import com.rongwei.rwcommon.base.R;
|
|
|
import com.rongwei.rwcommon.utils.SecurityUtil;
|
|
|
import com.rongwei.rwcommon.utils.StringUtils;
|
|
|
+import com.rongwei.safecommon.utils.CXCommonUtils;
|
|
|
import com.rongwei.training.domain.*;
|
|
|
import com.rongwei.trainingcommon.sys.service.*;
|
|
|
import com.rongwei.trainingcommon.sys.service.impl.TrainingSendNotifyServiceImpl;
|
|
@@ -22,6 +23,12 @@ import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyContent.TRAIN_NOTIFY_CONTENT;
|
|
|
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyTitle.COURSE_NOTIFY_TITLE;
|
|
|
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyTitle.TRAIN_NOTIFY_TITLE;
|
|
|
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyType.COURSE;
|
|
|
+import static com.rongwei.safecommon.utils.SaveConstans.NotifyType.TRAINING;
|
|
|
+
|
|
|
@RestController
|
|
|
@RequestMapping("plan")
|
|
|
@Slf4j
|
|
@@ -45,13 +52,6 @@ public class PlanController {
|
|
|
@Autowired
|
|
|
private TrainingSendNotifyServiceImpl sendNotifyService;
|
|
|
|
|
|
- public static final String TRAIN_NOTIFY_TITLE = "我的培训";
|
|
|
- public static final String TRAIN_NOTIFY_CONTENT = "%s,培训时间:%tF-%tF";
|
|
|
-
|
|
|
- public static final String CANCEL_TRAIN_TITLE = "培训取消提醒";
|
|
|
- public static final String CANCEL_TRAIN_CONTENT = "%s已取消";
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 列表
|
|
|
*/
|
|
@@ -100,6 +100,16 @@ public class PlanController {
|
|
|
if (planPaperList.size() > 1) {
|
|
|
return R.errorWithMsg("单一培训计划只可对应一张试卷");
|
|
|
}
|
|
|
+ if(!planCourseList.isEmpty()){
|
|
|
+ CXCommonUtils.sendNotify(COURSE_NOTIFY_TITLE, String.format(TRAIN_NOTIFY_CONTENT, row.getCoursename(),
|
|
|
+ row.getTrainingstarttime(), row.getTrainingendtimt()), "", new ArrayList<>(userIds) ,
|
|
|
+ row.getId(), COURSE);
|
|
|
+ }
|
|
|
+ if(!planPaperList.isEmpty()){
|
|
|
+ CXCommonUtils.sendNotify(TRAIN_NOTIFY_TITLE, String.format(TRAIN_NOTIFY_CONTENT, row.getCoursename(),
|
|
|
+ row.getTrainingstarttime(), row.getTrainingendtimt()), "", new ArrayList<>(userIds) ,
|
|
|
+ row.getId(), TRAINING);
|
|
|
+ }
|
|
|
// 获取参与过本次培训计划的员工
|
|
|
QueryWrapper<EmpExamDo> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("PLANID", row.getId());
|