update
This commit is contained in:
parent
7e134f55bb
commit
c60410adcb
|
@ -180,6 +180,15 @@ public class ApiContactDbController extends ApiBaseController {
|
||||||
render(ret);
|
render(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("是否通过")
|
||||||
|
@PutMapping("evaluate/status/{id}/{status")
|
||||||
|
@ApiImplicitParams({@ApiImplicitParam(name = "id", value = "常委会联系代表id"), @ApiImplicitParam(name = "status", value =
|
||||||
|
"是否通过: 1通过,0不通过")})
|
||||||
|
public void evaluateStatus(@PathVariable("id") String id,@PathVariable("status") Integer status) {
|
||||||
|
Ret ret = contactDbService.evaluateStatus(id,status,getApiUser());
|
||||||
|
render(ret);
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("通知")
|
@ApiOperation("通知")
|
||||||
@PostMapping("send_msg/{id}")
|
@PostMapping("send_msg/{id}")
|
||||||
@ApiImplicitParam(name = "id", value = "常委会联系代表id")
|
@ApiImplicitParam(name = "id", value = "常委会联系代表id")
|
||||||
|
@ -188,4 +197,6 @@ public class ApiContactDbController extends ApiBaseController {
|
||||||
Ret ret = contactDbService.sendMsg(id, getApiUser());
|
Ret ret = contactDbService.sendMsg(id, getApiUser());
|
||||||
render(ret);
|
render(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,4 +181,10 @@ public class ContactDb extends BaseEntity{
|
||||||
@ApiModelProperty(value = "admin机关办公/ rddb代表/ voter选民 多个用英文逗号间隔")
|
@ApiModelProperty(value = "admin机关办公/ rddb代表/ voter选民 多个用英文逗号间隔")
|
||||||
private String obj;
|
private String obj;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否通过
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "是否通过")
|
||||||
|
private Boolean status;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,8 @@ public class ContactDbService extends BaseService<ContactDbMapper, ContactDb> {
|
||||||
public boolean del(String id) {
|
public boolean del(String id) {
|
||||||
contactDbUserService.remove(new LambdaQueryWrapper<ContactDbUser>().eq(ContactDbUser::getContactDbId, id));
|
contactDbUserService.remove(new LambdaQueryWrapper<ContactDbUser>().eq(ContactDbUser::getContactDbId, id));
|
||||||
contactDbAttachmentService.remove(new LambdaQueryWrapper<ContactDbAttachment>().eq(ContactDbAttachment::getContactDbId, id));
|
contactDbAttachmentService.remove(new LambdaQueryWrapper<ContactDbAttachment>().eq(ContactDbAttachment::getContactDbId, id));
|
||||||
contactDbCommentService.remove(new LambdaQueryWrapper<ContactDbComment>().eq(ContactDbComment::getContactDbId, id));
|
contactDbCommentService.remove(new LambdaQueryWrapper<ContactDbComment>().eq(ContactDbComment::getContactDbId
|
||||||
|
, id));
|
||||||
return removeById(id);
|
return removeById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,8 +93,10 @@ public class ContactDbService extends BaseService<ContactDbMapper, ContactDb> {
|
||||||
saveUser(contactDbBo.getId(), evaluateUserIds, loginUser, ContactDb.STATE_EVALUATE);
|
saveUser(contactDbBo.getId(), evaluateUserIds, loginUser, ContactDb.STATE_EVALUATE);
|
||||||
|
|
||||||
//保存附件
|
//保存附件
|
||||||
saveAttachment(contactDbBo.getId(), contactDbBo.getConferenceRecordAttachmentArrStr(), loginUser, ContactDbAttachment.TYPE_CONFERENCE_RECORD);
|
saveAttachment(contactDbBo.getId(), contactDbBo.getConferenceRecordAttachmentArrStr(), loginUser,
|
||||||
saveAttachment(contactDbBo.getId(), contactDbBo.getConferencePhotoAttachmentArrStr(), loginUser, ContactDbAttachment.TYPE_CONFERENCE_PHOTO);
|
ContactDbAttachment.TYPE_CONFERENCE_RECORD);
|
||||||
|
saveAttachment(contactDbBo.getId(), contactDbBo.getConferencePhotoAttachmentArrStr(), loginUser,
|
||||||
|
ContactDbAttachment.TYPE_CONFERENCE_PHOTO);
|
||||||
return Ret.ok();
|
return Ret.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,8 +134,10 @@ public class ContactDbService extends BaseService<ContactDbMapper, ContactDb> {
|
||||||
contactDb.setState(ContactDb.STATE_SIGN);
|
contactDb.setState(ContactDb.STATE_SIGN);
|
||||||
contactDb.setUpdatedId(loginUser.getId());
|
contactDb.setUpdatedId(loginUser.getId());
|
||||||
saveOrUpdate(contactDb);
|
saveOrUpdate(contactDb);
|
||||||
saveUser(contactDb.getId(), contactDbChooseRequest.getChooseAdminUserIds(), loginUser, ContactDb.STATE_CHOOSE, Const.TYPE_ADMIN);
|
saveUser(contactDb.getId(), contactDbChooseRequest.getChooseAdminUserIds(), loginUser, ContactDb.STATE_CHOOSE
|
||||||
saveUser(contactDb.getId(), contactDbChooseRequest.getChooseDbUserIds(), loginUser, ContactDb.STATE_CHOOSE, Const.TYPE_RDDB);
|
, Const.TYPE_ADMIN);
|
||||||
|
saveUser(contactDb.getId(), contactDbChooseRequest.getChooseDbUserIds(), loginUser, ContactDb.STATE_CHOOSE,
|
||||||
|
Const.TYPE_RDDB);
|
||||||
return contactDb;
|
return contactDb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,7 +163,8 @@ public class ContactDbService extends BaseService<ContactDbMapper, ContactDb> {
|
||||||
contactDb.setState(ContactDb.STATE_EVALUATE);
|
contactDb.setState(ContactDb.STATE_EVALUATE);
|
||||||
contactDb.setUpdatedId(loginUser.getId());
|
contactDb.setUpdatedId(loginUser.getId());
|
||||||
saveOrUpdate(contactDb);
|
saveOrUpdate(contactDb);
|
||||||
saveUser(contactDb.getId(), contactDbConferenceRequest.getConferenceUserIds(), loginUser, ContactDb.STATE_CONFERENCE);
|
saveUser(contactDb.getId(), contactDbConferenceRequest.getConferenceUserIds(), loginUser,
|
||||||
|
ContactDb.STATE_CONFERENCE);
|
||||||
saveAttachment(contactDb.getId(), contactDbConferenceRequest.getConferenceRecordAttachmentName(),
|
saveAttachment(contactDb.getId(), contactDbConferenceRequest.getConferenceRecordAttachmentName(),
|
||||||
contactDbConferenceRequest.getConferenceRecordAttachmentPath(), loginUser,
|
contactDbConferenceRequest.getConferenceRecordAttachmentPath(), loginUser,
|
||||||
ContactDbAttachment.TYPE_CONFERENCE_RECORD,
|
ContactDbAttachment.TYPE_CONFERENCE_RECORD,
|
||||||
|
@ -200,7 +206,9 @@ public class ContactDbService extends BaseService<ContactDbMapper, ContactDb> {
|
||||||
boolean flag = contactDbUserService.saveOrUpdate(contactDbUser);
|
boolean flag = contactDbUserService.saveOrUpdate(contactDbUser);
|
||||||
|
|
||||||
//自动进入下一环节
|
//自动进入下一环节
|
||||||
int waitCount = contactDbUserService.count(Wrappers.lambdaQuery(ContactDbUser.class).eq(ContactDbUser::getContactDbId, contactDb.getId()).eq(ContactDbUser::getType, ContactDb.STATE_SIGN).isNull(ContactDbUser::getSign));
|
int waitCount =
|
||||||
|
contactDbUserService.count(Wrappers.lambdaQuery(ContactDbUser.class).eq(ContactDbUser::getContactDbId
|
||||||
|
, contactDb.getId()).eq(ContactDbUser::getType, ContactDb.STATE_SIGN).isNull(ContactDbUser::getSign));
|
||||||
if (waitCount == 0) {
|
if (waitCount == 0) {
|
||||||
contactDb.setState(ContactDb.STATE_CONFERENCE);
|
contactDb.setState(ContactDb.STATE_CONFERENCE);
|
||||||
saveOrUpdate(contactDb);
|
saveOrUpdate(contactDb);
|
||||||
|
@ -233,7 +241,9 @@ public class ContactDbService extends BaseService<ContactDbMapper, ContactDb> {
|
||||||
boolean flag = contactDbUserService.saveOrUpdate(contactDbUser);
|
boolean flag = contactDbUserService.saveOrUpdate(contactDbUser);
|
||||||
|
|
||||||
//自动进入下一环节
|
//自动进入下一环节
|
||||||
int waitCount = contactDbUserService.count(Wrappers.lambdaQuery(ContactDbUser.class).eq(ContactDbUser::getContactDbId, contactDb.getId()).eq(ContactDbUser::getType, ContactDb.STATE_EVALUATE).isNull(ContactDbUser::getScore));
|
int waitCount =
|
||||||
|
contactDbUserService.count(Wrappers.lambdaQuery(ContactDbUser.class).eq(ContactDbUser::getContactDbId
|
||||||
|
, contactDb.getId()).eq(ContactDbUser::getType, ContactDb.STATE_EVALUATE).isNull(ContactDbUser::getScore));
|
||||||
if (waitCount == 0) {
|
if (waitCount == 0) {
|
||||||
contactDb.setState(ContactDb.STATE_END);
|
contactDb.setState(ContactDb.STATE_END);
|
||||||
saveOrUpdate(contactDb);
|
saveOrUpdate(contactDb);
|
||||||
|
@ -252,6 +262,24 @@ public class ContactDbService extends BaseService<ContactDbMapper, ContactDb> {
|
||||||
return !flag ? Ret.fail("操作失败") : Ret.ok().data(ContactDbWrapper.build().entityVO(contactDb));
|
return !flag ? Ret.fail("操作失败") : Ret.ok().data(ContactDbWrapper.build().entityVO(contactDb));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Ret evaluateStatus(String id, Integer status, User loginUser) {
|
||||||
|
ContactDb contactDb = getById(id);
|
||||||
|
Assert.notNull(contactDb, "未找到该记录");
|
||||||
|
if (!loginUser.getId().equals(contactDb.getCreatedId())) return Ret.fail("您不是创建人,不能操作");
|
||||||
|
if (ContactDb.STATE_CONFERENCE != contactDb.getState())
|
||||||
|
throw new ResultException(Ret.fail("当前环节不能提交该信息"));
|
||||||
|
if (status == 0) {
|
||||||
|
contactDb.setState(ContactDb.STATE_END);
|
||||||
|
contactDb.setStatus(false);
|
||||||
|
}else if (status == 1){
|
||||||
|
contactDb.setStatus(false);
|
||||||
|
}else {
|
||||||
|
return Ret.fail("status传输数据有误");
|
||||||
|
}
|
||||||
|
boolean flag = saveOrUpdate(contactDb);
|
||||||
|
return !flag ? Ret.fail("操作失败") : Ret.ok().data(ContactDbWrapper.build().entityVO(contactDb));
|
||||||
|
}
|
||||||
|
|
||||||
public Ret sendMsg(String id, User loginUser) {
|
public Ret sendMsg(String id, User loginUser) {
|
||||||
ContactDb contactDb = getById(id);
|
ContactDb contactDb = getById(id);
|
||||||
Assert.notNull(contactDb, "未找到该记录");
|
Assert.notNull(contactDb, "未找到该记录");
|
||||||
|
@ -330,11 +358,14 @@ public class ContactDbService extends BaseService<ContactDbMapper, ContactDb> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//3.删除本来有而现在没有的
|
//3.删除本来有而现在没有的
|
||||||
contactDbUserService.remove(new LambdaQueryWrapper<ContactDbUser>().eq(ContactDbUser::getContactDbId, contactDbId).eq(ContactDbUser::getType, type).notIn(ContactDbUser::getUserId, userIdList).eq(StrUtil.isNotBlank(identity), ContactDbUser::getIdentity, identity));
|
contactDbUserService.remove(new LambdaQueryWrapper<ContactDbUser>().eq(ContactDbUser::getContactDbId,
|
||||||
|
contactDbId).eq(ContactDbUser::getType, type).notIn(ContactDbUser::getUserId, userIdList).eq(StrUtil.isNotBlank(identity), ContactDbUser::getIdentity, identity));
|
||||||
contactDbUserService.saveBatch(userList);
|
contactDbUserService.saveBatch(userList);
|
||||||
} else {
|
} else {
|
||||||
//4.删除全部
|
//4.删除全部
|
||||||
contactDbUserService.remove(new LambdaQueryWrapper<ContactDbUser>().eq(ContactDbUser::getContactDbId, contactDbId).eq(ContactDbUser::getType, type).eq(StrUtil.isNotBlank(identity), ContactDbUser::getIdentity, identity));
|
contactDbUserService.remove(new LambdaQueryWrapper<ContactDbUser>().eq(ContactDbUser::getContactDbId,
|
||||||
|
contactDbId).eq(ContactDbUser::getType, type).eq(StrUtil.isNotBlank(identity),
|
||||||
|
ContactDbUser::getIdentity, identity));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -360,7 +391,8 @@ public class ContactDbService extends BaseService<ContactDbMapper, ContactDb> {
|
||||||
item.setCreatedId(loginUser.getId());
|
item.setCreatedId(loginUser.getId());
|
||||||
item.setCreatedAt(LocalDateTime.now());
|
item.setCreatedAt(LocalDateTime.now());
|
||||||
if (StrUtil.isNotBlank(item.getConferenceId())) {
|
if (StrUtil.isNotBlank(item.getConferenceId())) {
|
||||||
conferenceAttachmentService.associationMeeting(item.getConferenceId(), item.getAttachment(), item.getTitle(), "常委会联系代表附件", loginUser.getId());
|
conferenceAttachmentService.associationMeeting(item.getConferenceId(), item.getAttachment(),
|
||||||
|
item.getTitle(), "常委会联系代表附件", loginUser.getId());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
contactDbAttachmentService.saveBatch(attachmentList);
|
contactDbAttachmentService.saveBatch(attachmentList);
|
||||||
|
@ -389,7 +421,8 @@ public class ContactDbService extends BaseService<ContactDbMapper, ContactDb> {
|
||||||
.setConferenceName(conferenceNameArr[i]).
|
.setConferenceName(conferenceNameArr[i]).
|
||||||
setContactDbId(contactDbId).setTitle(nameArr[i]).setAttachment(pathArr[i]).setCreatedId(loginUser.getId()).setCreatedAt(LocalDateTime.now());
|
setContactDbId(contactDbId).setTitle(nameArr[i]).setAttachment(pathArr[i]).setCreatedId(loginUser.getId()).setCreatedAt(LocalDateTime.now());
|
||||||
if (StrUtil.isNotBlank(conferenceIdArr[i])) {
|
if (StrUtil.isNotBlank(conferenceIdArr[i])) {
|
||||||
conferenceAttachmentService.associationMeeting(conferenceIdArr[i], conferenceNameArr[i], nameArr[i], "常委会联系代表附件", loginUser.getId());
|
conferenceAttachmentService.associationMeeting(conferenceIdArr[i], conferenceNameArr[i],
|
||||||
|
nameArr[i], "常委会联系代表附件", loginUser.getId());
|
||||||
}
|
}
|
||||||
contactDbAttachmentService.save(contactDbAttachment);
|
contactDbAttachmentService.save(contactDbAttachment);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue