mirror of https://gitee.com/stylefeng/roses
修改新增组织bug
parent
c3a5a55bbe
commit
71338d3c80
|
@ -71,7 +71,7 @@ public class HrPositionController {
|
|||
*/
|
||||
@PostResource(name = "更新职位状态", path = "/hrPosition/updateStatus")
|
||||
public ResponseData updateStatus(@RequestBody @Validated(BaseRequest.updateStatus.class) HrPositionRequest hrPositionRequest) {
|
||||
hrPositionService.updateStatus(hrPositionRequest);
|
||||
hrPositionService.changeStatus(hrPositionRequest);
|
||||
return new SuccessResponseData();
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ public class HrOrganization extends BaseEntity {
|
|||
/**
|
||||
* 状态:1-启用,2-禁用
|
||||
*/
|
||||
@TableField("status_flag")
|
||||
@TableField(value = "status_flag",fill = FieldFill.INSERT)
|
||||
private Integer statusFlag;
|
||||
|
||||
/**
|
||||
|
|
|
@ -43,13 +43,13 @@ public interface HrPositionService extends IService<HrPosition> {
|
|||
void edit(HrPositionRequest hrPositionRequest);
|
||||
|
||||
/**
|
||||
* 更新装填
|
||||
* 更新状态
|
||||
*
|
||||
* @param hrPositionRequest 请求参数
|
||||
* @author chenjinlong
|
||||
* @date 2020/11/18 23:00
|
||||
*/
|
||||
void updateStatus(HrPositionRequest hrPositionRequest);
|
||||
void changeStatus(HrPositionRequest hrPositionRequest);
|
||||
|
||||
/**
|
||||
* 查看详情
|
||||
|
|
|
@ -149,7 +149,7 @@ public class HrOrganizationServiceImpl extends ServiceImpl<HrOrganizationMapper,
|
|||
|
||||
@Override
|
||||
public HrOrganization detail(HrOrganizationRequest hrOrganizationRequest) {
|
||||
return this.queryOrganization(hrOrganizationRequest);
|
||||
return this.getOne(this.createWrapper(hrOrganizationRequest), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -387,7 +387,7 @@ public class HrOrganizationServiceImpl extends ServiceImpl<HrOrganizationMapper,
|
|||
} else {
|
||||
// 获取父组织机构
|
||||
HrOrganizationRequest hrOrganizationRequest = new HrOrganizationRequest();
|
||||
hrOrganizationRequest.setOrgId(hrOrganization.getOrgId());
|
||||
hrOrganizationRequest.setOrgId(hrOrganization.getOrgParentId());
|
||||
HrOrganization parentOrganization = this.queryOrganization(hrOrganizationRequest);
|
||||
|
||||
// 设置本节点的父ids为 (上一个节点的pids + (上级节点的id) )
|
||||
|
|
|
@ -69,7 +69,7 @@ public class HrPositionServiceImpl extends ServiceImpl<HrPositionMapper, HrPosit
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateStatus(HrPositionRequest hrPositionRequest) {
|
||||
public void changeStatus(HrPositionRequest hrPositionRequest) {
|
||||
HrPosition sysPosition = this.querySysPositionById(hrPositionRequest);
|
||||
sysPosition.setStatusFlag(hrPositionRequest.getStatusFlag());
|
||||
this.updateById(sysPosition);
|
||||
|
@ -82,8 +82,7 @@ public class HrPositionServiceImpl extends ServiceImpl<HrPositionMapper, HrPosit
|
|||
|
||||
@Override
|
||||
public List<HrPosition> findList(HrPositionRequest hrPositionRequest) {
|
||||
LambdaQueryWrapper<HrPosition> wrapper = this.createWrapper(hrPositionRequest);
|
||||
return this.list(wrapper);
|
||||
return this.list(this.createWrapper(hrPositionRequest));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -119,16 +118,6 @@ public class HrPositionServiceImpl extends ServiceImpl<HrPositionMapper, HrPosit
|
|||
private LambdaQueryWrapper<HrPosition> createWrapper(HrPositionRequest hrPositionRequest) {
|
||||
LambdaQueryWrapper<HrPosition> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
// 查询未删除状态的
|
||||
queryWrapper.eq(HrPosition::getDelFlag, YesOrNotEnum.N.getCode());
|
||||
|
||||
// 根据排序升序排列,序号越小越在前
|
||||
queryWrapper.orderByAsc(HrPosition::getPositionSort);
|
||||
|
||||
if (ObjectUtil.isEmpty(hrPositionRequest)) {
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
Long positionId = hrPositionRequest.getPositionId();
|
||||
String positionName = hrPositionRequest.getPositionName();
|
||||
String positionCode = hrPositionRequest.getPositionCode();
|
||||
|
@ -138,6 +127,11 @@ public class HrPositionServiceImpl extends ServiceImpl<HrPositionMapper, HrPosit
|
|||
queryWrapper.like(StrUtil.isNotEmpty(positionName), HrPosition::getPositionName, positionName);
|
||||
queryWrapper.eq(StrUtil.isNotEmpty(positionCode), HrPosition::getPositionCode, positionCode);
|
||||
|
||||
// 查询未删除状态的
|
||||
queryWrapper.eq(HrPosition::getDelFlag, YesOrNotEnum.N.getCode());
|
||||
// 根据排序升序排列
|
||||
queryWrapper.orderByAsc(HrPosition::getPositionSort);
|
||||
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue