修改新增组织bug

pull/3/head
chenjinlong 2021-03-03 14:05:46 +08:00
parent c3a5a55bbe
commit 71338d3c80
5 changed files with 13 additions and 19 deletions

View File

@ -71,7 +71,7 @@ public class HrPositionController {
*/ */
@PostResource(name = "更新职位状态", path = "/hrPosition/updateStatus") @PostResource(name = "更新职位状态", path = "/hrPosition/updateStatus")
public ResponseData updateStatus(@RequestBody @Validated(BaseRequest.updateStatus.class) HrPositionRequest hrPositionRequest) { public ResponseData updateStatus(@RequestBody @Validated(BaseRequest.updateStatus.class) HrPositionRequest hrPositionRequest) {
hrPositionService.updateStatus(hrPositionRequest); hrPositionService.changeStatus(hrPositionRequest);
return new SuccessResponseData(); return new SuccessResponseData();
} }

View File

@ -61,7 +61,7 @@ public class HrOrganization extends BaseEntity {
/** /**
* 1-2- * 1-2-
*/ */
@TableField("status_flag") @TableField(value = "status_flag",fill = FieldFill.INSERT)
private Integer statusFlag; private Integer statusFlag;
/** /**

View File

@ -43,13 +43,13 @@ public interface HrPositionService extends IService<HrPosition> {
void edit(HrPositionRequest hrPositionRequest); void edit(HrPositionRequest hrPositionRequest);
/** /**
* *
* *
* @param hrPositionRequest * @param hrPositionRequest
* @author chenjinlong * @author chenjinlong
* @date 2020/11/18 23:00 * @date 2020/11/18 23:00
*/ */
void updateStatus(HrPositionRequest hrPositionRequest); void changeStatus(HrPositionRequest hrPositionRequest);
/** /**
* *

View File

@ -149,7 +149,7 @@ public class HrOrganizationServiceImpl extends ServiceImpl<HrOrganizationMapper,
@Override @Override
public HrOrganization detail(HrOrganizationRequest hrOrganizationRequest) { public HrOrganization detail(HrOrganizationRequest hrOrganizationRequest) {
return this.queryOrganization(hrOrganizationRequest); return this.getOne(this.createWrapper(hrOrganizationRequest), false);
} }
@Override @Override
@ -387,7 +387,7 @@ public class HrOrganizationServiceImpl extends ServiceImpl<HrOrganizationMapper,
} else { } else {
// 获取父组织机构 // 获取父组织机构
HrOrganizationRequest hrOrganizationRequest = new HrOrganizationRequest(); HrOrganizationRequest hrOrganizationRequest = new HrOrganizationRequest();
hrOrganizationRequest.setOrgId(hrOrganization.getOrgId()); hrOrganizationRequest.setOrgId(hrOrganization.getOrgParentId());
HrOrganization parentOrganization = this.queryOrganization(hrOrganizationRequest); HrOrganization parentOrganization = this.queryOrganization(hrOrganizationRequest);
// 设置本节点的父ids为 (上一个节点的pids + (上级节点的id) ) // 设置本节点的父ids为 (上一个节点的pids + (上级节点的id) )

View File

@ -69,7 +69,7 @@ public class HrPositionServiceImpl extends ServiceImpl<HrPositionMapper, HrPosit
} }
@Override @Override
public void updateStatus(HrPositionRequest hrPositionRequest) { public void changeStatus(HrPositionRequest hrPositionRequest) {
HrPosition sysPosition = this.querySysPositionById(hrPositionRequest); HrPosition sysPosition = this.querySysPositionById(hrPositionRequest);
sysPosition.setStatusFlag(hrPositionRequest.getStatusFlag()); sysPosition.setStatusFlag(hrPositionRequest.getStatusFlag());
this.updateById(sysPosition); this.updateById(sysPosition);
@ -82,8 +82,7 @@ public class HrPositionServiceImpl extends ServiceImpl<HrPositionMapper, HrPosit
@Override @Override
public List<HrPosition> findList(HrPositionRequest hrPositionRequest) { public List<HrPosition> findList(HrPositionRequest hrPositionRequest) {
LambdaQueryWrapper<HrPosition> wrapper = this.createWrapper(hrPositionRequest); return this.list(this.createWrapper(hrPositionRequest));
return this.list(wrapper);
} }
@Override @Override
@ -119,16 +118,6 @@ public class HrPositionServiceImpl extends ServiceImpl<HrPositionMapper, HrPosit
private LambdaQueryWrapper<HrPosition> createWrapper(HrPositionRequest hrPositionRequest) { private LambdaQueryWrapper<HrPosition> createWrapper(HrPositionRequest hrPositionRequest) {
LambdaQueryWrapper<HrPosition> queryWrapper = new LambdaQueryWrapper<>(); 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(); Long positionId = hrPositionRequest.getPositionId();
String positionName = hrPositionRequest.getPositionName(); String positionName = hrPositionRequest.getPositionName();
String positionCode = hrPositionRequest.getPositionCode(); String positionCode = hrPositionRequest.getPositionCode();
@ -138,6 +127,11 @@ public class HrPositionServiceImpl extends ServiceImpl<HrPositionMapper, HrPosit
queryWrapper.like(StrUtil.isNotEmpty(positionName), HrPosition::getPositionName, positionName); queryWrapper.like(StrUtil.isNotEmpty(positionName), HrPosition::getPositionName, positionName);
queryWrapper.eq(StrUtil.isNotEmpty(positionCode), HrPosition::getPositionCode, positionCode); queryWrapper.eq(StrUtil.isNotEmpty(positionCode), HrPosition::getPositionCode, positionCode);
// 查询未删除状态的
queryWrapper.eq(HrPosition::getDelFlag, YesOrNotEnum.N.getCode());
// 根据排序升序排列
queryWrapper.orderByAsc(HrPosition::getPositionSort);
return queryWrapper; return queryWrapper;
} }