|
|
@@ -1,12 +1,19 @@
|
|
|
package org.jeecg.modules.api.dpresume.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import net.bytebuddy.asm.Advice;
|
|
|
import org.jeecg.common.util.CommUtil;
|
|
|
+import org.jeecg.common.util.StringUtils;
|
|
|
import org.jeecg.modules.api.dpresume.service.ResumeService;
|
|
|
+import org.jeecg.modules.hpposition.service.IPositionService;
|
|
|
import org.jeecg.modules.util.TokenUtil;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
|
+import java.net.URLEncoder;
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
@@ -16,6 +23,8 @@ import java.util.Map;
|
|
|
public class ResumeServiceImpl implements ResumeService {
|
|
|
@Value("${jeecg.c_port.path}")
|
|
|
private String path;
|
|
|
+ @Autowired
|
|
|
+ private IPositionService positionService;
|
|
|
|
|
|
/**
|
|
|
* 获取推荐简历
|
|
|
@@ -30,12 +39,88 @@ public class ResumeServiceImpl implements ResumeService {
|
|
|
String userToken = requestMap.get("user_token");
|
|
|
//验证用户合法性
|
|
|
if (TokenUtil.validateToken(userId, userToken)) {
|
|
|
- //搜索条件
|
|
|
- String pageNo = requestMap.get("pageNo");
|
|
|
- String pageSize = requestMap.get("pageSize");
|
|
|
- String searchKey = requestMap.get("search_key");
|
|
|
- //搜索简历接口路径(c端)
|
|
|
- String url = path + "/f/api/sendResume/recommendResume?searchKey=" + searchKey + "&pageNo=" + pageNo + "&pageSize=" + pageSize;
|
|
|
+ try {
|
|
|
+ //搜索条件
|
|
|
+ String pageNo = requestMap.get("pageNo");
|
|
|
+ String pageSize = requestMap.get("pageSize");
|
|
|
+ String searchKey = requestMap.get("search_key");
|
|
|
+ //搜索简历接口路径(c端)
|
|
|
+ if (StringUtils.isBlank(searchKey)) {
|
|
|
+ searchKey = "";
|
|
|
+ }
|
|
|
+ String url = path + "/f/api/sendResume/recommendResume?searchKey=" + URLEncoder.encode(searchKey, "utf-8") + "&pageNo=" + pageNo + "&pageSize=" + pageSize;
|
|
|
+ String data = CommUtil.get(url, null);
|
|
|
+ jsonObject = JSONObject.parseObject(data);
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ jsonObject.put("success", "1004");
|
|
|
+ }
|
|
|
+ return jsonObject;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 投递简历分页列表
|
|
|
+ *
|
|
|
+ * @param requestMap
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public JSONObject getApplyResume(Map<String, String> requestMap) {
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ String userId = requestMap.get("user_id");
|
|
|
+ String userToken = requestMap.get("user_token");
|
|
|
+ //验证用户合法性
|
|
|
+ if (TokenUtil.validateToken(userId, userToken)) {
|
|
|
+ try {
|
|
|
+ //搜索条件
|
|
|
+ String pageNo = requestMap.get("pageNo");
|
|
|
+ String pageSize = requestMap.get("pageSize");
|
|
|
+ String searchKey = requestMap.get("search_key");
|
|
|
+ //搜索简历接口路径(c端)
|
|
|
+ if (StringUtils.isBlank(searchKey)) {
|
|
|
+ searchKey = "";
|
|
|
+ }
|
|
|
+ //该公司所有职位
|
|
|
+ List<String> list = positionService.findListByUserId(userId);
|
|
|
+ StringBuilder stringBuilder = new StringBuilder();
|
|
|
+ String positionIds = "";
|
|
|
+ if (list != null && !list.isEmpty()) {
|
|
|
+ for (String str : list) {
|
|
|
+ stringBuilder.append(str + ",");
|
|
|
+ }
|
|
|
+ positionIds = stringBuilder.toString();
|
|
|
+ positionIds = positionIds.substring(0, positionIds.length() - 1);
|
|
|
+ }
|
|
|
+ String url = path + "/f/api/sendResume/applyResume?searchKey=" + URLEncoder.encode(searchKey, "utf-8") + "&pageNo=" + pageNo + "&pageSize="
|
|
|
+ + pageSize + "&positionIds=" + URLEncoder.encode(positionIds, "utf-8");
|
|
|
+ String data = CommUtil.get(url, null);
|
|
|
+ jsonObject = JSONObject.parseObject(data);
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ jsonObject.put("success", "1004");
|
|
|
+ }
|
|
|
+ return jsonObject;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 简历详情
|
|
|
+ *
|
|
|
+ * @param requestMap
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public JSONObject getResumeDetail(Map<String, String> requestMap) {
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ String userId = requestMap.get("user_id");
|
|
|
+ String userToken = requestMap.get("user_token");
|
|
|
+ //验证用户合法性
|
|
|
+ if (TokenUtil.validateToken(userId, userToken)) {
|
|
|
+ String resumeId = requestMap.get("resumeId");
|
|
|
+ String url = path + "/f/api/sendResume/resumeDetail?resumeId=" + resumeId;
|
|
|
String data = CommUtil.get(url, null);
|
|
|
jsonObject = JSONObject.parseObject(data);
|
|
|
} else {
|