update
This commit is contained in:
parent
f710119e3d
commit
0d3a4f17b0
|
@ -130,9 +130,9 @@ public class ContactDbService extends BaseService<ContactDbMapper, ContactDb> {
|
|||
contactDb.setCreatedId(loginUser.getId());
|
||||
saveOrUpdate(contactDb);
|
||||
saveUser(contactDb.getId(), contactDbSubjectRequest.getSubjectUserIds(), loginUser, ContactDb.STATE_SUBJECT);
|
||||
saveUser(contactDb.getId(), contactDbSubjectRequest.getChooseAdminUserIds(), loginUser, ContactDb.STATE_CHOOSE
|
||||
saveUser(contactDb.getId(), contactDbSubjectRequest.getChooseAdminUserIds(), loginUser, ContactDb.STATE_SUBJECT
|
||||
, Const.TYPE_ADMIN);
|
||||
saveUser(contactDb.getId(), contactDbSubjectRequest.getChooseDbUserIds(), loginUser, ContactDb.STATE_CHOOSE,
|
||||
saveUser(contactDb.getId(), contactDbSubjectRequest.getChooseDbUserIds(), loginUser, ContactDb.STATE_SUBJECT,
|
||||
Const.TYPE_RDDB);
|
||||
saveAttachment(contactDb.getId(), contactDbSubjectRequest.getInformationAttachmentName(),
|
||||
contactDbSubjectRequest.getInformationAttachmentPath(), loginUser,
|
||||
|
@ -167,7 +167,7 @@ public class ContactDbService extends BaseService<ContactDbMapper, ContactDb> {
|
|||
BeanUtil.copyProperties(contactSignRequest, contactDb);
|
||||
contactDb.setUpdatedId(loginUser.getId());
|
||||
saveOrUpdate(contactDb);
|
||||
// saveUser(contactDb.getId(), contactSignRequest.getSignUserIds(), loginUser, ContactDb.STATE_SIGN);
|
||||
saveUser(contactDb.getId(), contactSignRequest.getSignUserIds(), loginUser, ContactDb.STATE_CHOOSE);
|
||||
return contactDb;
|
||||
}
|
||||
|
||||
|
@ -309,11 +309,11 @@ public class ContactDbService extends BaseService<ContactDbMapper, ContactDb> {
|
|||
Assert.notNull(contactDb, "未找到该记录");
|
||||
ContactDbUser contactDbUser = contactDbUserService.getOne(new LambdaQueryWrapper<ContactDbUser>()
|
||||
.eq(ContactDbUser::getContactDbId, contactDb.getId())
|
||||
.eq(ContactDbUser::getType, ContactDb.STATE_SIGN)
|
||||
.eq(ContactDbUser::getType, ContactDb.STATE_CHOOSE)
|
||||
.eq(ContactDbUser::getUserId, loginUser.getId()));
|
||||
if (contactDbUser == null) return Ret.fail("您没有签到的权限");
|
||||
if (StrUtil.isNotBlank(contactDbUser.getSign())) return Ret.fail("您已签过到");
|
||||
if (contactDb.getState() > ContactDb.STATE_SIGN) return Ret.fail("签到已结束,不能操作");
|
||||
if (contactDb.getState() > ContactDb.STATE_CHOOSE) return Ret.fail("签到已结束,不能操作");
|
||||
contactDbUser.setSign(signRequest.getSign());
|
||||
contactDbUser.setSignAt(LocalDateTime.now());
|
||||
boolean flag = contactDbUserService.saveOrUpdate(contactDbUser);
|
||||
|
@ -321,7 +321,7 @@ public class ContactDbService extends BaseService<ContactDbMapper, ContactDb> {
|
|||
//自动进入下一环节
|
||||
int waitCount =
|
||||
contactDbUserService.count(Wrappers.lambdaQuery(ContactDbUser.class).eq(ContactDbUser::getContactDbId
|
||||
, contactDb.getId()).eq(ContactDbUser::getType, ContactDb.STATE_SIGN).isNull(ContactDbUser::getSign));
|
||||
, contactDb.getId()).eq(ContactDbUser::getType, ContactDb.STATE_CHOOSE).isNull(ContactDbUser::getSign));
|
||||
if (waitCount == 0) {
|
||||
contactDb.setState(ContactDb.STATE_SIGN);
|
||||
saveOrUpdate(contactDb);
|
||||
|
@ -333,7 +333,7 @@ public class ContactDbService extends BaseService<ContactDbMapper, ContactDb> {
|
|||
ContactDb contactDb = getById(id);
|
||||
Assert.notNull(contactDb, "未找到该记录");
|
||||
if (!loginUser.getId().equals(contactDb.getCreatedId())) return Ret.fail("您不是创建人,不能操作");
|
||||
if (ContactDb.STATE_SIGN != contactDb.getState()) throw new ResultException(Ret.fail("当前环节不能提交该信息"));
|
||||
if (ContactDb.STATE_CHOOSE != contactDb.getState()) throw new ResultException(Ret.fail("当前环节不能提交该信息"));
|
||||
contactDb.setState(ContactDb.STATE_SIGN);
|
||||
boolean flag = saveOrUpdate(contactDb);
|
||||
return !flag ? Ret.fail("操作失败") : Ret.ok().data(ContactDbWrapper.build().entityVO(contactDb));
|
||||
|
|
|
@ -233,17 +233,17 @@ public class ContactDbWrapper extends BaseWrapper<ContactDb, ContactDbDto> {
|
|||
.orderByAsc(ContactDbUser::getSortNo));
|
||||
List<ContactDbUser> chooseAdminUserList = contactDbUserService.list(new LambdaQueryWrapper<ContactDbUser>()
|
||||
.eq(ContactDbUser::getContactDbId, contactDb.getId())
|
||||
.eq(ContactDbUser::getType, ContactDb.STATE_CHOOSE)
|
||||
.eq(ContactDbUser::getType, ContactDb.STATE_SUBJECT)
|
||||
.eq(ContactDbUser::getIdentity, Const.TYPE_ADMIN)
|
||||
.orderByAsc(ContactDbUser::getSortNo));
|
||||
List<ContactDbUser> chooseDbUserList = contactDbUserService.list(new LambdaQueryWrapper<ContactDbUser>()
|
||||
.eq(ContactDbUser::getContactDbId, contactDb.getId())
|
||||
.eq(ContactDbUser::getType, ContactDb.STATE_CHOOSE)
|
||||
.eq(ContactDbUser::getType, ContactDb.STATE_SUBJECT)
|
||||
.eq(ContactDbUser::getIdentity, Const.TYPE_RDDB)
|
||||
.orderByAsc(ContactDbUser::getSortNo));
|
||||
List<ContactDbUser> signUserList = contactDbUserService.list(new LambdaQueryWrapper<ContactDbUser>()
|
||||
.eq(ContactDbUser::getContactDbId, contactDb.getId())
|
||||
.eq(ContactDbUser::getType, ContactDb.STATE_SIGN)
|
||||
.eq(ContactDbUser::getType, ContactDb.STATE_CHOOSE)
|
||||
.orderByAsc(ContactDbUser::getSortNo));
|
||||
List<ContactDbUser> conferenceUserList = contactDbUserService.list(new LambdaQueryWrapper<ContactDbUser>()
|
||||
.eq(ContactDbUser::getContactDbId, contactDb.getId())
|
||||
|
|
Loading…
Reference in New Issue