This commit is contained in:
zhangqinlin
2022-07-15 14:12:08 +08:00
parent 08a03f5b06
commit 4edbcd2c52
2 changed files with 27 additions and 23 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ CREATE TABLE `pay_meeting_question` (
UNIQUE INDEX `id`(`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '会议征集问题' ROW_FORMAT = Dynamic;
CREATE TABLE `pay_meeting_standerd` (
CREATE TABLE `pay_meeting_standard` (
`id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'id',
`create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建日期',
@@ -143,8 +143,10 @@ public class PayMeetingServiceImpl extends ServiceImpl<PayMeetingMapper, PayMeet
//进行校验,赋值操作
PayMeeting payMeeting = getPayMeeting(payMeetingVO, hotelContactsList);
save(payMeeting);
List<PayMeetingStandard> collect = payMeetingVO.getQuestionList().stream().map(s -> s.setMeetingId(payMeeting.getId())).collect(Collectors.toList());
payMeetingStandardService.saveBatch(collect);
if(!org.springframework.util.CollectionUtils.isEmpty(payMeetingVO.getQuestionList())) {
List<PayMeetingStandard> collect = payMeetingVO.getQuestionList().stream().map(s -> s.setMeetingId(payMeeting.getId())).collect(Collectors.toList());
payMeetingStandardService.saveBatch(collect);
}
//如果酒店联系人列表不为空,就新增
if (!CollectionUtils.isEmpty(hotelContactsList)) {
String meetingId = payMeeting.getId();
@@ -418,6 +420,28 @@ public class PayMeetingServiceImpl extends ServiceImpl<PayMeetingMapper, PayMeet
TbMemberProject memberProject = getTbMemberProject();
payMeeting.setStandardsId(memberProject.getId());
}
if("1".equals(payMeetingVO.getTbMeetingType())||"2".equals(payMeetingVO.getTbMeetingType())) {
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(payMeetingVO.getQuestionList())) {
if ("0".equals(payMeetingVO.getIsAddQuestion())) {
throw new JeroBootException("征集问题状态冲突");
}
List<String> list = payMeetingVO.getQuestionList().stream().collect(Collectors.groupingBy(PayMeetingStandard::getStandardNumber, Collectors.counting())).entrySet().stream()
.filter(entry -> entry.getValue() > 1)
.map(Map.Entry::getKey)
.collect(Collectors.toList());
if (list.size() > 0) {
throw new JeroBootException("征集问题标准号重复!");
}
}
if (!ObjectUtils.isEmpty(payMeeting.getEndTimeAddQuestion())) {
if (payMeeting.getEndTimeAddQuestion().after(new Date())) {
payMeeting.setAddQuestionStatue(1);
} else {
payMeeting.setAddQuestionStatue(0);
}
}
}
break;
case MeetingCommon.INTERNATIONAL_MEETING:
ValidUtil.validate(payMeetingVO, InternationalMeeting.class);
@@ -490,26 +514,6 @@ public class PayMeetingServiceImpl extends ServiceImpl<PayMeetingMapper, PayMeet
// ValidUtil.validate(hotelContacts, StandardMeeting.class);
//}
BeanUtils.copyProperties(payMeetingVO, payMeeting);
if(org.apache.commons.collections.CollectionUtils.isNotEmpty(payMeetingVO.getQuestionList())){
if("0".equals(payMeetingVO.getIsAddQuestion())){
throw new JeroBootException("征集问题状态冲突");
}
List<String> list= payMeetingVO.getQuestionList().stream().collect(Collectors.groupingBy(PayMeetingStandard::getStandardNumber,Collectors.counting())).entrySet().stream()
.filter(entry->entry.getValue()>1)
.map(Map.Entry::getKey)
.collect(Collectors.toList());
if(list.size()>0){
throw new JeroBootException("征集问题标准号重复!");
}
}
if(!ObjectUtils.isEmpty(payMeeting.getEndTimeAddQuestion())){
if(payMeeting.getEndTimeAddQuestion().after(new Date())){
payMeeting.setAddQuestionStatue(1);
}else {
payMeeting.setAddQuestionStatue(0);
}
}
return payMeeting;
}