This commit is contained in:
zhangqinlin
2022-07-19 11:31:49 +08:00
parent 63eb6d4c6d
commit 11f58aa0f2
5 changed files with 20 additions and 9 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ CREATE TABLE `pay_meeting_question` (
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新日期',
`standard_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标准号id',
`number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '章条编号',
`question_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '问题名称',
`question_name` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '问题名称',
`email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱',
`creater` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人名称',
`creater_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人id',
@@ -54,4 +54,4 @@ alter table tb_member_project_subitem
alter table tb_certificate_payment
add column member_payment_amount decimal(12, 2) null comment '会员缴费金额',
add column certificate_payment_amount decimal(12, 2) null comment '证书缴费金额',
add column other_payment_amount decimal(12, 2) null comment '其他缴费金额';
add column other_payment_amount decimal(12, 2) null comment '其他缴费金额';
@@ -205,7 +205,12 @@ public class PayMeetingQuestionController extends JeroController<PayMeetingQuest
// lambdaQueryWrapper.eq(PayMeetingQuestion::getCreaterId, payMeetingQuestion.getMeetingId());
// }
// }
queryWrapper.in(StringUtils.isNotBlank(searchStandard.getSelections()),"pmq.id", Arrays.asList(searchStandard.getSelections().split(",")));
if(StringUtils.isNotEmpty(searchStandard.getSelections())) {
queryWrapper.in("pmq.id", Arrays.asList(searchStandard.getSelections().split(",")));
}
if(StringUtils.isNotBlank(searchStandard.getStandardNumber())) {
queryWrapper.eq("pms.standard_number", searchStandard.getStandardNumber());
}
queryWrapper.eq(StringUtils.isNotBlank(searchStandard.getStandardNumber()),"pms.standard_number", searchStandard.getStandardNumber());
queryWrapper.eq("pm.id", searchStandard.getMeetingId());
queryWrapper.like(StringUtils.isNotBlank(searchStandard.getCreater()),"pmq.creater", searchStandard.getCreater());
@@ -31,4 +31,7 @@ public class AllStandardQuestion {
@ApiModelProperty(value = "邮箱")
private java.lang.String email;
@ApiModelProperty(value = "问题id")
private java.lang.String id;
}
@@ -3,7 +3,7 @@
<mapper namespace="com.jero.meeting.mapper.PayMeetingQuestionMapper">
<select id="pageList" resultType="com.jero.meeting.entity.AllStandardQuestion">
select pms.standard_number as standardNumber,pms.standard_name as standardName,pmq.number,pmq.creater,pmq.question_name as questionName,pmq.email,pmq.creater from pay_meeting pm
select pmq.id,pms.standard_number as standardNumber,pms.standard_name as standardName,pmq.number,pmq.creater,pmq.question_name as questionName,pmq.email,pmq.creater from pay_meeting pm
left join pay_meeting_standard pms on(pm.id=pms.meeting_id)
left join pay_meeting_question pmq on(pms.id=pmq.standard_id)
${ew.customSqlSegment}
@@ -265,13 +265,15 @@ public class PayMeetingServiceImpl extends ServiceImpl<PayMeetingMapper, PayMeet
List<PayMeetingStandard> questionList = payMeeting.getQuestionList();
if(!org.springframework.util.CollectionUtils.isEmpty(questionList)) {
List<PayMeetingStandard> list = payMeetingStandardService.list(new LambdaQueryWrapper<PayMeetingStandard>().eq(PayMeetingStandard::getMeetingId, payMeeting.getId()));
List<String> ids = list.stream().map(PayMeetingStandard::getId).collect(Collectors.toList());
if(!org.springframework.util.CollectionUtils.isEmpty(list)) {
ArrayList<PayMeetingStandard> listNew = new ArrayList<>();
ArrayList<PayMeetingStandard> listUpdate = new ArrayList<>();
for(PayMeetingStandard payMeetingStandard: questionList){
if(StringUtils.isNotBlank(payMeetingStandard.getId())){
//有id表示是更新或者不动
//有id不管是否修改全部更新,如果不在原有的集合中就删除
listUpdate.add(payMeetingStandard);
ids.remove(payMeetingStandard.getId());
}else {
//无id表示是新增
payMeetingStandard.setMeetingId(payMeeting.getId());
@@ -280,6 +282,7 @@ public class PayMeetingServiceImpl extends ServiceImpl<PayMeetingMapper, PayMeet
}
payMeetingStandardService.updateBatchById(listUpdate);
payMeetingStandardService.saveBatch(listNew);
payMeetingStandardService.removeByIds(ids);
}else {
List<PayMeetingStandard> collect = payMeeting.getQuestionList().stream().map(s -> s.setMeetingId(payMeeting.getId())).collect(Collectors.toList());
payMeetingStandardService.saveBatch(collect);
@@ -458,11 +461,11 @@ public class PayMeetingServiceImpl extends ServiceImpl<PayMeetingMapper, PayMeet
}
}
if (!ObjectUtils.isEmpty(payMeeting.getEndTimeAddQuestion())) {
if (payMeeting.getEndTimeAddQuestion().after(new Date())) {
payMeeting.setAddQuestionStatue(1);
if (!ObjectUtils.isEmpty(payMeetingVO.getEndTimeAddQuestion())) {
if (payMeetingVO.getEndTimeAddQuestion().after(new Date())) {
payMeetingVO.setAddQuestionStatue(1);
} else {
payMeeting.setAddQuestionStatue(0);
payMeetingVO.setAddQuestionStatue(0);
}
}
}