Commit 524542009d25721e1bcdc8f3d21e4686fb7fcd4a

Authored by zhengjun@51feijin.com
1 parent c481aafd

Pc人才库

boot-nunu/src/main/java/com/softwarebr/nunu/json/admin/res/TalentResult.java
... ... @@ -71,4 +71,16 @@ public class TalentResult {
71 71 @HideColumn(selectShow = false)
72 72 private Integer publicity;
73 73  
  74 + @ApiModelProperty(value = "地址", required = true, example = "")
  75 + private String address;
  76 +
  77 + @ApiModelProperty(value = "省份", required = true, example = "")
  78 + private Long provinceId;
  79 +
  80 + @ApiModelProperty(value = "城市", required = true, example = "")
  81 + private Long cityId;
  82 +
  83 + @ApiModelProperty(value = "区县", required = true, example = "")
  84 + private Long areaId;
  85 +
74 86 }
75 87 \ No newline at end of file
... ...
boot-nunu/src/main/java/com/softwarebr/nunu/json/api/center/ResTalentQueryParam.java 0 → 100644
... ... @@ -0,0 +1,47 @@
  1 +package com.softwarebr.nunu.json.api.center;
  2 +
  3 +import com.brframework.commondb.annotation.param.ParamQuery;
  4 +import com.brframework.commondb.annotation.param.QueryExpression;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import lombok.Data;
  8 +
  9 +/**
  10 + * @author lilin
  11 + * @date 2020/2/26 10:26
  12 + * @description:
  13 + */
  14 +@Data
  15 +@ApiModel
  16 +public class ResTalentQueryParam {
  17 +
  18 + @ParamQuery
  19 + @ApiModelProperty(value = "省份", example = "")
  20 + private Long provinceId;
  21 +
  22 + @ParamQuery
  23 + @ApiModelProperty(value = "城市", example = "")
  24 + private Long cityId;
  25 +
  26 + @ParamQuery
  27 + @ApiModelProperty(value = "区县", example = "")
  28 + private Long areaId;
  29 +
  30 +
  31 + @ParamQuery(expression = QueryExpression.like)
  32 + @ApiModelProperty(value = "擅长领域", example = "")
  33 + private String expertise;
  34 +
  35 + @ParamQuery
  36 + @ApiModelProperty(value = "发布者", hidden = true, example = "")
  37 + private Long publisher;
  38 +
  39 + @ParamQuery
  40 + @ApiModelProperty(value = "删除标记0.已删除 1.未删除", hidden = true, example = "")
  41 + private Integer marker;
  42 +
  43 + @ParamQuery
  44 + @ApiModelProperty(value = "是否上架(0下架 1上架) ", hidden = true, example = "")
  45 + private Integer upperStatus;
  46 +
  47 +}
... ...
boot-nunu/src/main/java/com/softwarebr/nunu/json/api/center/TalentQueryParam.java 0 → 100644
... ... @@ -0,0 +1,28 @@
  1 +package com.softwarebr.nunu.json.api.center;
  2 +
  3 +import com.brframework.commondb.annotation.param.ParamQuery;
  4 +import io.swagger.annotations.ApiModel;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.Data;
  7 +
  8 +/**
  9 + * @author lilin
  10 + * @date 2020/2/26 10:26
  11 + * @description:
  12 + */
  13 +@Data
  14 +@ApiModel
  15 +public class TalentQueryParam {
  16 +
  17 + @ParamQuery
  18 + @ApiModelProperty(value = "审核状态(1待审核 2审核通过 3审核不通过)", example = "")
  19 + private Integer verify;
  20 +
  21 + @ParamQuery
  22 + @ApiModelProperty(value = "发布者", hidden = true, example = "")
  23 + private Long publisher;
  24 +
  25 + @ParamQuery
  26 + @ApiModelProperty(value = "删除标记0.已删除 1.未删除", hidden = true, example = "")
  27 + private Integer marker;
  28 +}
