This commit is contained in:
lijiaqi 2022-09-07 14:27:53 +08:00
parent 4f571895de
commit 175de0e818
4 changed files with 58 additions and 0 deletions

View File

@ -146,6 +146,14 @@ public class ApiAppointController extends ApiBaseController {
render(ret);
}
@ApiOperation("是否通过")
@PostMapping("vote/statusSave")
public void statusSave(@Validated @RequestBody AppointStatusRequest appointStatusRequest) {
Ret ret = appointService.statusSave(appointStatusRequest, getApiUser());
render(ret);
}
//公开环节自动跳过
@ApiOperation("履职环节")
@ -156,6 +164,7 @@ public class ApiAppointController extends ApiBaseController {
render(Ret.ok().data(AppointWrapper.build().entityVO(appoint)));
}
@ApiOperation("打分")
@PostMapping("perform")
@ResponseBody

View File

@ -8,6 +8,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
/**
@ -177,4 +178,10 @@ public class Appoint extends BaseEntity {
*/
@ApiModelProperty(value = "当前环节 1-6")
private Integer state;
/**
* 是否通过
*/
@ApiModelProperty(value = "是否通过")
private Boolean status;
}

View File

@ -0,0 +1,18 @@
package com.ydool.boot.modules.rddb.entity.request.appoint.state;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class AppointStatusRequest {
@ApiModelProperty(value = "任免督职id",required = true)
@NotBlank(message = "任免督职id不能为空")
private String id;
@ApiModelProperty(value = "是否通过",required = true)
@NotBlank(message = "是否通过不能为空")
private Boolean status;
}

View File

@ -196,6 +196,30 @@ public class AppointService extends BaseService<AppointMapper, Appoint> {
return !flag ? Ret.fail("操作失败") : Ret.ok().data(AppointWrapper.build().entityVO(appoint));
}
/**
* 是否通过
* @param appointStatusRequest
* @param loginUser
* @return
*/
public Ret statusSave(AppointStatusRequest appointStatusRequest, User loginUser) {
Appoint appoint = getById(appointStatusRequest.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()) {
appoint.setState(Appoint.STATE_PERFORM);
}else {
appoint.setState(Appoint.STATE_END);
}
boolean flag = saveOrUpdate(appoint);
return !flag ? Ret.fail("操作失败") : Ret.ok().data(AppointWrapper.build().entityVO(appoint));
}
public Appoint statePerformSave(AppointPerformStateRequest appointPerformRequest, User loginUser) {
Appoint appoint = getById(appointPerformRequest.getId());
Assert.notNull(appoint, "未找到该记录");