EnterpriseController.java 10 KB

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