... ...
boot-nunu/src/main/java/com/softwarebr/nunu/service/res/TalentService.java
... ... @@ -15,12 +15,12 @@ public interface TalentService extends EntityService<Talent, Long, Object> {
15 15 /**
16 16 * 保存
17 17 */
18   - void saveTalent(Long publisher, TalentParamDTO talentParamDTO);
  18 + Talent saveTalent(Long publisher, TalentParamDTO talentParamDTO);
19 19  
20 20 /**
21 21 * 更新
22 22 */
23   - void updateTalent(Long id, TalentParamDTO talentParamDTO);
  23 + Talent updateTalent(Long id, TalentParamDTO talentParamDTO);
24 24  
25 25 /**
26 26 * 上架
... ...
boot-nunu/src/main/java/com/softwarebr/nunu/service/res/impl/TalentServiceImpl.java
... ... @@ -44,7 +44,7 @@ public class TalentServiceImpl extends AbstractEntityService<Talent, Long, Objec
44 44 */
45 45 @Override
46 46 @Transactional(rollbackFor = Exception.class)
47   - public void saveTalent(Long publisher, TalentParamDTO talentParamDTO) {
  47 + public Talent saveTalent(Long publisher, TalentParamDTO talentParamDTO) {
48 48  
49 49 Talent talent = convertTo(talentParamDTO, Talent.class);
50 50 talent.setCreateDate(LocalDateTime.now());
... ... @@ -59,6 +59,7 @@ public class TalentServiceImpl extends AbstractEntityService<Talent, Long, Objec
59 59 talent.setVerify(SystemConst.VERIFY_ADOPT);
60 60 }
61 61 talentDao.save(talent);
  62 + return talent;
62 63  
63 64 }
64 65  
... ... @@ -67,10 +68,10 @@ public class TalentServiceImpl extends AbstractEntityService<Talent, Long, Objec
67 68 */
68 69 @Override
69 70 @Transactional(rollbackFor = Exception.class)
70   - public void updateTalent(Long id, TalentParamDTO talentParamDTO) {
  71 + public Talent updateTalent(Long id, TalentParamDTO talentParamDTO) {
71 72 Talent talent = accessObject(id);
72 73 talent = ConvertObjectUtil.convertJavaBean(talent, talentParamDTO, true);
73   - talentDao.save(talent);
  74 + return talentDao.save(talent);
74 75 }
75 76  
76 77 /**
... ...
boot-nunu/src/main/java/com/softwarebr/nunu/web/api/ApiResController.java
... ... @@ -2,29 +2,29 @@ package com.softwarebr.nunu.web.api;
2 2  
3 3 import com.alibaba.fastjson.JSON;
4 4 import com.alibaba.fastjson.JSONArray;
  5 +import com.brframework.commoncms.annatotion.layout.EditAlertLayout;
5 6 import com.brframework.commondb.core.ControllerPageHandle;
6 7 import com.brframework.commonsecurity.core.SecurityContextHolder;
7 8 import com.brframework.commonweb.json.JSONResult;
8 9 import com.brframework.commonweb.json.Page;
9 10 import com.brframework.commonweb.json.PageParam;
  11 +import com.brframework.commonwebadmin.aop.annotation.AOLog;
10 12 import com.softwarebr.nunu.domain.HotDemand;
11 13 import com.softwarebr.nunu.domain.InviteJob;
12 14 import com.softwarebr.nunu.dto.res.InviteParamDTO;
13 15 import com.softwarebr.nunu.dto.res.ProjectParamDTO;
14 16 import com.softwarebr.nunu.dto.res.PropertyParamDTO;
15   -import com.softwarebr.nunu.entity.res.Invite;
16   -import com.softwarebr.nunu.entity.res.Project;
17   -import com.softwarebr.nunu.entity.res.Property;
18   -import com.softwarebr.nunu.entity.res.PropertyApply;
  17 +import com.softwarebr.nunu.dto.res.TalentParamDTO;
  18 +import com.softwarebr.nunu.entity.res.*;
19 19 import com.softwarebr.nunu.globals.SystemConst;
  20 +import com.softwarebr.nunu.json.admin.res.TalentDetailsResult;
  21 +import com.softwarebr.nunu.json.admin.res.TalentParam;
  22 +import com.softwarebr.nunu.json.admin.res.TalentResult;
20 23 import com.softwarebr.nunu.json.api.VerifyResult;
21 24 import com.softwarebr.nunu.json.api.center.*;
22 25 import com.softwarebr.nunu.service.SearchService;
23 26 import com.softwarebr.nunu.service.oper.AreaService;
24   -import com.softwarebr.nunu.service.res.InviteService;
25   -import com.softwarebr.nunu.service.res.ProjectService;
26   -import com.softwarebr.nunu.service.res.PropertyApplyService;
27   -import com.softwarebr.nunu.service.res.PropertyService;
  27 +import com.softwarebr.nunu.service.res.*;
28 28 import com.softwarebr.nunu.service.user.MemberService;
29 29 import com.softwarebr.nunu.util.AmountConversionUtil;
30 30 import io.swagger.annotations.Api;
... ... @@ -32,6 +32,7 @@ import io.swagger.annotations.ApiOperation;
32 32 import io.swagger.annotations.ApiParam;
33 33 import org.apache.commons.lang3.StringUtils;
34 34 import org.springframework.beans.factory.annotation.Autowired;
  35 +import org.springframework.security.access.prepost.PreAuthorize;
35 36 import org.springframework.web.bind.annotation.*;
36 37  
37 38 import javax.validation.Valid;
... ... @@ -40,6 +41,7 @@ import java.util.List;
40 41 import java.util.Map;
41 42  
42 43 import static com.brframework.commondb.core.ControllerPageHandle.convertTo;
  44 +import static com.brframework.commondb.core.ControllerPageHandle.jpaPageConvertToPage;
43 45  
44 46 /**
45 47 * @author lilin
... ... @@ -72,6 +74,9 @@ public class ApiResController {
72 74 @Autowired
73 75 private SearchService searchService;
74 76  
  77 + @Autowired
  78 + private TalentService talentService;
  79 +
75 80 @ApiOperation(value = "我的项目需求列表")
76 81 @GetMapping("access/v1/center/request/project/page")
77 82 public JSONResult<Page<ApiProjectResult>> requestProjectPageV1(PageParam page, ApiProjectQueryParam param) {
... ... @@ -117,6 +122,20 @@ public class ApiResController {
117 122 return JSONResult.ok(propertyResultPage);
118 123 }
119 124  
  125 + @ApiOperation(value = "我的人才库简历列表")
  126 + @GetMapping("access/v1/center/request/talent/page")
  127 + public JSONResult<Page<TalentResult>> requestTalentPageV1(PageParam page, TalentQueryParam param) {
  128 + param.setMarker(SystemConst.MARKER_STATUS_NO);
  129 + param.setPublisher(Long.valueOf(SecurityContextHolder.getSubject().getId()));
  130 + Page<TalentResult> talentResultPage = ControllerPageHandle.jpaPageConvertToPage(talentService.page(page, param), page, TalentResult.class);
  131 + for (TalentResult talentResult : talentResultPage.getList()) {
  132 + talentResult.setVerifyTitle(SystemConst.verifyHandle(talentResult.getVerify()));
  133 + talentResult.setUpperTitle(SystemConst.statusUpperHandle(talentResult.getUpperStatus()));
  134 + talentResult.setPublicityTitle(SystemConst.publicityHandle(talentResult.getPublicity()));
  135 + }
  136 + return JSONResult.ok(talentResultPage);
  137 + }
  138 +
120 139 @ApiOperation(value = "修改项目需求对接状态")
121 140 @PostMapping("access/v1/center/request/project/{projectId}")
122 141 public JSONResult requestProjectUpdateV1(@PathVariable Long projectId, @Valid @RequestBody ProjectStatusParam param) {
... ... @@ -309,7 +328,7 @@ public class ApiResController {
309 328 return JSONResult.ok(propertyResult);
310 329 }
311 330  
312   - @ApiOperation(value = "招聘资源审核结果")
  331 + @ApiOperation(value = "载体资源审核结果")
313 332 @GetMapping("access/v1/center/request/property/result/{id}")
314 333 public JSONResult<VerifyResult> propertyVerifyV1(@ApiParam("载体资源id") @PathVariable Long id) {
315 334 VerifyResult verifyResult = ControllerPageHandle.convertTo(propertyService.accessObject(id), VerifyResult.class);
... ... @@ -332,4 +351,61 @@ public class ApiResController {
332 351 return JSONResult.ok(inviteResultPage);
333 352 }
334 353  
  354 + @ApiOperation(value = "人才库资源列表")
  355 + @GetMapping("access/v1/center/request/res/talent/page")
  356 + public JSONResult<Page<TalentResult>> talentPageV1(PageParam page, ResTalentQueryParam param) {
  357 + param.setMarker(SystemConst.MARKER_STATUS_NO);
  358 + param.setUpperStatus(SystemConst.STATUS_UPPER_SHELF);
  359 + if (StringUtils.isNotEmpty(param.getExpertise())) {
  360 + searchService.increasingScore(param.getExpertise());
  361 + }
  362 + Page<TalentResult> talentResultPage = ControllerPageHandle.jpaPageConvertToPage(talentService.page(page, param), page, TalentResult.class);
  363 + for (TalentResult talentResult : talentResultPage.getList()) {
  364 + talentResult.setAddress(areaService.addressSplicing(talentResult.getProvinceId(), talentResult.getCityId(), talentResult.getAreaId()));
  365 + }
  366 + return JSONResult.ok(talentResultPage);
  367 + }
  368 +
  369 + @ApiOperation(value = "查看人才简历信息", notes = "查看简历信息", produces = "text/plain")
  370 + @GetMapping("access/v1/center/request/talent/details/{id}")
  371 + public JSONResult<TalentDetailsResult> getTalent(@ApiParam("简历Id")@PathVariable Long id) {
  372 + Talent talent = talentService.accessObject(id);
  373 + TalentDetailsResult talentDetailsResult = convertTo(talent, TalentDetailsResult.class);
  374 + talentDetailsResult.setArea(areaService.accessObject(talent.getAreaId()).getCityName());
  375 + talentDetailsResult.setCity(areaService.accessObject(talent.getCityId()).getCityName());
  376 + talentDetailsResult.setProvince(areaService.accessObject(talent.getProvinceId()).getCityName());
  377 +
  378 + return JSONResult.ok(talentDetailsResult);
  379 + }
  380 +
  381 +
  382 + @ApiOperation(value = "需求发布-人才库简历")
  383 + @PutMapping("access/v1/center/request/talent")
  384 + public JSONResult<TalentResult> talentCreateV1(@Valid @RequestBody TalentParam param) {
  385 + Long memberId = Long.valueOf(SecurityContextHolder.getSubject().getId());
  386 +
  387 + TalentParamDTO talentParamDTO = convertTo(param, TalentParamDTO.class);
  388 + Talent talent = talentService.saveTalent(memberId, talentParamDTO);
  389 + TalentResult talentResult = ControllerPageHandle.convertTo(talent, TalentResult.class);
  390 + return JSONResult.ok(talentResult);
  391 + }
  392 +
  393 +
  394 + @ApiOperation(value = "修改需求发布-人才库简历")
  395 + @PutMapping("access/v1/center/request/talentEditV1/{id}")
  396 + public JSONResult<TalentResult> talentEditV1(@PathVariable Long id, @Valid @RequestBody TalentParam param) {
  397 + Long memberId = Long.valueOf(SecurityContextHolder.getSubject().getId());
  398 +
  399 + TalentParamDTO talentParamDTO = convertTo(param, TalentParamDTO.class);
  400 + TalentResult talentResult = ControllerPageHandle.convertTo(talentService.updateTalent(id, talentParamDTO), TalentResult.class);
  401 + return JSONResult.ok(talentResult);
  402 + }
  403 +
  404 + @ApiOperation(value = "人才库简历资源审核结果")
  405 + @GetMapping("access/v1/center/request/talent/result/{id}")
  406 + public JSONResult<VerifyResult> talentVerifyV1(@ApiParam("简历Id") @PathVariable Long id) {
  407 + VerifyResult verifyResult = ControllerPageHandle.convertTo(talentService.accessObject(id), VerifyResult.class);
  408 + return JSONResult.ok(verifyResult);
  409 + }
  410 +
335 411 }
336 412 \ No newline at end of file
... ...