update
This commit is contained in:
parent
b3fece6fc3
commit
765676b2fe
|
@ -301,11 +301,17 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
|
|||
CompanyName companyName = companyNameMapper.selectOne(new LambdaQueryWrapper<CompanyName>().eq(CompanyName::getId, organization.getCompanyId()));
|
||||
// 名额
|
||||
Long places = recruitmentMapper.selectOne(new MPJQueryWrapper<Recruitment>().select(" SUM(places) places ").eq("company_id", organization.getId())).getPlaces();
|
||||
Long quota = companyName.getResidualNumber() - places;
|
||||
// 剩余指标人数 = 剩余指标人数 - 名额
|
||||
if(quota < 0){
|
||||
return AjaxResult.fail().msg("招聘人数不能大于剩余人数!");
|
||||
}
|
||||
one.setAuditOrder(ArgsConst.LAST);
|
||||
one.setAuditState(ArgsConst.PASS);
|
||||
boolean update = updateById(one);
|
||||
if (update) {
|
||||
companyName.setResidualNumber(companyName.getCheckNumber() - places);
|
||||
// 剩余指标人数 = 原核定用工指标人数 - 名额
|
||||
companyName.setResidualNumber(quota);
|
||||
companyName.setThisApprovalNumber(organization.getThisApprovalNumber());
|
||||
companyNameMapper.updateById(companyName);
|
||||
organization.setAuditState(3);
|
||||
|
|
Loading…
Reference in New Issue