update
This commit is contained in:
parent
a2ca779289
commit
86e11e1f65
|
@ -125,8 +125,8 @@ public class ApiAppointController extends ApiBaseController {
|
|||
@PostMapping("state/vote")
|
||||
@ResponseBody
|
||||
public void stateVoteSave(@Validated AppointVoteStateRequest appointVoteRequest) {
|
||||
Appoint appoint = appointService.stateVoteSave(appointVoteRequest, getApiUser());
|
||||
render(Ret.ok().data(AppointWrapper.build().entityVO(appoint)));
|
||||
Ret ret = appointService.statusSave(appointStatusRequest, getApiUser());
|
||||
render(ret);
|
||||
}
|
||||
|
||||
@ApiOperation("投票")
|
||||
|
|
|
@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
|
@ -12,6 +14,7 @@ import java.time.LocalDateTime;
|
|||
public class AppointVoteStateRequest {
|
||||
|
||||
@ApiModelProperty(value = "任免督职id",required = true)
|
||||
@NotBlank(message = "任免督职id不能为空")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
|
@ -24,14 +27,24 @@ public class AppointVoteStateRequest {
|
|||
pattern = "yyyy-MM-dd HH:mm:ss"
|
||||
)
|
||||
@ApiModelProperty(value = "投票会议时间yyyy-MM-dd HH:mm:ss")
|
||||
@NotBlank(message = "投票会议时间不能为空")
|
||||
private LocalDateTime voteAt;
|
||||
|
||||
/**
|
||||
* 投票会议地址
|
||||
*/
|
||||
@ApiModelProperty(value = "投票会议地址")
|
||||
@NotBlank(message = "投票会议地址不能为空")
|
||||
private String voteAddress;
|
||||
|
||||
@ApiModelProperty(value = "投票会议人员id,英文逗号间隔")
|
||||
String voteUserIds;
|
||||
|
||||
/**
|
||||
* 是否通过
|
||||
*/
|
||||
@ApiModelProperty(value = "是否通过",required = true)
|
||||
@NotNull(message = "是否通过不能为空")
|
||||
private Boolean status;
|
||||
//
|
||||
// @ApiModelProperty(value = "投票会议人员id,英文逗号间隔")
|
||||
// String voteUserIds;
|
||||
}
|
||||
|
|
|
@ -141,7 +141,7 @@ public class AppointService extends BaseService<AppointMapper, Appoint> {
|
|||
BeanUtil.copyProperties(appointVoteRequest, appoint);
|
||||
appoint.setUpdatedId(loginUser.getId());
|
||||
saveOrUpdate(appoint);
|
||||
saveAppointUser(appoint.getId(), appointVoteRequest.getVoteUserIds(), loginUser, Appoint.STATE_VOTE);
|
||||
// saveAppointUser(appoint.getId(), appointVoteRequest.getVoteUserIds(), loginUser, Appoint.STATE_VOTE);
|
||||
return appoint;
|
||||
}
|
||||
|
||||
|
@ -202,14 +202,14 @@ public class AppointService extends BaseService<AppointMapper, Appoint> {
|
|||
* @param loginUser
|
||||
* @return
|
||||
*/
|
||||
public Ret statusSave(AppointStatusRequest appointStatusRequest, User loginUser) {
|
||||
Appoint appoint = getById(appointStatusRequest.getId());
|
||||
public Ret statusSave(AppointVoteStateRequest appointVoteStateRequest, User loginUser) {
|
||||
Appoint appoint = getById(appointVoteStateRequest.getId());
|
||||
Assert.notNull(appoint, "未找到该记录");
|
||||
if (!loginUser.getId().equals(appoint.getCreatedId())) return Ret.fail("您不是创建人,不能操作");
|
||||
if (Appoint.STATE_VOTE != appoint.getState()) throw new ResultException(Ret.fail("当前环节不能提交该信息"));
|
||||
// appoint.setState(Appoint.STATE_PUBLIC); 跳过公开环节
|
||||
appoint.setStatus(appointStatusRequest.getStatus());
|
||||
if(appointStatusRequest.getStatus()) {
|
||||
BeanUtil.copyProperties(appointVoteStateRequest, appoint);
|
||||
if(appoint.getStatus()) {
|
||||
appoint.setState(Appoint.STATE_PERFORM);
|
||||
}else {
|
||||
appoint.setState(Appoint.STATE_END);
|
||||
|
|
Loading…
Reference in New Issue