|
@@ -12,6 +12,7 @@ import com.jpsoft.employment.modules.common.utils.JwtUtil;
|
|
import com.jpsoft.employment.modules.common.utils.PojoUtils;
|
|
import com.jpsoft.employment.modules.common.utils.PojoUtils;
|
|
import com.jpsoft.employment.modules.common.utils.SMSUtil;
|
|
import com.jpsoft.employment.modules.common.utils.SMSUtil;
|
|
import com.jpsoft.employment.modules.sys.service.DataDictionaryService;
|
|
import com.jpsoft.employment.modules.sys.service.DataDictionaryService;
|
|
|
|
+import com.sun.org.apache.xpath.internal.operations.Bool;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
@@ -26,6 +27,7 @@ import org.springframework.data.redis.core.ValueOperations;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
@@ -50,6 +52,12 @@ public class RecruitApiController {
|
|
private RecruitInformationInfoService recruitInformationInfoService;
|
|
private RecruitInformationInfoService recruitInformationInfoService;
|
|
@Autowired
|
|
@Autowired
|
|
private JobInformationInfoService jobInformationInfoService;
|
|
private JobInformationInfoService jobInformationInfoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private EnterpriseInfoService enterpriseInfoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ShareWorksInfoService shareWorksInfoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private RecruitPersonRelationService recruitPersonRelationService;
|
|
|
|
|
|
@PostMapping("findRecruitHomePage")
|
|
@PostMapping("findRecruitHomePage")
|
|
@ApiOperation(value = " 首页查询全部(公开接口)")
|
|
@ApiOperation(value = " 首页查询全部(公开接口)")
|
|
@@ -244,4 +252,215 @@ public class RecruitApiController {
|
|
|
|
|
|
return messageResult;
|
|
return messageResult;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value="createRecruit")
|
|
|
|
+ @RequestMapping(value = "发布招聘信息",method = RequestMethod.POST)
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "id", value = "ID(传为修改", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "positionName", value = "职位名称", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "salary", value = "薪资待遇", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "settlementMethod", value = "结算方式", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "industry", value = "行业", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "recruitingNumbers", value = "招聘人数", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "desc", value = "工作描述", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "contacts", value = "联系人", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "contactsPhone", value = "联系电话", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "workArea", value = "工作地区", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "address", value = "详细地址", required = false, paramType = "form"),
|
|
|
|
+ })
|
|
|
|
+ public MessageResult<Map> createRecruit(
|
|
|
|
+ @RequestParam(value="id",defaultValue="") String id,
|
|
|
|
+ @RequestParam(value="positionName",defaultValue="") String positionName,
|
|
|
|
+ @RequestParam(value="salary",defaultValue="") String salary,
|
|
|
|
+ @RequestParam(value="settlementMethod",defaultValue="") String settlementMethod,
|
|
|
|
+ @RequestParam(value="industry",defaultValue="") String industry,
|
|
|
|
+ @RequestParam(value="recruitingNumbers",defaultValue="") String recruitingNumbers,
|
|
|
|
+ @RequestParam(value="desc",defaultValue="") String desc,
|
|
|
|
+ @RequestParam(value="contacts",defaultValue="") String contacts,
|
|
|
|
+ @RequestParam(value="contactsPhone",defaultValue="") String contactsPhone,
|
|
|
|
+ @RequestParam(value="workArea",defaultValue="") String workArea,
|
|
|
|
+ @RequestParam(value="address",defaultValue="") String address,
|
|
|
|
+ @RequestAttribute String subject){
|
|
|
|
+
|
|
|
|
+ MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
+ try {
|
|
|
|
+
|
|
|
|
+ PersonInfo personInfo = personInfoService.get(subject);
|
|
|
|
+ if (personInfo == null) {
|
|
|
|
+ throw new Exception("未登录");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(StringUtils.isEmpty(personInfo.getEnterpriseId())){
|
|
|
|
+ throw new Exception("未绑定企业");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (StringUtils.isNotEmpty(id)) {
|
|
|
|
+ RecruitInformationInfo recruitInformationInfo = recruitInformationInfoService.get(id);
|
|
|
|
+ recruitInformationInfo.setUpdateBy(subject);
|
|
|
|
+ recruitInformationInfo.setUpdateTime(new Date());
|
|
|
|
+ recruitInformationInfo.setStatus("0");
|
|
|
|
+ recruitInformationInfo.setEnterpriseId(personInfo.getEnterpriseId());
|
|
|
|
+
|
|
|
|
+ recruitInformationInfo.setPositionName(positionName);
|
|
|
|
+ recruitInformationInfo.setSalary(salary);
|
|
|
|
+ recruitInformationInfo.setSettlementMethod(settlementMethod);
|
|
|
|
+ recruitInformationInfo.setIndustry(industry);
|
|
|
|
+ recruitInformationInfo.setRecruitingNumbers(recruitingNumbers);
|
|
|
|
+ recruitInformationInfo.setDesc(desc);
|
|
|
|
+ recruitInformationInfo.setContacts(contacts);
|
|
|
|
+ recruitInformationInfo.setContactsPhone(contactsPhone);
|
|
|
|
+ recruitInformationInfo.setWorkArea(workArea);
|
|
|
|
+ recruitInformationInfo.setAddress(address);
|
|
|
|
+
|
|
|
|
+ recruitInformationInfoService.update(recruitInformationInfo);
|
|
|
|
+ } else {
|
|
|
|
+ RecruitInformationInfo recruitInformationInfo = new RecruitInformationInfo();
|
|
|
|
+ recruitInformationInfo.setId(UUID.randomUUID().toString());
|
|
|
|
+ recruitInformationInfo.setDelFlag(false);
|
|
|
|
+ recruitInformationInfo.setCreateBy(subject);
|
|
|
|
+ recruitInformationInfo.setCreateTime(new Date());
|
|
|
|
+ recruitInformationInfo.setStatus("0");
|
|
|
|
+ recruitInformationInfo.setEnterpriseId(personInfo.getEnterpriseId());
|
|
|
|
+
|
|
|
|
+ recruitInformationInfo.setPositionName(positionName);
|
|
|
|
+ recruitInformationInfo.setSalary(salary);
|
|
|
|
+ recruitInformationInfo.setSettlementMethod(settlementMethod);
|
|
|
|
+ recruitInformationInfo.setIndustry(industry);
|
|
|
|
+ recruitInformationInfo.setRecruitingNumbers(recruitingNumbers);
|
|
|
|
+ recruitInformationInfo.setDesc(desc);
|
|
|
|
+ recruitInformationInfo.setContacts(contacts);
|
|
|
|
+ recruitInformationInfo.setContactsPhone(contactsPhone);
|
|
|
|
+ recruitInformationInfo.setWorkArea(workArea);
|
|
|
|
+ recruitInformationInfo.setAddress(address);
|
|
|
|
+
|
|
|
|
+ recruitInformationInfoService.insert(recruitInformationInfo);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ msgResult.setResult(true);
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ msgResult.setResult(false);
|
|
|
|
+ msgResult.setMessage(e.getMessage());
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return msgResult;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value="recruitDetail")
|
|
|
|
+ @RequestMapping(value = "招聘信息详细(免登陆",method = RequestMethod.POST)
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "recruitId", value = "招聘信息ID", required = false, paramType = "form"),
|
|
|
|
+ })
|
|
|
|
+ public MessageResult<Map> recruitDetail(
|
|
|
|
+ @RequestParam(value="recruitId",defaultValue="") String recruitId,
|
|
|
|
+ HttpServletRequest request){
|
|
|
|
+ MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
+ try {
|
|
|
|
+ String subject = (String)request.getAttribute("subject");
|
|
|
|
+
|
|
|
|
+ Boolean isJoin = false;
|
|
|
|
+
|
|
|
|
+ Map<String,Object> returnMap = new HashMap<>();
|
|
|
|
+ RecruitInformationInfo recruitInformationInfo = recruitInformationInfoService.get(recruitId);
|
|
|
|
+
|
|
|
|
+ int BrowseNumber = 0;
|
|
|
|
+ if(recruitInformationInfo.getBrowseNumber() != null){
|
|
|
|
+ BrowseNumber = recruitInformationInfo.getBrowseNumber();
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ recruitInformationInfo.setBrowseNumber(BrowseNumber++);
|
|
|
|
+ recruitInformationInfoService.update(recruitInformationInfo);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ EnterpriseInfo enterpriseInfo = null;
|
|
|
|
+ if(recruitInformationInfo.getEnterpriseId() != null) {
|
|
|
|
+ enterpriseInfo = enterpriseInfoService.get(recruitInformationInfo.getEnterpriseId());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ PersonInfo personInfo = personInfoService.get(subject);
|
|
|
|
+ if(personInfo != null){
|
|
|
|
+ RecruitPersonRelation recruitPersonRelation = recruitPersonRelationService.findByRecruitIdAndPersonId(recruitId,personInfo.getId());
|
|
|
|
+ if(recruitPersonRelation != null){
|
|
|
|
+ isJoin = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ returnMap.put("recruitInformationInfo",recruitInformationInfo);
|
|
|
|
+ returnMap.put("enterpriseInfo",enterpriseInfo);
|
|
|
|
+ returnMap.put("isJoin",isJoin);
|
|
|
|
+ msgResult.setResult(true);
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ msgResult.setResult(false);
|
|
|
|
+ msgResult.setMessage(e.getMessage());
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return msgResult;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value="发布共享用工信息")
|
|
|
|
+ @RequestMapping(value = "createShareWork",method = RequestMethod.POST)
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "id", value = "ID(传为修改", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "type", value = "信息类型", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "title", value = "标题", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "content", value = "内容", required = false, paramType = "form"),
|
|
|
|
+ })
|
|
|
|
+ public MessageResult<Map> createShareWork(
|
|
|
|
+ @RequestParam(value="id",defaultValue="") String id,
|
|
|
|
+ @RequestParam(value="type",defaultValue="") String type,
|
|
|
|
+ @RequestParam(value="title",defaultValue="") String title,
|
|
|
|
+ @RequestParam(value="content",defaultValue="") String content,
|
|
|
|
+ @RequestAttribute String subject){
|
|
|
|
+
|
|
|
|
+ MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
+ try {
|
|
|
|
+
|
|
|
|
+ PersonInfo personInfo = personInfoService.get(subject);
|
|
|
|
+ if (personInfo == null) {
|
|
|
|
+ throw new Exception("未登录");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(StringUtils.isEmpty(personInfo.getEnterpriseId())){
|
|
|
|
+ throw new Exception("未绑定企业");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (StringUtils.isNotEmpty(id)) {
|
|
|
|
+ ShareWorksInfo shareWorksInfo = shareWorksInfoService.get(id);
|
|
|
|
+ shareWorksInfo.setUpdateBy(subject);
|
|
|
|
+ shareWorksInfo.setUpdateTime(new Date());
|
|
|
|
+ shareWorksInfo.setStatus("0");
|
|
|
|
+
|
|
|
|
+ shareWorksInfo.setType(type);
|
|
|
|
+ shareWorksInfo.setTitle(title);
|
|
|
|
+ shareWorksInfo.setContent(content);
|
|
|
|
+ shareWorksInfo.setAuthor(personInfo.getRealName());
|
|
|
|
+
|
|
|
|
+ shareWorksInfoService.update(shareWorksInfo);
|
|
|
|
+ } else {
|
|
|
|
+ ShareWorksInfo shareWorksInfo = new ShareWorksInfo();
|
|
|
|
+ shareWorksInfo.setId(UUID.randomUUID().toString());
|
|
|
|
+ shareWorksInfo.setDelFlag(false);
|
|
|
|
+ shareWorksInfo.setCreateBy(subject);
|
|
|
|
+ shareWorksInfo.setCreateTime(new Date());
|
|
|
|
+ shareWorksInfo.setStatus("0");
|
|
|
|
+
|
|
|
|
+ shareWorksInfo.setType(type);
|
|
|
|
+ shareWorksInfo.setTitle(title);
|
|
|
|
+ shareWorksInfo.setContent(content);
|
|
|
|
+ shareWorksInfo.setAuthor(personInfo.getRealName());
|
|
|
|
+
|
|
|
|
+ shareWorksInfoService.update(shareWorksInfo);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ msgResult.setResult(true);
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ msgResult.setResult(false);
|
|
|
|
+ msgResult.setMessage(e.getMessage());
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return msgResult;
|
|
|
|
+ }
|
|
}
|
|
}
|