diff --git a/src/main/java/com/techlooper/controller/JobStatisticController.java b/src/main/java/com/techlooper/controller/JobStatisticController.java index 625b8d6b0..10c8a859b 100644 --- a/src/main/java/com/techlooper/controller/JobStatisticController.java +++ b/src/main/java/com/techlooper/controller/JobStatisticController.java @@ -1,22 +1,21 @@ package com.techlooper.controller; +import com.techlooper.entity.JobEntity; import com.techlooper.model.*; import com.techlooper.repository.JsonConfigRepository; +import com.techlooper.service.JobSearchService; import com.techlooper.service.JobStatisticService; +import org.apache.commons.lang3.StringUtils; import org.springframework.messaging.handler.annotation.MessageMapping; import org.springframework.messaging.handler.annotation.SendTo; import org.springframework.messaging.simp.SimpMessagingTemplate; import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; +import java.util.*; + +import static java.util.stream.Collectors.toList; @RestController public class JobStatisticController { @@ -33,6 +32,9 @@ public class JobStatisticController { @Resource private JobStatisticService jobStatisticService; + @Resource + private JobSearchService jobSearchService; + private final static List JOB_LEVEL_ALL = Collections.EMPTY_LIST; @Scheduled(cron = "${scheduled.cron}") @@ -91,4 +93,22 @@ public GetPromotedResponse getTopDemandedSkills(@RequestBody GetPromotedRequest return jobStatisticService.getTopDemandedSkillsByJobTitle(getPromotedRequest); } + @CrossOrigin + @RequestMapping(value = "/getPromotedWidget", method = RequestMethod.POST) + public GetPromotedResponse getTopDemandedSkillsWidget(@RequestBody GetPromotedRequest getPromotedRequest) { + setPriceJobConditionFromJobId(getPromotedRequest); + return jobStatisticService.getTopDemandedSkillsByJobTitle(getPromotedRequest); + } + + private void setPriceJobConditionFromJobId(GetPromotedRequest getPromotedRequest) { + if (StringUtils.isNotEmpty(getPromotedRequest.getTechlooperJobId())) { + JobEntity job = jobSearchService.findJobById(getPromotedRequest.getTechlooperJobId()); + if (job != null) { + getPromotedRequest.setJobTitle(job.getJobTitle()); + getPromotedRequest.setJobCategoryIds(job.getIndustries().stream().map(industry -> industry.getIndustryId()).collect(toList())); + getPromotedRequest.setJobLevelIds(Arrays.asList(job.getJobLevelId().intValue())); + } + } + } + } diff --git a/src/main/java/com/techlooper/entity/JobEntity.java b/src/main/java/com/techlooper/entity/JobEntity.java index 1d5521206..6c82b930b 100644 --- a/src/main/java/com/techlooper/entity/JobEntity.java +++ b/src/main/java/com/techlooper/entity/JobEntity.java @@ -50,6 +50,9 @@ public class JobEntity { @Field(type = Boolean) private Boolean isSalaryVisible; + @Field(type = Long) + private Long jobLevelId; + public String getId() { return id; } @@ -130,6 +133,14 @@ public void setIsSalaryVisible(Boolean isSalaryVisible) { this.isSalaryVisible = isSalaryVisible; } + public Long getJobLevelId() { + return jobLevelId; + } + + public void setJobLevelId(Long jobLevelId) { + this.jobLevelId = jobLevelId; + } + @Override public boolean equals(Object o) { if (this == o) return true; diff --git a/src/main/java/com/techlooper/model/GetPromotedRequest.java b/src/main/java/com/techlooper/model/GetPromotedRequest.java index 6ebed7f58..503416dc8 100644 --- a/src/main/java/com/techlooper/model/GetPromotedRequest.java +++ b/src/main/java/com/techlooper/model/GetPromotedRequest.java @@ -17,6 +17,8 @@ public class GetPromotedRequest { private String campaign; + private String techlooperJobId; + public String getJobTitle() { return jobTitle; } @@ -56,4 +58,12 @@ public String getCampaign() { public void setCampaign(String campaign) { this.campaign = campaign; } + + public String getTechlooperJobId() { + return techlooperJobId; + } + + public void setTechlooperJobId(String techlooperJobId) { + this.techlooperJobId = techlooperJobId; + } } diff --git a/src/main/java/com/techlooper/service/impl/SalaryReviewServiceImpl.java b/src/main/java/com/techlooper/service/impl/SalaryReviewServiceImpl.java index c18ec6d38..882019f12 100644 --- a/src/main/java/com/techlooper/service/impl/SalaryReviewServiceImpl.java +++ b/src/main/java/com/techlooper/service/impl/SalaryReviewServiceImpl.java @@ -43,7 +43,7 @@ public class SalaryReviewServiceImpl implements SalaryReviewService { private static final int TWO_PERCENTILES = 2; - private static final int LIMIT_NUMBER_OF_JOBS_FOR_SALARY_REVIEW = 1000; + private static final int LIMIT_NUMBER_OF_JOBS_FOR_SALARY_REVIEW = 300; private static final double[] percents = new double[]{10D, 25D, 50D, 75D, 90D}; @@ -147,9 +147,10 @@ public SalaryReviewResultDto reviewSalary(SalaryReviewDto salaryReviewDto) { jobRepository.addStrategy(searchByTitleStrategy); } + int originalNumberOfJobs = jobRepository.getJobs().size(); Set jobForReview = jobRepository.getJobs().stream().limit(LIMIT_NUMBER_OF_JOBS_FOR_SALARY_REVIEW).collect(toSet()); - SalaryReviewResultDto salaryReviewResult = generateSalaryReport(salaryReviewDto, jobForReview); + SalaryReviewResultDto salaryReviewResult = generateSalaryReport(salaryReviewDto, jobForReview, originalNumberOfJobs); return salaryReviewResult; } @@ -197,7 +198,7 @@ private String chooseTheBestJobTitle(List normalizedJobTitleCandidates) return null; } - private SalaryReviewResultDto generateSalaryReport(SalaryReviewDto salaryReviewDto, Set jobs) { + private SalaryReviewResultDto generateSalaryReport(SalaryReviewDto salaryReviewDto, Set jobs, int originalNumberOfJobs) { SalaryReport salaryReport = new SalaryReport(); salaryReport.setNetSalary(salaryReviewDto.getNetSalary()); @@ -222,7 +223,7 @@ private SalaryReviewResultDto generateSalaryReport(SalaryReviewDto salaryReviewD percentRank = calculatePercentPosition(salaryReport); } salaryReport.setPercentRank(Math.floor(percentRank)); - salaryReport.setNumberOfJobs(jobs.size()); + salaryReport.setNumberOfJobs(originalNumberOfJobs); SalaryReviewResultDto salaryReviewResult = dozerMapper.map(salaryReviewDto, SalaryReviewResultDto.class); salaryReviewResult.setSalaryReport(salaryReport); diff --git a/src/main/resources/template/CHALLENGE_CONFIRM_ON_JOIN_INTERNAL_CHALLENGE_EN.ftl b/src/main/resources/template/CHALLENGE_CONFIRM_ON_JOIN_INTERNAL_CHALLENGE_EN.ftl index 55d439655..7f533dcd1 100644 --- a/src/main/resources/template/CHALLENGE_CONFIRM_ON_JOIN_INTERNAL_CHALLENGE_EN.ftl +++ b/src/main/resources/template/CHALLENGE_CONFIRM_ON_JOIN_INTERNAL_CHALLENGE_EN.ftl @@ -236,7 +236,7 @@ <#if passCode??> - Password: + Passcode: ${passCode} @@ -338,7 +338,7 @@ - + diff --git a/src/main/resources/template/CHALLENGE_CONFIRM_ON_JOIN_INTERNAL_CHALLENGE_VI.ftl b/src/main/resources/template/CHALLENGE_CONFIRM_ON_JOIN_INTERNAL_CHALLENGE_VI.ftl index c1e63b620..5b1596f8a 100644 --- a/src/main/resources/template/CHALLENGE_CONFIRM_ON_JOIN_INTERNAL_CHALLENGE_VI.ftl +++ b/src/main/resources/template/CHALLENGE_CONFIRM_ON_JOIN_INTERNAL_CHALLENGE_VI.ftl @@ -236,7 +236,7 @@ <#if passCode??> - Mật Khẩu: + Mã xác nhận: ${passCode} @@ -338,7 +338,7 @@ - + diff --git a/src/main/webapp/assets/images/submission-form-vi.png b/src/main/webapp/assets/images/submission-form-vi.png deleted file mode 100644 index 3d2bddd36..000000000 Binary files a/src/main/webapp/assets/images/submission-form-vi.png and /dev/null differ diff --git a/src/main/webapp/assets/images/submission-internal-form-vi.png b/src/main/webapp/assets/images/submission-internal-form-vi.png new file mode 100644 index 000000000..b719c8411 Binary files /dev/null and b/src/main/webapp/assets/images/submission-internal-form-vi.png differ diff --git a/src/main/webapp/assets/images/submission-internal-form.png b/src/main/webapp/assets/images/submission-internal-form.png new file mode 100644 index 000000000..40f1d2a5e Binary files /dev/null and b/src/main/webapp/assets/images/submission-internal-form.png differ diff --git a/src/main/webapp/assets/modules/job-listing/job-listing.html b/src/main/webapp/assets/modules/job-listing/job-listing.html index 299d74990..3a3b6fca1 100644 --- a/src/main/webapp/assets/modules/job-listing/job-listing.html +++ b/src/main/webapp/assets/modules/job-listing/job-listing.html @@ -70,7 +70,7 @@

{{job.title}}

  • {{job.postedOn}}
  • -
  • {{job.locationText}}
  • +
  • {{job.locationText}}

: {{'negotiable' | translate}} @@ -114,7 +114,7 @@

{{job.

{{job.title}}

  • {{job.postedOn}}
  • -
  • {{job.locationText}}
  • +
  • {{job.locationText}}

: {{'negotiable' | translate}} diff --git a/src/main/webapp/assets/modules/translation/messages_en.json b/src/main/webapp/assets/modules/translation/messages_en.json index 654d26053..f7480e127 100644 --- a/src/main/webapp/assets/modules/translation/messages_en.json +++ b/src/main/webapp/assets/modules/translation/messages_en.json @@ -889,8 +889,8 @@ "enterYourEmail": "Enter your email", "signInInternalChallengeTitle": "First, Let Us Know Who You Are", "emailChallengeFormat": "Sign in using your registered email address and password for this challenge.", - "passCode": "Pass Code: *", - "enterYourPassCode": "Enter your pass code", + "passCode": "Passcode: *", + "enterYourPassCode": "Enter your passcode", "domainLabel": "Domains:", "invalidCredential": "Invalid credential", "invalidMinlengthDigits": "This field can not less than {{length}} digits", diff --git a/src/main/webapp/assets/modules/translation/messages_vi.json b/src/main/webapp/assets/modules/translation/messages_vi.json index f16443be8..dfb217894 100644 --- a/src/main/webapp/assets/modules/translation/messages_vi.json +++ b/src/main/webapp/assets/modules/translation/messages_vi.json @@ -896,5 +896,7 @@ "domainLabel": "Tên miền:", "invalidCredential": "Tài khoản không hợp lệ", "invalidMinlengthDigits": "Trường này không được nhỏ hơn 4 ký số", - "emailSentSuccessfully": "Email đã gửi thành công." + "emailSentSuccessfully": "Email đã gửi thành công.", + "passCode": "Mã xác nhận: *", + "enterYourPassCode": "Nhập mã xác nhận" }