commit
This commit is contained in:
@@ -3,6 +3,7 @@ package io.v.nutz.meeting.controller.mobile;
|
|||||||
import cn.wizzer.framework.base.Result;
|
import cn.wizzer.framework.base.Result;
|
||||||
import io.v.nutz.annontation.ViReturn;
|
import io.v.nutz.annontation.ViReturn;
|
||||||
import io.v.nutz.meeting.models.MeetingInfo;
|
import io.v.nutz.meeting.models.MeetingInfo;
|
||||||
|
import io.v.nutz.meeting.models.MeetingTimePeriod;
|
||||||
import io.v.nutz.meeting.models.MeetingTimePeriodUser;
|
import io.v.nutz.meeting.models.MeetingTimePeriodUser;
|
||||||
import io.v.nutz.meeting.models.MeetingUser;
|
import io.v.nutz.meeting.models.MeetingUser;
|
||||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||||
@@ -14,6 +15,7 @@ import org.nutz.dao.Dao;
|
|||||||
import org.nutz.ioc.loader.annotation.Inject;
|
import org.nutz.ioc.loader.annotation.Inject;
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
import org.nutz.lang.Lang;
|
import org.nutz.lang.Lang;
|
||||||
|
import org.nutz.lang.util.NutMap;
|
||||||
import org.nutz.mvc.annotation.At;
|
import org.nutz.mvc.annotation.At;
|
||||||
import org.nutz.mvc.annotation.GET;
|
import org.nutz.mvc.annotation.GET;
|
||||||
import org.nutz.mvc.annotation.Ok;
|
import org.nutz.mvc.annotation.Ok;
|
||||||
@@ -23,6 +25,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
@IocBean
|
@IocBean
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -48,8 +51,9 @@ public class MMeetingNotifyController {
|
|||||||
dao.fetchLinks(meetingInfo, "meetingTimePeriods", Cnd.NEW().asc("startTime"));
|
dao.fetchLinks(meetingInfo, "meetingTimePeriods", Cnd.NEW().asc("startTime"));
|
||||||
|
|
||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
|
cnd.and("meetingId", "=", meetingId);
|
||||||
cnd.and("userId", "=", ShiroUtil.getPrincipalProperty("id"));
|
cnd.and("userId", "=", ShiroUtil.getPrincipalProperty("id"));
|
||||||
MeetingTimePeriodUser mtPu = dao.fetch(MeetingTimePeriodUser.class, cnd);
|
List<MeetingTimePeriodUser> mtPu = dao.query(MeetingTimePeriodUser.class, cnd);
|
||||||
|
|
||||||
if (Lang.isEmpty(meetingInfo)) {
|
if (Lang.isEmpty(meetingInfo)) {
|
||||||
return Result.error("参数错误");
|
return Result.error("参数错误");
|
||||||
@@ -58,6 +62,14 @@ public class MMeetingNotifyController {
|
|||||||
return Result.error("你不是当前会议人员");
|
return Result.error("你不是当前会议人员");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<MeetingTimePeriod> meetingTimePeriods = meetingInfo.getMeetingTimePeriods();
|
||||||
|
meetingTimePeriods.forEach(item -> {
|
||||||
|
MeetingTimePeriodUser periodUser = mtPu.stream().filter(o -> Objects.equals(o.getMeetingTimePeriodId(), item.getId())).findFirst().orElse(null);
|
||||||
|
if(periodUser != null) {
|
||||||
|
item.setIsJoinByMsg(periodUser.getIsJoinByMsg());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return meetingInfo;
|
return meetingInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,28 +77,18 @@ public class MMeetingNotifyController {
|
|||||||
@Ok("json:full")
|
@Ok("json:full")
|
||||||
@ViReturn
|
@ViReturn
|
||||||
@RequiresAuthentication
|
@RequiresAuthentication
|
||||||
public Object joinDo(@Param("isJoin") Boolean isJoin,
|
public Object joinDo(@Param("notJoinReason") String notJoinReason,
|
||||||
@Param("notJoinReason") String notJoinReason,
|
@Param("::data") List<NutMap> joinData,
|
||||||
@Param("ids") String[] ids,
|
|
||||||
@Param("meetingId") String meetingId) {
|
@Param("meetingId") String meetingId) {
|
||||||
List<MeetingTimePeriodUser> periodUsers = dao.query(MeetingTimePeriodUser.class, Cnd.where("meetingId", "=", meetingId)
|
List<MeetingTimePeriodUser> periodUsers = dao.query(MeetingTimePeriodUser.class, Cnd.where("meetingId", "=", meetingId)
|
||||||
.and("userId", "=", ShiroUtil.getPlatformUid()));
|
.and("userId", "=", ShiroUtil.getPlatformUid()));
|
||||||
if (isJoin) {
|
joinData.forEach(item -> {
|
||||||
//参加
|
MeetingTimePeriodUser periodUser = periodUsers.stream().filter(o -> Objects.equals(o.getMeetingTimePeriodId(), item.getString("id"))).findFirst().orElse(null);
|
||||||
periodUsers.forEach(item -> {
|
if(periodUser != null) {
|
||||||
item.setIsJoinByMsg(true);
|
periodUser.setIsJoinByMsg(item.getBoolean("isJoinByMsg"));
|
||||||
});
|
periodUser.setNotJoinReason(!item.getBoolean("isJoinByMsg") ? notJoinReason : null);
|
||||||
} else {
|
}
|
||||||
List<String> strings = Arrays.asList(ids);
|
});
|
||||||
periodUsers.forEach(item -> {
|
|
||||||
if (strings.contains(item.getMeetingTimePeriodId())) {
|
|
||||||
item.setIsJoinByMsg(false);
|
|
||||||
item.setNotJoinReason(notJoinReason);
|
|
||||||
} else {
|
|
||||||
item.setIsJoinByMsg(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
dao.update(periodUsers);
|
dao.update(periodUsers);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,4 +45,5 @@ public class MeetingTimePeriod {
|
|||||||
@Many(field = "meetingTimePeriodId")
|
@Many(field = "meetingTimePeriodId")
|
||||||
private List<MeetingTimePeriodUser> meetingTimePeriodUserList;
|
private List<MeetingTimePeriodUser> meetingTimePeriodUserList;
|
||||||
|
|
||||||
|
private Boolean isJoinByMsg;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -237,18 +237,18 @@ layout("/mobile/platform.html"){
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #input>
|
<template #input>
|
||||||
<van-checkbox v-model="item.canJoin" shape="square"></van-checkbox>
|
<van-radio-group v-model="item.isJoinByMsg" direction="horizontal">
|
||||||
|
<van-radio :name="true">参加</van-radio>
|
||||||
|
<van-radio :name="false">不参加</van-radio>
|
||||||
|
</van-radio-group>
|
||||||
</template>
|
</template>
|
||||||
</van-field>
|
</van-field>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<van-button @click="canJoin(false)" block color="#1867b0" round type="primary">
|
<van-button @click="submit" block color="#1867b0" round type="primary">
|
||||||
不参加
|
提交
|
||||||
</van-button>
|
|
||||||
<van-button @click="canJoin(true)" block color="#1867b0" round type="primary">
|
|
||||||
参加
|
|
||||||
</van-button>
|
</van-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -303,7 +303,6 @@ layout("/mobile/platform.html"){
|
|||||||
mtpId: '',
|
mtpId: '',
|
||||||
isIncorrect: true,
|
isIncorrect: true,
|
||||||
typeName: '',
|
typeName: '',
|
||||||
isJoin: true,
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -323,14 +322,15 @@ layout("/mobile/platform.html"){
|
|||||||
}
|
}
|
||||||
$('#app').css('opacity', '1')
|
$('#app').css('opacity', '1')
|
||||||
},
|
},
|
||||||
async canJoin(type) {
|
async submit() {
|
||||||
this.isJoin = type
|
for (let item of this.meetingInfo.meetingTimePeriods) {
|
||||||
if(!type) {
|
if(item.isJoinByMsg === null || item.isJoinByMsg === undefined) {
|
||||||
const joinArray = this.meetingInfo.meetingTimePeriods.filter(o => o.canJoin === true)
|
this.$modal.msg('请选择是否参加')
|
||||||
if(joinArray.length === 0) {
|
|
||||||
this.$modal.alert('请选择不参加的时间段')
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
const join = this.meetingInfo.meetingTimePeriods.filter(o => o.isJoinByMsg === false)
|
||||||
|
if(join.length > 0) {
|
||||||
this.notJoinShow = true
|
this.notJoinShow = true
|
||||||
} else {
|
} else {
|
||||||
const confirm = await vant.Dialog.confirm({
|
const confirm = await vant.Dialog.confirm({
|
||||||
@@ -355,21 +355,21 @@ layout("/mobile/platform.html"){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async joinDo() {
|
async joinDo() {
|
||||||
const ids = this.meetingInfo.meetingTimePeriods.filter(o => o.canJoin === true).map(o => o.id)
|
|
||||||
const resp = await $.post('/mobile/meeting/notify/joinDo', {
|
const resp = await $.post('/mobile/meeting/notify/joinDo', {
|
||||||
isJoin: this.isJoin,
|
|
||||||
notJoinReason: this.notJoinReason,
|
notJoinReason: this.notJoinReason,
|
||||||
ids: JSON.stringify(ids),
|
data: JSON.stringify(this.meetingInfo.meetingTimePeriods),
|
||||||
meetingId: this.meetingInfo.id
|
meetingId: this.meetingInfo.id
|
||||||
})
|
})
|
||||||
this.$modal.msg(resp.msg)
|
this.isIncorrect = resp.code === 0
|
||||||
|
this.isCanAudit = false
|
||||||
|
this.incorrectMag = resp.msg
|
||||||
this.notJoinShow = false
|
this.notJoinShow = false
|
||||||
},
|
},
|
||||||
async readDo() {
|
async readDo() {
|
||||||
await $.post('/mobile/meeting/notify/readDo', {meetingId: this.meetingInfo.id})
|
await $.post('/mobile/meeting/notify/readDo', {meetingId: this.meetingInfo.id})
|
||||||
},
|
},
|
||||||
back() {
|
back() {
|
||||||
const str = this.incorrectMag === '你不是当前会议人员' ? 'http://' + window.location.host : '/mobile/meeting/mine/go_sign?meetingId=' + this.meetingId + '&mtpId=' + this.mtpId
|
const str = this.incorrectMag === '你不是当前会议人员' ? 'http://' + window.location.host : '/mobile/meeting/notify?meetingId=' + this.meetingId + '&mtpId=' + this.mtpId
|
||||||
location.href = str
|
location.href = str
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ layout("/layouts/platform.html"){
|
|||||||
submitFormData.endTime = this.formData.meetingTime && this.formData.meetingTime.length > 1 ? this.formData.meetingTime[1] : ''
|
submitFormData.endTime = this.formData.meetingTime && this.formData.meetingTime.length > 1 ? this.formData.meetingTime[1] : ''
|
||||||
|
|
||||||
if (this.msgData.sendTypes.length > 0) {
|
if (this.msgData.sendTypes.length > 0) {
|
||||||
const confirm = await this.$confirm('下一步需要到消息管理系统中择机发送短信通知', '提示', {
|
const confirm = await this.$confirm('下一步需要到会议管理菜单中择机发送短信通知', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
showCancelButton: false,
|
showCancelButton: false,
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ layout("/layouts/platform.html"){
|
|||||||
sortable show-overflow-tooltip>
|
sortable show-overflow-tooltip>
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
<span v-if="scope.row.isJoinByMsg === false || scope.row.isJoinByMsg === 0" style="color: red">不参加</span>
|
<span v-if="scope.row.isJoinByMsg === false || scope.row.isJoinByMsg === 0" style="color: red">不参加</span>
|
||||||
<span v-else-if="!scope.row.isJoinByMsg">未选择</span>
|
<span v-else-if="scope.row.isJoinByMsg === null || scope.row.isJoinByMsg === undefined">未选择</span>
|
||||||
<span v-else>参加</span>
|
<span v-else>参加</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|||||||
Reference in New Issue
Block a user