dev:岗位管理-代码修改
parent
f38b16b0dc
commit
75675756c4
|
|
@ -52,6 +52,10 @@ public class ZcloudPostFacadeImpl implements ZcloudPostFacade {
|
|||
|
||||
public MultiResponse<ZcloudPostCO> listByPostIds(ZcloudPostQry qry){
|
||||
|
||||
if(qry == null || qry.getPostIds() == null || qry.getPostIds().length == 0){
|
||||
return null;
|
||||
}
|
||||
|
||||
PostListQry postListQry = new PostListQry();
|
||||
BeanUtils.copyProperties(qry, postListQry);
|
||||
MultiResponse<PostCO> list = postService.list(postListQry);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public class ZcloudUserFacadeImpl implements ZcloudUserFacade {
|
|||
return MultiResponse.of(objects);
|
||||
}
|
||||
|
||||
@Override
|
||||
// @Override
|
||||
public SingleResponse<ZcloudUserCo> getInfoByUserId(Long aLong) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,9 @@ public class PostController {
|
|||
@ApiOperation("新增")
|
||||
@PostMapping("/save")
|
||||
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){
|
||||
throw new BizException("是否监管岗位不能为空");
|
||||
|
|
@ -45,13 +47,19 @@ public class PostController {
|
|||
|
||||
@ApiOperation("分页")
|
||||
@PostMapping("/list")
|
||||
public PageResponse<PostCO> page(@RequestBody PostPageQry qry) {
|
||||
public PageResponse<PostCO> page(@Validated @RequestBody PostPageQry qry) {
|
||||
if(qry.getCorpFlag() == 2){
|
||||
qry.setEqCorpinfoId(AuthContext.getTenantId());
|
||||
}
|
||||
return postService.listPage(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("所有数据")
|
||||
@PostMapping("/listAll")
|
||||
public MultiResponse<PostCO> listAll(@RequestBody PostListQry qry) {
|
||||
public MultiResponse<PostCO> listAll(@Validated @RequestBody PostListQry qry) {
|
||||
if(qry.getCorpFlag() == 2){
|
||||
qry.setCorpinfoId(AuthContext.getTenantId());
|
||||
}
|
||||
return postService.list(qry);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,12 +35,12 @@ public class PostAddCmd extends Command {
|
|||
// @NotNull(message = "状态 1-启用, 2-禁用不能为空")
|
||||
// private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "企业id", name = "corpinfoId", required = true)
|
||||
@NotNull(message = "企业id不能为空")
|
||||
@ApiModelProperty(value = "企业id", name = "corpinfoId")
|
||||
// @NotNull(message = "企业id不能为空")
|
||||
private Long corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称", name = "corpinfoName", required = true)
|
||||
@NotEmpty(message = "企业名称不能为空")
|
||||
@ApiModelProperty(value = "企业名称", name = "corpinfoName")
|
||||
// @NotEmpty(message = "企业名称不能为空")
|
||||
private String corpinfoName;
|
||||
|
||||
@ApiModelProperty(value = "是否监管岗位 0-否, 1-是", name = "supervisionFlag")
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
package com.zcloud.basic.info.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
|
||||
/**
|
||||
* web-client
|
||||
|
|
@ -24,9 +27,22 @@ public class PostListQry {
|
|||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "监管端/企业端标识,1-监管端, 2-企业端", name = "corpFlag", required = true)
|
||||
@NotNull(message = "监管端/企业端标识不能为空")
|
||||
// 监管端/企业端标识,1-监管端, 2-企业端
|
||||
private Integer corpFlag;
|
||||
|
||||
@ApiModelProperty(value = "主键id集合", name = "postIds", required = true)
|
||||
// 主键id集合
|
||||
private Long[] postIds;
|
||||
|
||||
@ApiModelProperty(value = "部门id", name = "departmentId", required = true)
|
||||
@NotNull(message = "部门id不能为空")
|
||||
// 部门id
|
||||
private Long departmentId;
|
||||
|
||||
@ApiModelProperty(value = "企业id", name = "eqCorpinfoId", required = true)
|
||||
// 企业id
|
||||
private Long corpinfoId;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
package com.zcloud.basic.info.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
|
||||
/**
|
||||
* web-client
|
||||
|
|
@ -23,10 +26,22 @@ public class PostPageQry extends PageQuery {
|
|||
* - `le`: 小于等于比较查询
|
||||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "监管端/企业端标识,1-监管端, 2-企业端", name = "departmentId", required = true)
|
||||
@NotNull(message = "监管端/企业端标识不能为空")
|
||||
// 监管端/企业端标识,1-监管端, 2-企业端
|
||||
private Integer corpFlag;
|
||||
|
||||
@ApiModelProperty(value = "部门id", name = "departmentId", required = true)
|
||||
@NotNull(message = "部门id不能为空")
|
||||
// 部门id
|
||||
private Long eqDepartmentId;
|
||||
|
||||
@ApiModelProperty(value = "企业id", name = "departmentId")
|
||||
// 企业id
|
||||
private Long eqCorpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "岗位名称", name = "departmentId")
|
||||
// 岗位名称
|
||||
private String likePostName;
|
||||
|
||||
|
|
|
|||
|
|
@ -39,12 +39,12 @@ public class PostUpdateCmd extends Command {
|
|||
// @NotNull(message = "状态 1-启用, 2-禁用不能为空")
|
||||
// private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "企业id", name = "corpinfoId", required = true)
|
||||
@NotNull(message = "企业id不能为空")
|
||||
@ApiModelProperty(value = "企业id", name = "corpinfoId")
|
||||
// @NotNull(message = "企业id不能为空")
|
||||
private Long corpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称", name = "corpinfoName", required = true)
|
||||
@NotEmpty(message = "企业名称不能为空")
|
||||
@ApiModelProperty(value = "企业名称", name = "corpinfoName")
|
||||
// @NotEmpty(message = "企业名称不能为空")
|
||||
private String corpinfoName;
|
||||
|
||||
@ApiModelProperty(value = "是否监管岗位 0-否, 1-是", name = "supervisionFlag")
|
||||
|
|
@ -53,7 +53,7 @@ public class PostUpdateCmd extends Command {
|
|||
@ApiModelProperty(value = "岗位 部门权限", name = "departmentIds")
|
||||
private Long[] departmentIds;
|
||||
|
||||
@ApiModelProperty(value = "监管端/企业端标识,1-监管端, 2-企业端", name = "corpFlag")
|
||||
@ApiModelProperty(value = "监管端/企业端标识,1-监管端, 2-企业端", name = "corpFlag", required = true)
|
||||
@NotNull(message = "监管端/企业端标识不能为空")
|
||||
private Integer corpFlag;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ public class PostRepositoryImpl extends BaseRepositoryImpl<PostMapper, PostDO> i
|
|||
public MultiResponse<PostDO> list(Map<String, Object> params) {
|
||||
Long[] ids = (Long[])params.get("postIds");
|
||||
Long departmentId = (Long)params.get("departmentId");
|
||||
Long corpinfoId = (Long)params.get("corpinfoId");
|
||||
QueryWrapper<PostDO> queryWrapper = new QueryWrapper<>();
|
||||
if(ids != null && ids.length > 0) {
|
||||
queryWrapper.in("id", ids);
|
||||
|
|
@ -50,6 +51,9 @@ public class PostRepositoryImpl extends BaseRepositoryImpl<PostMapper, PostDO> i
|
|||
if(departmentId != null && departmentId > 0) {
|
||||
queryWrapper.eq("department_id", departmentId);
|
||||
}
|
||||
if(corpinfoId != null && corpinfoId > 0) {
|
||||
queryWrapper.eq("corpinfo_id", corpinfoId);
|
||||
}
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
List<PostDO> postDOS = postMapper.selectList(queryWrapper);
|
||||
return MultiResponse.of(postDOS);
|
||||
|
|
|
|||
Loading…
Reference in New Issue