dev:岗位管理新增接口改为前端传企业id和名称
parent
bb0bec3639
commit
b3d883831c
|
|
@ -14,6 +14,7 @@ import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
|
@ -38,8 +39,6 @@ public class PostController {
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
public SingleResponse<PostCO> add(@Validated @RequestBody PostAddCmd cmd) {
|
public SingleResponse<PostCO> add(@Validated @RequestBody PostAddCmd cmd) {
|
||||||
// SSOUser ssoUser = AuthContext.getCurrentUser();
|
// SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||||
cmd.setCorpinfoId(AuthContext.getTenantId());
|
|
||||||
cmd.setCorpinfoName(AuthContext.getName());
|
|
||||||
// 监管端不用校验, 企业端必填
|
// 监管端不用校验, 企业端必填
|
||||||
// if(cmd.getCorpFlag() == 2 && cmd.getSupervisionFlag() == null){
|
// if(cmd.getCorpFlag() == 2 && cmd.getSupervisionFlag() == null){
|
||||||
// throw new BizException("是否监管岗位不能为空");
|
// throw new BizException("是否监管岗位不能为空");
|
||||||
|
|
@ -47,6 +46,17 @@ public class PostController {
|
||||||
return postService.add(cmd);
|
return postService.add(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改")
|
||||||
|
@PutMapping("/edit")
|
||||||
|
public SingleResponse edit(@Validated @RequestBody PostUpdateCmd cmd) {
|
||||||
|
// 监管端不用校验, 企业端必填
|
||||||
|
// if(cmd.getCorpFlag() == 2 && cmd.getSupervisionFlag() == null){
|
||||||
|
// throw new BizException("是否监管岗位不能为空");
|
||||||
|
// }
|
||||||
|
postService.edit(cmd);
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("分页")
|
@ApiOperation("分页")
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
public PageResponse<PostCO> page(@Validated @RequestBody PostPageQry qry) {
|
public PageResponse<PostCO> page(@Validated @RequestBody PostPageQry qry) {
|
||||||
|
|
@ -117,15 +127,6 @@ public class PostController {
|
||||||
return SingleResponse.buildSuccess();
|
return SingleResponse.buildSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("修改")
|
|
||||||
@PutMapping("/edit")
|
|
||||||
public SingleResponse edit(@Validated @RequestBody PostUpdateCmd cmd) {
|
|
||||||
// 监管端不用校验, 企业端必填
|
|
||||||
// if(cmd.getCorpFlag() == 2 && cmd.getSupervisionFlag() == null){
|
|
||||||
// throw new BizException("是否监管岗位不能为空");
|
|
||||||
// }
|
|
||||||
postService.edit(cmd);
|
|
||||||
return SingleResponse.buildSuccess();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,10 +33,13 @@ public class PostAddCmd extends Command {
|
||||||
@NotEmpty(message = "岗位职责不能为空")
|
@NotEmpty(message = "岗位职责不能为空")
|
||||||
private String remarks;
|
private String remarks;
|
||||||
|
|
||||||
@ApiModelProperty(value = "企业id", name = "corpinfoId")
|
@ApiModelProperty(value = "企业id", name = "corpinfoIdString", required = true)
|
||||||
|
@NotEmpty(message = "企业id不能为空")
|
||||||
|
private String corpinfoIdString;
|
||||||
private Long corpinfoId;
|
private Long corpinfoId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "企业名称", name = "corpinfoName")
|
@ApiModelProperty(value = "企业名称", name = "corpinfoName", required = true)
|
||||||
|
@NotEmpty(message = "企业名称不能为空")
|
||||||
private String corpinfoName;
|
private String corpinfoName;
|
||||||
|
|
||||||
// @ApiModelProperty(value = "是否监管岗位 0-否, 1-是", name = "supervisionFlag")
|
// @ApiModelProperty(value = "是否监管岗位 0-否, 1-是", name = "supervisionFlag")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue