This commit is contained in:
zhuyy 2023-10-27 10:32:28 +08:00
parent 9b3884c634
commit 916306b165
5 changed files with 16 additions and 9 deletions

View File

@ -49,8 +49,9 @@ public class OrganizationController extends BaseController {
@GetMapping(value = "/approval") @GetMapping(value = "/approval")
@ApiOperation(value = "招聘单号") @ApiOperation(value = "招聘单号")
public AjaxResult approval() { @ApiImplicitParams({@ApiImplicitParam(value = "企业id", name = "id", required = true)})
return organizationService.approval(); public AjaxResult approval(@RequestParam("id") String id) {
return organizationService.approval(id);
} }
@GetMapping("/submitRecruitment") @GetMapping("/submitRecruitment")

View File

@ -18,9 +18,11 @@ public class Places extends BaseEntity {
private String organizationId; private String organizationId;
@ApiModelProperty(value = "单号") @ApiModelProperty(value = "单号")
private String odd; private String odd;
@ApiModelProperty(value = "状态")
@ApiModelProperty(value = "状态")
private Boolean status; private Boolean status;
@ApiModelProperty(value = "人数")
private Long sum;
} }

View File

@ -23,6 +23,6 @@ public interface IOrganizationService {
AjaxResult submitRecruitment(String id, String type); AjaxResult submitRecruitment(String id, String type);
AjaxResult approval(); AjaxResult approval(String id);
} }

View File

@ -311,15 +311,16 @@ public class AuditServiceImpl extends BaseService<AuditMapper, Audit> implements
organization.setLastInstance(auditRequest.getAuditOpinion()); organization.setLastInstance(auditRequest.getAuditOpinion());
organizationMapper.updateById(organization); organizationMapper.updateById(organization);
} }
List<Recruitment> recruitments = recruitmentMapper.selectList(Wrappers.lambdaQuery(Recruitment.class).eq(Recruitment::getCompanyId, organization.getId()));
long sum = recruitments.stream().mapToLong(Recruitment::getPlaces).sum();
// 生成单号 // 生成单号
Places places = new Places(); Places places = new Places();
places.setStatus(Boolean.FALSE); places.setStatus(Boolean.FALSE);
places.setSum(sum);
places.setCompanyId(organization.getCompanyId()); places.setCompanyId(organization.getCompanyId());
places.setOrganizationId(organization.getId()); places.setOrganizationId(organization.getId());
places.setOdd(DateUtil.format(DateUtil.date(), "yyyyMMddHHmmss" + getNextId())); places.setOdd(DateUtil.format(DateUtil.date(), "yyyyMMddHHmmss" + getNextId()));
placesMapper.insert(places); placesMapper.insert(places);
// List<Recruitment> recruitments = recruitmentMapper.selectList(Wrappers.lambdaQuery(Recruitment.class).eq(Recruitment::getCompanyId, organization.getId()));
// List<Long> list = recruitments.stream().map(Recruitment::getPlaces).collect(Collectors.toList());
// for (Long aLong : list) { // for (Long aLong : list) {
// for (int i = 0; i < aLong.intValue(); i++) { // for (int i = 0; i < aLong.intValue(); i++) {
// Places places = new Places(); // Places places = new Places();

View File

@ -161,8 +161,11 @@ public class OrganizationServiceImpl extends BaseService<OrganizationMapper, Org
@Override @Override
public AjaxResult approval() { public AjaxResult approval(String id) {
List<Places> places = placesMapper.selectList(Wrappers.lambdaQuery(Places.class).eq(Places::getStatus, Boolean.FALSE).orderByAsc(Places::getOdd)); List<Places> places = placesMapper.selectList(Wrappers.lambdaQuery(Places.class)
.eq(Places::getCompanyId, id)
.eq(Places::getStatus, Boolean.FALSE)
.orderByAsc(Places::getOdd));
return AjaxResult.ok().data(BeanUtil.copyToList(places, PlacesDto.class)); return AjaxResult.ok().data(BeanUtil.copyToList(places, PlacesDto.class));
} }
} }