|
@@ -28,78 +28,83 @@ import java.util.List;
|
|
|
* @date 2018年11月23日
|
|
|
* @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
|
|
|
*/
|
|
|
-@Transactional
|
|
|
@RestController
|
|
|
@RequestMapping("${$rmp.cloud.examwork}" + "notice")
|
|
|
public class NoticeCloudServiceProvider extends ControllerSupport implements NoticeCloudService {
|
|
|
|
|
|
- private static final long serialVersionUID = 4359829563744893206L;
|
|
|
+ private static final long serialVersionUID = 4359829563744893206L;
|
|
|
|
|
|
- @Autowired
|
|
|
- private NoticeService noticeService;
|
|
|
+ @Autowired
|
|
|
+ private NoticeService noticeService;
|
|
|
|
|
|
- @ApiOperation(value = "获取待处理的通知进度数据")
|
|
|
- @PostMapping("getToBeDisposedNoticeRulePublishProgressList")
|
|
|
- @Override
|
|
|
- public GetNoticeRulePublishProgressListResp getToBeDisposedNoticeRulePublishProgressList() {
|
|
|
- GetNoticeRulePublishProgressListResp resp = new GetNoticeRulePublishProgressListResp();
|
|
|
- List<NoticeRulePublishProgressEntity> progressEntityList = noticeService.getToBeDisposedNoticeRulePublishProgressList();
|
|
|
- if (progressEntityList == null || progressEntityList.isEmpty()) {
|
|
|
- return resp;
|
|
|
- }
|
|
|
- List<NoticeRulePublishProgressBean> beanList = new ArrayList<>();
|
|
|
- for (NoticeRulePublishProgressEntity entity : progressEntityList) {
|
|
|
- NoticeRulePublishProgressBean bean = new NoticeRulePublishProgressBean();
|
|
|
- bean.setId(entity.getId());
|
|
|
- bean.setMaxCommonUserId(entity.getMaxCommonUserId());
|
|
|
- bean.setMaxStudentId(entity.getMaxStudentId());
|
|
|
- bean.setNoticeId(entity.getNoticeId());
|
|
|
- bean.setNoticeReceiverRuleType(entity.getNoticeReceiverRuleType());
|
|
|
- bean.setRootOrgId(entity.getRootOrgId());
|
|
|
- beanList.add(bean);
|
|
|
- }
|
|
|
- resp.setList(beanList);
|
|
|
- return resp;
|
|
|
- }
|
|
|
+ @ApiOperation(value = "获取待处理的通知进度数据")
|
|
|
+ @PostMapping("getToBeDisposedNoticeRulePublishProgressList")
|
|
|
+ @Override
|
|
|
+ public GetNoticeRulePublishProgressListResp getToBeDisposedNoticeRulePublishProgressList() {
|
|
|
+ GetNoticeRulePublishProgressListResp resp = new GetNoticeRulePublishProgressListResp();
|
|
|
+ List<NoticeRulePublishProgressEntity> progressEntityList = noticeService
|
|
|
+ .getToBeDisposedNoticeRulePublishProgressList();
|
|
|
+ if (progressEntityList == null || progressEntityList.isEmpty()) {
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
+ List<NoticeRulePublishProgressBean> beanList = new ArrayList<>();
|
|
|
+ for (NoticeRulePublishProgressEntity entity : progressEntityList) {
|
|
|
+ NoticeRulePublishProgressBean bean = new NoticeRulePublishProgressBean();
|
|
|
+ bean.setId(entity.getId());
|
|
|
+ bean.setMaxCommonUserId(entity.getMaxCommonUserId());
|
|
|
+ bean.setMaxStudentId(entity.getMaxStudentId());
|
|
|
+ bean.setNoticeId(entity.getNoticeId());
|
|
|
+ bean.setNoticeReceiverRuleType(entity.getNoticeReceiverRuleType());
|
|
|
+ bean.setRootOrgId(entity.getRootOrgId());
|
|
|
+ beanList.add(bean);
|
|
|
+ }
|
|
|
+ resp.setList(beanList);
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
|
|
|
- @ApiOperation(value = "处理待发布和发布中的数据")
|
|
|
- @PostMapping("disposePublishingUserNotice")
|
|
|
- @Override
|
|
|
- public DisposePublishingUserNoticeResp disposePublishingUserNotice(@RequestBody DisposePublishingUserNoticeReq
|
|
|
- req) {
|
|
|
- //处理发布中的通知数据,并返回下一个要处理的用户id
|
|
|
- Long nextUserId = noticeService.disposePublishingUserNotice(req.getStartUserId(),
|
|
|
- copytNoticeRulePublishProgressEntityFrom(req.getNoticeRulePublishProgress()));
|
|
|
+ @ApiOperation(value = "处理待发布和发布中的数据")
|
|
|
+ @PostMapping("disposePublishingUserNotice")
|
|
|
+ @Transactional
|
|
|
+ @Override
|
|
|
+ public DisposePublishingUserNoticeResp disposePublishingUserNotice(
|
|
|
+ @RequestBody DisposePublishingUserNoticeReq req) {
|
|
|
+ // 处理发布中的通知数据,并返回下一个要处理的用户id
|
|
|
+ Long nextUserId = noticeService.disposePublishingUserNotice(req.getStartUserId(),
|
|
|
+ copytNoticeRulePublishProgressEntityFrom(req.getNoticeRulePublishProgress()));
|
|
|
|
|
|
- DisposePublishingUserNoticeResp resp = new DisposePublishingUserNoticeResp();
|
|
|
- resp.setNextUserId(nextUserId);
|
|
|
- return resp;
|
|
|
- }
|
|
|
+ DisposePublishingUserNoticeResp resp = new DisposePublishingUserNoticeResp();
|
|
|
+ resp.setNextUserId(nextUserId);
|
|
|
+ return resp;
|
|
|
+ }
|
|
|
|
|
|
- //实体转换
|
|
|
- private NoticeRulePublishProgressEntity copytNoticeRulePublishProgressEntityFrom(NoticeRulePublishProgressBean processBean) {
|
|
|
- NoticeRulePublishProgressEntity processEntity = new NoticeRulePublishProgressEntity();
|
|
|
- processEntity.setId(processBean.getId());
|
|
|
- processEntity.setMaxCommonUserId(processBean.getMaxCommonUserId());
|
|
|
- processEntity.setMaxStudentId(processBean.getMaxStudentId());
|
|
|
- processEntity.setNoticeId(processBean.getNoticeId());
|
|
|
- processEntity.setNoticeReceiverRuleType(processBean.getNoticeReceiverRuleType());
|
|
|
- processEntity.setRootOrgId(processBean.getRootOrgId());
|
|
|
- return processEntity;
|
|
|
- }
|
|
|
+ // 实体转换
|
|
|
+ private NoticeRulePublishProgressEntity copytNoticeRulePublishProgressEntityFrom(
|
|
|
+ NoticeRulePublishProgressBean processBean) {
|
|
|
+ NoticeRulePublishProgressEntity processEntity = new NoticeRulePublishProgressEntity();
|
|
|
+ processEntity.setId(processBean.getId());
|
|
|
+ processEntity.setMaxCommonUserId(processBean.getMaxCommonUserId());
|
|
|
+ processEntity.setMaxStudentId(processBean.getMaxStudentId());
|
|
|
+ processEntity.setNoticeId(processBean.getNoticeId());
|
|
|
+ processEntity.setNoticeReceiverRuleType(processBean.getNoticeReceiverRuleType());
|
|
|
+ processEntity.setRootOrgId(processBean.getRootOrgId());
|
|
|
+ return processEntity;
|
|
|
+ }
|
|
|
|
|
|
- @ApiOperation(value = "清理过期的通知数据")
|
|
|
- @PostMapping("disposeOverdueNotice")
|
|
|
- @Override
|
|
|
- public void disposeOverdueNotice() {
|
|
|
- noticeService.disposeOverdueNotice();
|
|
|
- }
|
|
|
+ @ApiOperation(value = "清理过期的通知数据")
|
|
|
+ @PostMapping("disposeOverdueNotice")
|
|
|
+ @Transactional
|
|
|
+ @Override
|
|
|
+ public void disposeOverdueNotice() {
|
|
|
+ noticeService.disposeOverdueNotice();
|
|
|
+ }
|
|
|
|
|
|
- @ApiOperation(value = "更新通知状态")
|
|
|
- @PostMapping("updateNoticeStatus")
|
|
|
- @Override
|
|
|
- public void updateNoticeStatus(@RequestBody UpdateNoticeStatusReq updateNoticeStatusReq) {
|
|
|
- noticeService.updateNoticeStatus(updateNoticeStatusReq.getNoticeId(), updateNoticeStatusReq.getNoticeStatus());
|
|
|
- }
|
|
|
+ @ApiOperation(value = "更新通知状态")
|
|
|
+ @PostMapping("updateNoticeStatus")
|
|
|
+ @Transactional
|
|
|
+ @Override
|
|
|
+ public void updateNoticeStatus(@RequestBody UpdateNoticeStatusReq updateNoticeStatusReq) {
|
|
|
+ noticeService.updateNoticeStatus(updateNoticeStatusReq.getNoticeId(),
|
|
|
+ updateNoticeStatusReq.getNoticeStatus());
|
|
|
+ }
|
|
|
|
|
|
}
|