修改状态

This commit is contained in:
mash 2024-12-03 10:32:11 +08:00
parent 91b9659645
commit 50bd5ec3b5
5 changed files with 31 additions and 6 deletions

View File

@ -47,6 +47,12 @@ public class OrganizationController extends BaseController {
return organizationService.deleteOrganization(id); return organizationService.deleteOrganization(id);
} }
@GetMapping("/personnel")
@ApiOperation(value = "人员")
public AjaxResult personnel(){
return organizationService.personnel();
}
@GetMapping(value = "/approval") @GetMapping(value = "/approval")
@ApiOperation(value = "招聘单号") @ApiOperation(value = "招聘单号")
@ApiImplicitParams({@ApiImplicitParam(value = "企业id", name = "id", required = true)}) @ApiImplicitParams({@ApiImplicitParam(value = "企业id", name = "id", required = true)})

View File

@ -97,6 +97,10 @@ public class Organization extends BaseEntity{
@TableField(exist = false) @TableField(exist = false)
private Integer retiree = 0; private Integer retiree = 0;
@ApiModelProperty(value = "离职人员")
@TableField(exist = false)
private Integer quit = 0;
@ApiModelProperty(value = "剩余招聘") @ApiModelProperty(value = "剩余招聘")
@TableField(exist = false) @TableField(exist = false)
private Integer surplus = 0; private Integer surplus = 0;

View File

@ -24,5 +24,7 @@ public interface IOrganizationService {
AjaxResult submitRecruitment(String id, String type); AjaxResult submitRecruitment(String id, String type);
AjaxResult approval(String id); AjaxResult approval(String id);
AjaxResult personnel();
} }

View File

@ -109,6 +109,8 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
record.setSurplus(Math.toIntExact(places.getSum() - totalPersonnelCount)); record.setSurplus(Math.toIntExact(places.getSum() - totalPersonnelCount));
int retireeCount = personnelService.count(eq.eq(Personnel::getIsInfo, Boolean.TRUE)); int retireeCount = personnelService.count(eq.eq(Personnel::getIsInfo, Boolean.TRUE));
record.setRetiree(retireeCount); record.setRetiree(retireeCount);
int whetherIsQuit = personnelService.count(eq.eq(Personnel::getWhetherIsQuit, Boolean.TRUE));
record.setQuit(whetherIsQuit);
} }
} }
return AjaxResult.ok().data(selectPage); return AjaxResult.ok().data(selectPage);
@ -223,5 +225,14 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
} }
return AjaxResult.ok().data(dtoList); return AjaxResult.ok().data(dtoList);
} }
@Override
public AjaxResult personnel() {
CompanyName companyName = companyNameMapper.selectOne(Wrappers.lambdaQuery(CompanyName.class).eq(CompanyName::getCompanyName, "象山县粮食收储有限公司"));
if (companyName == null) {
return AjaxResult.ok().data(0);
}
return AjaxResult.ok().data(companyName.getResidualNumber());
}
} }

View File

@ -943,12 +943,13 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
@Override @Override
public AjaxResult updatePersonnelRetire(String id) { public AjaxResult updatePersonnelRetire(String id) {
Personnel personnel = getById(id); Personnel personnel = getById(id);
if (!"退休".equals(personnel.getWorkState())) { // if (!"退休".equals(personnel.getWorkState())) {
return AjaxResult.fail("该人员未办理退休变更,请先办理退休变更!"); // return AjaxResult.fail("该人员未办理退休变更,请先办理退休变更!");
} // }
if (BooleanUtil.isTrue(personnel.getIsInfo())) { if (BooleanUtil.isTrue(personnel.getIsInfo())) {
return AjaxResult.fail("请勿重复办理!"); return AjaxResult.fail("请勿重复办理!");
} }
personnel.setWorkState("退休");
personnel.setIsInfo(true); personnel.setIsInfo(true);
boolean b = updateById(personnel); boolean b = updateById(personnel);
CompanyName companyName = companyNameMapper.selectById(personnel.getCompanyName()); CompanyName companyName = companyNameMapper.selectById(personnel.getCompanyName());
@ -960,12 +961,13 @@ public class PersonnelServiceImpl extends BaseService<PersonnelMapper, Personnel
@Override @Override
public AjaxResult handlingResignationEvents(String id) { public AjaxResult handlingResignationEvents(String id) {
Personnel personnel = getById(id); Personnel personnel = getById(id);
if (!"离职".equals(personnel.getWorkState())) { // if (!"离职".equals(personnel.getWorkState())) {
return AjaxResult.fail("该人员未办理离职变更,请先办理离职变更!"); // return AjaxResult.fail("该人员未办理离职变更,请先办理离职变更!");
} // }
if (BooleanUtil.isTrue(personnel.getWhetherIsQuit())) { if (BooleanUtil.isTrue(personnel.getWhetherIsQuit())) {
return AjaxResult.fail("请勿重复办理!"); return AjaxResult.fail("请勿重复办理!");
} }
personnel.setWorkState("离职");
personnel.setWhetherIsQuit(true); personnel.setWhetherIsQuit(true);
personnel.setPersonnelType("指标外"); personnel.setPersonnelType("指标外");
personnel.setResignationTime(LocalDate.now()); personnel.setResignationTime(LocalDate.now());