add:调整
This commit is contained in:
+12
-1
@@ -22,6 +22,7 @@ import com.jero.mail.commont.constant;
|
||||
import com.jero.meeting.entity.*;
|
||||
import com.jero.meeting.service.IPayMeetingQuestionService;
|
||||
import com.jero.meeting.service.IPayMeetingService;
|
||||
import com.jero.meeting.service.IPayMeetingSituationService;
|
||||
import com.jero.meeting.service.IPayMeetingStandardService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
@@ -55,6 +56,8 @@ public class PayMeetingQuestionController extends JeroController<PayMeetingQuest
|
||||
private IPayMeetingService payMeetingService;
|
||||
@Autowired
|
||||
private IPayMeetingStandardService payMeetingStandardService;
|
||||
@Resource
|
||||
private IPayMeetingSituationService payMeetingSituationService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
@@ -134,14 +137,22 @@ public class PayMeetingQuestionController extends JeroController<PayMeetingQuest
|
||||
@ApiOperation(value = "征集问题-添加", notes = "征集问题-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody PayMeetingQuestion payMeetingQuestion) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String sysUserId = sysUser.getId();
|
||||
Optional.ofNullable(payMeetingQuestion.getStandardId()).ifPresent(id -> {
|
||||
PayMeetingStandard payMeetingStandard = payMeetingStandardService.getById(id);
|
||||
PayMeeting payMeeting = payMeetingService.getById(payMeetingStandard.getMeetingId());
|
||||
if (ObjectUtils.isEmpty(payMeeting.getEndTimeAddQuestion()) || payMeeting.getEndTimeAddQuestion().before(new Date())) {
|
||||
throw new JeroBootException("征集问题截至时间以过,无法新增!");
|
||||
}
|
||||
int count = payMeetingSituationService.count(new LambdaQueryWrapper<PayMeetingSituation>().eq(PayMeetingSituation::getMeetingId, payMeetingStandard.getMeetingId()).eq(PayMeetingSituation::getCompanyContactId, sysUserId));
|
||||
if(count!=1){
|
||||
throw new JeroBootException("没有报名会议,添加失败!");
|
||||
}
|
||||
|
||||
});
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
|
||||
payMeetingQuestion.setCreater(sysUser.getRealname());
|
||||
payMeetingQuestion.setCreaterId(sysUser.getId());
|
||||
payMeetingQuestion.setEmail(PasswordUtil.decrypt(sysUser.getEmail()));
|
||||
|
||||
Reference in New Issue
Block a user