dev:岗位管理新增接口改为前端传企业id和名称

main
SondonYong 2025-11-10 14:54:17 +08:00
parent bb0bec3639
commit b3d883831c
2 changed files with 18 additions and 14 deletions

View File

@ -14,6 +14,7 @@ import com.jjb.saas.framework.auth.utils.AuthContext;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.apache.commons.lang.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -38,8 +39,6 @@ public class PostController {
@PostMapping("/save")
public SingleResponse<PostCO> add(@Validated @RequestBody PostAddCmd cmd) {
// SSOUser ssoUser = AuthContext.getCurrentUser();
cmd.setCorpinfoId(AuthContext.getTenantId());
cmd.setCorpinfoName(AuthContext.getName());
// 监管端不用校验, 企业端必填
// if(cmd.getCorpFlag() == 2 && cmd.getSupervisionFlag() == null){
// throw new BizException("是否监管岗位不能为空");
@ -47,6 +46,17 @@ public class PostController {
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("分页")
@PostMapping("/list")
public PageResponse<PostCO> page(@Validated @RequestBody PostPageQry qry) {
@ -117,15 +127,6 @@ public class PostController {
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();
}
}

View File

@ -33,10 +33,13 @@ public class PostAddCmd extends Command {
@NotEmpty(message = "岗位职责不能为空")
private String remarks;
@ApiModelProperty(value = "企业id", name = "corpinfoId")
@ApiModelProperty(value = "企业id", name = "corpinfoIdString", required = true)
@NotEmpty(message = "企业id不能为空")
private String corpinfoIdString;
private Long corpinfoId;
@ApiModelProperty(value = "企业名称", name = "corpinfoName")
@ApiModelProperty(value = "企业名称", name = "corpinfoName", required = true)
@NotEmpty(message = "企业名称不能为空")
private String corpinfoName;
// @ApiModelProperty(value = "是否监管岗位 0-否, 1-是", name = "supervisionFlag")