Commit c481aafd18089a61faf1e456fc9e5bfa1824bd4a

Authored by zhengjun@51feijin.com
1 parent 6f651de3

简历人才库后台管理

boot-nunu/src/main/java/com/softwarebr/nunu/entity/res/Talent.java
... ... @@ -20,7 +20,7 @@ import java.time.LocalDateTime;
20 20 @Data
21 21 @NoArgsConstructor
22 22 @AllArgsConstructor
23   -@Table(name="res_invite")
  23 +@Table(name="res_talent")
24 24 @Builder
25 25 public class Talent {
26 26  
... ...
boot-nunu/src/main/java/com/softwarebr/nunu/json/admin/res/TalentParam.java
... ... @@ -29,15 +29,12 @@ public class TalentParam {
29 29 private String birthDay;
30 30  
31 31 @ApiModelProperty(value = "期望工作省份", required = true, example = "")
32   - @NotNull(message = "请选择期望工作省份")
33 32 private Long provinceId;
34 33  
35 34 @ApiModelProperty(value = "期望工作城市", required = true, example = "")
36   - @NotNull(message = "请选择期望工作城市")
37 35 private Long cityId;
38 36  
39 37 @ApiModelProperty(value = "期望工作区县", required = true, example = "")
40   - @NotNull(message = "请选择期望工作区县")
41 38 private Long areaId;
42 39  
43 40 @ApiModelProperty(value = "擅长领域", required = true, example = "")
... ...
boot-nunu/src/main/java/com/softwarebr/nunu/json/admin/res/TalentQueryParam.java
... ... @@ -22,8 +22,14 @@ public class TalentQueryParam {
22 22 @ApiModelProperty(value = "账号", example = "")
23 23 private String account;
24 24  
  25 +
  26 + @ParamQuery(expression = QueryExpression.goe)
  27 + @ApiModelProperty(value = "发布者", hidden = true, example = "")
  28 + private Long publisher;
  29 +
  30 +
25 31 @ParamQuery
26   - @ApiModelProperty(value = "审核状态(1待审核 2审核通过 3审核不通过)", hidden = true, example = "")
  32 + @ApiModelProperty(value = "审核状态(1待审核 2审核通过 3审核不通过)", example = "")
27 33 private Integer verify;
28 34  
29 35 @ParamQuery
... ...
boot-nunu/src/main/java/com/softwarebr/nunu/json/admin/res/TalentResult.java
... ... @@ -22,10 +22,17 @@ public class TalentResult {
22 22 @ApiModelProperty(value = "序号", required = true, example = "1")
23 23 private Long id;
24 24  
  25 + @ApiModelProperty(value = "发布者", required = true, example = "")
  26 + @HideColumn()
  27 + private Long publisher;
  28 +
25 29 @ApiModelProperty(value = "账号", required = true, example = "")
  30 + private String account;
  31 +
  32 + @ApiModelProperty(value = "姓名", required = true, example = "")
26 33 private String name;
27 34  
28   - @ApiModelProperty(value = "招聘封面图", required = true, example = "")
  35 + @ApiModelProperty(value = "简历封面图", required = true, example = "")
29 36 private String coverUri;
30 37  
31 38 @ApiModelProperty(value = "擅长领域", required = true, example = "")
... ... @@ -35,6 +42,10 @@ public class TalentResult {
35 42 @ApiModelProperty(value = "时间", required = true, example = "2018-03-12 21:32:33")
36 43 private LocalDateTime createDate;
37 44  
  45 + @JSONField(format = "yyyy-MM-dd HH:mm:ss")
  46 + @ApiModelProperty(value = "审核时间", required = true, example = "2018-03-12 21:32:33")
  47 + private LocalDateTime verifyDate;
  48 +
38 49 @ApiModelProperty(value = "公开状态", required = true, example = "")
39 50 private String publicityTitle;
40 51  
... ... @@ -44,9 +55,6 @@ public class TalentResult {
44 55 @ApiModelProperty(value = "上架状态", required = true, example = "")
45 56 private String upperTitle;
46 57  
47   - @ApiModelProperty(value = "待处理数量", required = true, example = "")
48   - private Integer handleTotal;
49   -
50 58 @ApiModelProperty(value = "是否推荐至首页(0否 1是)", required = true, example = "")
51 59 @HideColumn(selectShow = false)
52 60 private Integer indexType;
... ...
boot-nunu/src/main/java/com/softwarebr/nunu/json/admin/res/VerifyParam.java
... ... @@ -19,7 +19,7 @@ public class VerifyParam {
19 19 @NotNull
20 20 private Long id;
21 21  
22   - @ApiModelProperty(value = "类型 1.项目资源2.招聘资源3.载体资源", required = true, example = "")
  22 + @ApiModelProperty(value = "类型 1.项目资源2.招聘资源3.载体资源4.人才库", required = true, example = "")
23 23 @NotNull
24 24 private Integer type;
25 25  
... ...
boot-nunu/src/main/java/com/softwarebr/nunu/service/res/TalentService.java
... ... @@ -12,7 +12,38 @@ import com.softwarebr.nunu.entity.res.Talent;
12 12  
13 13 public interface TalentService extends EntityService<Talent, Long, Object> {
14 14  
  15 + /**
  16 + * 保存
  17 + */
15 18 void saveTalent(Long publisher, TalentParamDTO talentParamDTO);
16 19  
  20 + /**
  21 + * 更新
  22 + */
17 23 void updateTalent(Long id, TalentParamDTO talentParamDTO);
  24 +
  25 + /**
  26 + * 上架
  27 + */
  28 + void talentUpperShelf(Long id);
  29 +
  30 + /**
  31 + * 下架
  32 + */
  33 + void talentLowerShelf(Long id);
  34 +
  35 + /**
  36 + * 推荐到首页
  37 + */
  38 + void talentIndexYes(Long id);
  39 +
  40 + /**
  41 + * 取消推荐到首页
  42 + */
  43 + void talentIndexNo(Long id);
  44 +
  45 + /**
  46 + * 审核
  47 + */
  48 + void talentVerify(Long id, Integer verify, String verifyRemark);
18 49 }
19 50 \ No newline at end of file
... ...
boot-nunu/src/main/java/com/softwarebr/nunu/service/res/impl/TalentServiceImpl.java
... ... @@ -3,26 +3,13 @@ package com.softwarebr.nunu.service.res.impl;
3 3 import com.brframework.common.utils.ConvertObjectUtil;
4 4 import com.brframework.commondb.core.AbstractEntityService;
5 5 import com.brframework.commondb.core.CommonRepository;
6   -import com.brframework.commondb.core.ControllerPageHandle;
7 6 import com.brframework.commonmq.annotation.MQConfig;
8   -import com.brframework.commonmq.core.MQClient;
9 7 import com.brframework.commonweb.exception.HandleException;
10   -import com.google.common.base.Splitter;
11   -import com.softwarebr.nunu.dao.res.InviteDao;
12 8 import com.softwarebr.nunu.dao.res.TalentDao;
13   -import com.softwarebr.nunu.dto.res.InviteParamDTO;
14 9 import com.softwarebr.nunu.dto.res.TalentParamDTO;
15   -import com.softwarebr.nunu.entity.res.Invite;
16   -import com.softwarebr.nunu.entity.res.PropertyApply;
17 10 import com.softwarebr.nunu.entity.res.Talent;
18   -import com.softwarebr.nunu.entity.user.Message;
19   -import com.softwarebr.nunu.globals.MQTopics;
20 11 import com.softwarebr.nunu.globals.SystemConst;
21   -import com.softwarebr.nunu.json.api.center.InviteDetailsResult;
22   -import com.softwarebr.nunu.service.res.InviteService;
23   -import com.softwarebr.nunu.service.res.PropertyApplyService;
24 12 import com.softwarebr.nunu.service.res.TalentService;
25   -import com.softwarebr.nunu.service.user.MessageService;
26 13 import lombok.extern.slf4j.Slf4j;
27 14 import org.springframework.beans.factory.annotation.Autowired;
28 15 import org.springframework.stereotype.Service;
... ... @@ -56,12 +43,14 @@ public class TalentServiceImpl extends AbstractEntityService&lt;Talent, Long, Objec
56 43 * 保存简历
57 44 */
58 45 @Override
  46 + @Transactional(rollbackFor = Exception.class)
59 47 public void saveTalent(Long publisher, TalentParamDTO talentParamDTO) {
60 48  
61 49 Talent talent = convertTo(talentParamDTO, Talent.class);
62 50 talent.setCreateDate(LocalDateTime.now());
63 51 talent.setIndexType(0);
64 52 talent.setMarker(1);
  53 + talent.setPublisher(publisher);
65 54 talent.setUpperStatus(0);
66 55 if (publisher > 0) {
67 56 talent.setVerify(SystemConst.VERIFY_AWAIT);
... ... @@ -73,10 +62,81 @@ public class TalentServiceImpl extends AbstractEntityService&lt;Talent, Long, Objec
73 62  
74 63 }
75 64  
  65 + /**
  66 + * 更新资源
  67 + */
76 68 @Override
  69 + @Transactional(rollbackFor = Exception.class)
77 70 public void updateTalent(Long id, TalentParamDTO talentParamDTO) {
78 71 Talent talent = accessObject(id);
79 72 talent = ConvertObjectUtil.convertJavaBean(talent, talentParamDTO, true);
80 73 talentDao.save(talent);
81 74 }
  75 +
  76 + /**
  77 + * 资源上架
  78 + */
  79 + @Override
  80 + @Transactional(rollbackFor = Exception.class)
  81 + public void talentUpperShelf(Long id) {
  82 + Talent talent = accessObject(id);
  83 + if (talent.getUpperStatus().equals(SystemConst.STATUS_UPPER_SHELF)) {
  84 + throw new HandleException("简历已上架,请勿重复操作");
  85 + }
  86 + talent.setUpperStatus(SystemConst.STATUS_UPPER_SHELF);
  87 + talentDao.save(talent);
  88 + }
  89 +
  90 + @Override
  91 + @Transactional(rollbackFor = Exception.class)
  92 + public void talentLowerShelf(Long id) {
  93 +
  94 + Talent talent = accessObject(id);
  95 + if (talent.getUpperStatus().equals(SystemConst.STATUS_LOWER_SHELF)) {
  96 + throw new HandleException("简历已下架,请勿重复操作");
  97 + }
  98 + talent.setUpperStatus(SystemConst.STATUS_LOWER_SHELF);
  99 + talentDao.save(talent);
  100 + }
  101 +
  102 + @Override
  103 + @Transactional(rollbackFor = Exception.class)
  104 + public void talentIndexYes(Long id) {
  105 +
  106 + Talent talent = accessObject(id);
  107 + if (talent.getIndexType().equals(SystemConst.INDEX_TYPE_YES)) {
  108 + throw new HandleException("简历已推荐至首页,请勿重复操作");
  109 + }
  110 + talent.setIndexType(SystemConst.INDEX_TYPE_YES);
  111 + talentDao.save(talent);
  112 + }
  113 +
  114 + @Override
  115 + @Transactional(rollbackFor = Exception.class)
  116 + public void talentIndexNo(Long id) {
  117 + Talent talent = accessObject(id);
  118 + if (talent.getIndexType().equals(SystemConst.INDEX_TYPE_NO)) {
  119 + throw new HandleException("简历已取消推荐至首页,请勿重复操作");
  120 + }
  121 + talent.setIndexType(SystemConst.INDEX_TYPE_NO);
  122 + talentDao.save(talent);
  123 + }
  124 +
  125 + /**
  126 + * 审核
  127 + */
  128 + @Override
  129 + public void talentVerify(Long id, Integer verify, String verifyRemark) {
  130 + Talent talent = accessObject(id);
  131 + talent.setVerifyDate(LocalDateTime.now());
  132 + talent.setVerify(verify);
  133 + if (verify.equals(SystemConst.VERIFY_REJECT)) {
  134 + talent.setVerifyRemark(verifyRemark);
  135 + }
  136 + save(talent);
  137 +// if (talent.getPublisher() > 0) {
  138 +// mqClient.publish(MQTopics.MEMBER_SEND_MESSAGE, messageService.sendMessageJSON(talent.getPublisher(), Message.MESSAGE_TYPE_VERIFY,
  139 +// "交易需求审核提醒", description, Message.MESSAGE_TARGET_TYPE_ONE_INVITE, talent.getId().toString()));
  140 +// }
  141 + }
82 142 }
83 143 \ No newline at end of file
... ...
boot-nunu/src/main/java/com/softwarebr/nunu/web/admin/AdminResController.java
... ... @@ -397,7 +397,7 @@ public class AdminResController {
397 397 @PostMapping("/v1/res/upper/{id}/{type}")
398 398 @AOLog
399 399 public JSONResult resUpperV1(@PathVariable Long id,
400   - @ApiParam("类型 1.项目资源2.招聘资源3.载体资源") @PathVariable int type) {
  400 + @ApiParam("类型 1.项目资源2.招聘资源3.载体资源4.人才库简历") @PathVariable int type) {
401 401 switch (type) {
402 402 case 1:
403 403 projectService.projectUpperShelf(id);
... ... @@ -408,6 +408,10 @@ public class AdminResController {
408 408 case 3:
409 409 propertyService.propertyUpperShelf(id);
410 410 break;
  411 + case 4:
  412 + talentService.talentUpperShelf(id);
  413 + break;
  414 +
411 415 }
412 416 return JSONResult.ok();
413 417 }
... ... @@ -417,7 +421,7 @@ public class AdminResController {
417 421 @PostMapping("/v1/res/lower/{id}/{type}")
418 422 @AOLog
419 423 public JSONResult resLowerV1(@PathVariable Long id,
420   - @ApiParam("类型 1.项目资源2.招聘资源3.载体资源") @PathVariable int type) {
  424 + @ApiParam("类型 1.项目资源2.招聘资源3.载体资源4.人才库简历") @PathVariable int type) {
421 425 switch (type) {
422 426 case 1:
423 427 projectService.projectLowerShelf(id);
... ... @@ -428,6 +432,9 @@ public class AdminResController {
428 432 case 3:
429 433 propertyService.propertyLowerShelf(id);
430 434 break;
  435 + case 4:
  436 + talentService.talentLowerShelf(id);
  437 + break;
431 438 }
432 439 return JSONResult.ok();
433 440 }
... ... @@ -437,7 +444,7 @@ public class AdminResController {
437 444 @PostMapping("/v1/res/index/yes/{id}/{type}")
438 445 @AOLog
439 446 public JSONResult resIndexYesV1(@PathVariable Long id,
440   - @ApiParam("类型 1.项目资源2.招聘资源3.载体资源") @PathVariable int type) {
  447 + @ApiParam("类型 1.项目资源2.招聘资源3.载体资源4.人才库简历") @PathVariable int type) {
441 448 switch (type) {
442 449 case 1:
443 450 projectService.projectIndexYes(id);
... ... @@ -448,6 +455,9 @@ public class AdminResController {
448 455 case 3:
449 456 propertyService.propertyIndexYes(id);
450 457 break;
  458 + case 4:
  459 + talentService.talentIndexYes(id);
  460 + break;
451 461 }
452 462 return JSONResult.ok();
453 463 }
... ... @@ -457,7 +467,7 @@ public class AdminResController {
457 467 @PostMapping("/v1/res/index/no/{id}/{type}")
458 468 @AOLog
459 469 public JSONResult resIndexNoV1(@PathVariable Long id,
460   - @ApiParam("类型 1.项目资源2.招聘资源3.载体资源") @PathVariable int type) {
  470 + @ApiParam("类型 1.项目资源2.招聘资源3.载体资源4.人才库简历") @PathVariable int type) {
461 471 switch (type) {
462 472 case 1:
463 473 projectService.projectIndexNo(id);
... ... @@ -468,6 +478,9 @@ public class AdminResController {
468 478 case 3:
469 479 propertyService.propertyIndexNo(id);
470 480 break;
  481 + case 4:
  482 + talentService.talentIndexNo(id);
  483 + break;
471 484 }
472 485 return JSONResult.ok();
473 486 }
... ... @@ -512,6 +525,9 @@ public class AdminResController {
512 525 case 3:
513 526 propertyService.propertyVerify(param.getId(), param.getVerify(), param.getVerifyRemark());
514 527 break;
  528 + case 4:
  529 + talentService.talentVerify(param.getId(), param.getVerify(), param.getVerifyRemark());
  530 + break;
515 531 }
516 532 return JSONResult.ok();
517 533 }
... ... @@ -663,6 +679,46 @@ public class AdminResController {
663 679 }
664 680  
665 681  
  682 + @ApiOperation(value = "人才库简历审核列表", notes = "人才库简历审核列表", produces = "text/plain")
  683 + @GetMapping("/v1/talent/verify/page")
  684 + @PreAuthorize("hasRole('res-project-verify-query')")
  685 + @PageLayout(
  686 + columnOptions = {
  687 + @CmsOption(name = "查看", uriMappingMethod = "getTalent"),
  688 + @CmsOption(name = "审核", uriMappingMethod = "resVerifyV1")
  689 + }
  690 + )
  691 + public JSONResult<Page<TalentResult>> talentVerifyListV1(PageParam pageParam, TalentQueryParam param) {
  692 + Page<TalentResult> page = jpaPageConvertToPage(talentService.page(pageParam, param), pageParam, TalentResult.class);
  693 + for (TalentResult inviteResult : page.getList()) {
  694 + if (inviteResult.getPublisher() > 0) {
  695 + inviteResult.setAccount(memberService.accessObject(inviteResult.getPublisher()).getPhone());
  696 + }
  697 + if (inviteResult.getPublisher() > 0) {
  698 + inviteResult.setAccount(memberService.accessObject(inviteResult.getPublisher()).getPhone());
  699 + } else {
  700 + inviteResult.setAccount("平台");
  701 + }
  702 + inviteResult.setVerifyTitle(SystemConst.verifyHandle(inviteResult.getVerify()));
  703 + }
  704 + return JSONResult.ok(page);
  705 + }
  706 +
  707 + @ApiOperation(value = "人才库简历审核状态数据统计", notes = "人才库简历审核状态数据统计", produces = "text/plain")
  708 + @PreAuthorize("hasRole('res-project-verify-query')")
  709 + @GetMapping("/v1/talent/verify/count")
  710 + public JSONResult<VerifyPageTotal> geTalentVerifyCount(TalentQueryParam param) {
  711 + VerifyPageTotal verifyPageResult = new VerifyPageTotal();
  712 + verifyPageResult.setTotalCount(talentService.count(param));
  713 + param.setVerify(SystemConst.VERIFY_AWAIT);
  714 + verifyPageResult.setVerifyAwaitCount(talentService.count(param));
  715 + param.setVerify(SystemConst.VERIFY_ADOPT);
  716 + verifyPageResult.setVerifyAdoptCount(talentService.count(param));
  717 + param.setVerify(SystemConst.VERIFY_REJECT);
  718 + verifyPageResult.setVerifyRejectCount(talentService.count(param));
  719 + return JSONResult.ok(verifyPageResult);
  720 + }
  721 +
666 722  
667 723  
668 724  
... ... @@ -671,7 +727,7 @@ public class AdminResController {
671 727 @PreAuthorize("hasRole('res-project-query')")
672 728 @PageLayout(
673 729 options = {
674   - @CmsOption(name = "发布简历", uriMappingMethod = "inviteCreateV1")
  730 + @CmsOption(name = "发布简历", uriMappingMethod = "talentCreateV1")
675 731 },
676 732 columnOptions = {
677 733 @CmsOption(name = "查看", uriMappingMethod = "getTalent"),
... ... @@ -683,22 +739,18 @@ public class AdminResController {
683 739 @CmsOption(name = "删除", uriMappingMethod = "talentDelV1", alert = "确定删除该记录吗?")
684 740 }
685 741 )
686   - public JSONResult<Page<InviteResult>> talentListV1(PageParam pageParam, TalentQueryParam param) {
  742 + public JSONResult<Page<TalentResult>> talentListV1(PageParam pageParam, TalentQueryParam param) {
687 743 talentQueryHandle(param);
688   - Page<InviteResult> page = jpaPageConvertToPage(talentService.page(pageParam, param), pageParam, InviteResult.class);
689   - for (InviteResult inviteResult : page.getList()) {
690   - if (inviteResult.getPublisher() > 0) {
691   - inviteResult.setAccount(memberService.accessObject(inviteResult.getPublisher()).getPhone());
  744 + Page<TalentResult> page = jpaPageConvertToPage(talentService.page(pageParam, param), pageParam, TalentResult.class);
  745 + for (TalentResult talentResult : page.getList()) {
  746 + if (talentResult.getPublisher() > 0) {
  747 + talentResult.setAccount(memberService.accessObject(talentResult.getPublisher()).getPhone());
692 748 } else {
693   - inviteResult.setAccount("平台");
  749 + talentResult.setAccount("平台");
694 750 }
695   - inviteResult.setAddress(areaService.addressSplicing(inviteResult.getProvinceId(), inviteResult.getCityId(), inviteResult.getAreaId()));
696   - inviteResult.setVerifyTitle(SystemConst.verifyHandle(inviteResult.getVerify()));
697   - inviteResult.setUpperTitle(SystemConst.statusUpperHandle(inviteResult.getUpperStatus()));
698   - inviteResult.setPublicityTitle(SystemConst.publicityHandle(inviteResult.getPublicity()));
699   - inviteResult.setStartEndDate(String.format("%s - %s", inviteResult.getStartDate(), inviteResult.getEndDate()));
700   - inviteResult.setHandleTotal(inviteResult.getPublicity().equals(SystemConst.PUBLICITY_PUBLIC) ? 0 :
701   - propertyApplyService.countByVerifyStatus(PropertyApply.RESOURCE_TYPE_INVITE, inviteResult.getId()).intValue());
  751 + talentResult.setVerifyTitle(SystemConst.verifyHandle(talentResult.getVerify()));
  752 + talentResult.setUpperTitle(SystemConst.statusUpperHandle(talentResult.getUpperStatus()));
  753 + talentResult.setPublicityTitle(SystemConst.publicityHandle(talentResult.getPublicity()));
702 754 }
703 755 return JSONResult.ok(page);
704 756 }
... ... @@ -720,8 +772,7 @@ public class AdminResController {
720 772 @PutMapping("/v1/talent/add")
721 773 @PreAuthorize("hasRole('res-project-create-v1')")
722 774 @AOLog
723   - @EditLayout
724   - public JSONResult talentCreateV1(@Valid @RequestBody TalentParam param) {
  775 + public JSONResult talentCreateV1(@RequestBody TalentParam param) {
725 776 TalentParamDTO talentParamDTO = convertTo(param, TalentParamDTO.class);
726 777 talentService.saveTalent(-1L, talentParamDTO);
727 778 return JSONResult.ok();
... ...