EnterpriseController.java 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. package com.wechat.controller;
  2. import com.wechat.global.message.InfoMsg;
  3. import com.wechat.model.requestDto.*;
  4. import com.wechat.model.responseDto.AlreadyPublishResp;
  5. import com.wechat.model.responseDto.ContactUserInfoResp;
  6. import com.wechat.model.responseDto.ResultEntity;
  7. import com.wechat.service.CommonService;
  8. import com.wechat.service.EnterpriseService;
  9. import com.wechat.service.MdeJobAdvertisedService;
  10. import org.springframework.beans.factory.annotation.Autowired;
  11. import org.springframework.stereotype.Controller;
  12. import org.springframework.web.bind.annotation.RequestBody;
  13. import org.springframework.web.bind.annotation.RequestMapping;
  14. import org.springframework.web.bind.annotation.RequestMethod;
  15. import org.springframework.web.bind.annotation.ResponseBody;
  16. import javax.annotation.Resource;
  17. import javax.servlet.http.HttpServletRequest;
  18. import javax.servlet.http.HttpServletResponse;
  19. import javax.validation.Valid;
  20. import java.io.IOException;
  21. import java.util.Map;
  22. /**
  23. * 企业查看简历
  24. *
  25. * @author zhouyd
  26. */
  27. @Controller
  28. @RequestMapping(value = "enterprise")
  29. public class EnterpriseController {
  30. @Autowired
  31. private EnterpriseService enterpriseService;
  32. @Autowired
  33. private CommonService commonService;
  34. @Resource
  35. private MdeJobAdvertisedService jobAdvertisedService;
  36. /**
  37. * 企业点击收到的简历
  38. *
  39. * @return
  40. * @throws Exception
  41. */
  42. /* @RequestMapping(value = "receive", method = RequestMethod.POST)
  43. @ResponseBody
  44. public ResultEntity<Map<String, Object>> receiveUserCv(HttpServletRequest req, HttpServletResponse resp,
  45. @RequestBody Page page) throws Exception {
  46. Map<String, Object> maps = enterpriseService.receiveUserCv(req, page);
  47. return new ResultEntity<>(InfoMsg.SUCCESS_REQUEST, maps);
  48. }*/
  49. /**
  50. * 查看简历
  51. *
  52. * @param userCode
  53. * @return
  54. */
  55. @RequestMapping(value = "lookUserCv", method = RequestMethod.POST)
  56. @ResponseBody
  57. public ResultEntity<ContactUserInfoResp> lookUserCv(@RequestBody Map<String, String> param, HttpServletRequest req) {
  58. String lang = commonService.getLanguage(req);
  59. String hotelCode = commonService.getUserCode(req);
  60. ContactUserInfoResp contactUserInfoResp = enterpriseService.lookUserCv(hotelCode, param, lang);
  61. return new ResultEntity<>(InfoMsg.SUCCESS_REQUEST, contactUserInfoResp);
  62. }
  63. /**
  64. * 更新职位发布状态
  65. *
  66. * @param req
  67. * @param resp
  68. * @param params
  69. * @return
  70. * @throws Exception
  71. */
  72. @RequestMapping(value = "updateJobAdvertisedStatus", method = RequestMethod.POST)
  73. @ResponseBody
  74. public ResultEntity<String> updateJobAdvertisedStatus(HttpServletRequest req, HttpServletResponse resp,
  75. @RequestBody Map<String, String> params) throws Exception {
  76. return enterpriseService.updateJobAdvertisedStatus(req, params);
  77. }
  78. /**
  79. * 更新职位首推状态
  80. *
  81. * @param req
  82. * @param resp
  83. * @param params
  84. * @return
  85. */
  86. @RequestMapping(value = "updateJobRecommend", method = RequestMethod.POST)
  87. @ResponseBody
  88. public ResultEntity<String> updateJobRecommend(HttpServletRequest req, HttpServletResponse resp,
  89. @RequestBody Map<String, String> params) {
  90. return enterpriseService.updateJobRecommend(req, params);
  91. }
  92. /**
  93. * 下载简历
  94. *
  95. * @param req
  96. * @param resp
  97. * @return
  98. * @throws IOException
  99. * @throws Exception
  100. */
  101. @RequestMapping(value = "download", method = RequestMethod.POST)
  102. @ResponseBody
  103. public ResultEntity<String> downloadUserCv(HttpServletRequest req, HttpServletResponse resp,
  104. @RequestBody Map<String, Object> param) {
  105. String infoMsg = enterpriseService.downloadUserCv(req, resp, param);
  106. return new ResultEntity<>(InfoMsg.SUCCESS_REQUEST, infoMsg);
  107. }
  108. /**
  109. * 切换简历类型 根据类型判断 ( 0-新投递;1-已查看;2-已下载;3-邀请面试;4-录取;5-淘汰;6-储备)
  110. *
  111. * @param req
  112. * @param resp
  113. * @return
  114. * @throws Exception
  115. */
  116. @RequestMapping(value = "getUserCvStateListInfo", method = RequestMethod.POST)
  117. @ResponseBody
  118. public ResultEntity<Map<String, Object>> getUserCvStateListInfo(HttpServletRequest req,
  119. @Valid @RequestBody UserCvStatusReq param) {
  120. Map<String, Object> maps = enterpriseService.getUserCvStateListInfo2(req, param, "0");
  121. return new ResultEntity<>(InfoMsg.SUCCESS_REQUEST, maps);
  122. }
  123. /**
  124. * PC端专用
  125. * 切换简历类型 根据类型判断 ( 0-新投递;1-已查看;2-已下载;3-邀请面试;4-录取;5-淘汰;6-储备)
  126. *
  127. * @param req
  128. * @param resp
  129. * @return
  130. * @throws Exception
  131. */
  132. @RequestMapping(value = "getUserCvStateListInfoPc", method = RequestMethod.POST)
  133. @ResponseBody
  134. public ResultEntity<Map<String, Object>> getUserCvStateListInfoPc(HttpServletRequest req,
  135. @Valid @RequestBody UserCvStatusReq param) {
  136. Map<String, Object> maps = enterpriseService.getUserCvStateListInfo2(req, param, "1");
  137. return new ResultEntity<>(InfoMsg.SUCCESS_REQUEST, maps);
  138. }
  139. /**
  140. * PC端专用
  141. * 按职位显示投递列表
  142. *
  143. * @param req
  144. * @param resp
  145. * @return
  146. * @throws Exception
  147. */
  148. @RequestMapping(value = "getUserCvListInfoByJobPc", method = RequestMethod.POST)
  149. @ResponseBody
  150. public ResultEntity<Map<String, Object>> getUserCvListInfoByJobPc(HttpServletRequest req,
  151. @RequestBody UserCvByJobReq param) {
  152. Map<String, Object> maps = enterpriseService.getUserCvStateListInfoByJob(req, param, "1");
  153. return new ResultEntity<>(InfoMsg.SUCCESS_REQUEST, maps);
  154. }
  155. /**
  156. * 邀请面试/录用/淘汰 更新简历状态 type ( 0-新投递;1-已查看;2-已下载;3-邀请面试;4-录取;5-淘汰;6-储备)
  157. *
  158. * @param req
  159. * @param resp
  160. * @return
  161. * @throws Exception
  162. */
  163. @RequestMapping(value = "updateUserCvStatus", method = RequestMethod.POST)
  164. @ResponseBody
  165. public ResultEntity<String> updateUserCvStatus(HttpServletRequest req, @RequestBody UpdUserCvReq param)
  166. throws Exception {
  167. InfoMsg infoMsg = enterpriseService.updateUserCvStatus(req, param, new InterviewCreateReq());
  168. return new ResultEntity<>(infoMsg);
  169. }
  170. /**
  171. * 已发布信息
  172. *
  173. * @param req
  174. * @param resp
  175. * @return
  176. */
  177. @RequestMapping(value = "alreadyPublish", method = RequestMethod.POST)
  178. @ResponseBody
  179. public ResultEntity<AlreadyPublishResp> alreadyPublish(@RequestBody JobAdvertisedReqDto jobReq,
  180. HttpServletRequest req, HttpServletResponse resp) {
  181. String userCode = commonService.getUserCode(req);
  182. AlreadyPublishResp response = new AlreadyPublishResp();
  183. // 获取已发布职位信息
  184. response.setList(enterpriseService.alreadyPublish(req, resp, userCode, jobReq));
  185. // 获取首推数据
  186. response.setRecommendNum(jobAdvertisedService.getAvailableAndUsedCount(userCode));
  187. return new ResultEntity<>(InfoMsg.SUCCESS_REQUEST, response);
  188. }
  189. /**
  190. * @param req
  191. * @param resp
  192. * @param keyWordReq 关键词
  193. * @return ResultEntity<AlreadyPublishResp>
  194. * @description 已发职位关键词检索
  195. * @author rayson
  196. * @date 2023-09-12 14:41
  197. **/
  198. @RequestMapping(value = "searchKeyWord", method = RequestMethod.POST)
  199. @ResponseBody
  200. public ResultEntity<AlreadyPublishResp> searchPersonAbility(HttpServletRequest req,
  201. HttpServletResponse resp, @RequestBody KeyWordReq keyWordReq) {
  202. String userCode = commonService.getUserCode(req);
  203. AlreadyPublishResp response = new AlreadyPublishResp();
  204. // 检索已发职位
  205. response.setList(enterpriseService.searchKeyWord(keyWordReq, userCode, req));
  206. // 获取首推数据
  207. response.setRecommendNum(jobAdvertisedService.getAvailableAndUsedCount(userCode));
  208. return new ResultEntity<>(InfoMsg.SUCCESS_REQUEST, response);
  209. }
  210. }