|
@@ -72,6 +72,9 @@ public class ResumeDeliverServiceImpl extends ServiceImpl<ResumeDeliverMapper, R
|
|
if (position == null || position.getState() != 0 || position.getAudit() != 1) {
|
|
if (position == null || position.getState() != 0 || position.getAudit() != 1) {
|
|
return AjaxResult.error("该职位不存在或已下架");
|
|
return AjaxResult.error("该职位不存在或已下架");
|
|
}
|
|
}
|
|
|
|
+ if (position.getUserId().equals(AppUtil.getUser().getId())) {
|
|
|
|
+ return AjaxResult.error("不能自己报名自己");
|
|
|
|
+ }
|
|
ResumeDeliver resumeDeliver = resumeDeliverMapper.check(position.getId(), AppUtil.getUser().getId());
|
|
ResumeDeliver resumeDeliver = resumeDeliverMapper.check(position.getId(), AppUtil.getUser().getId());
|
|
if (resumeDeliver != null) {
|
|
if (resumeDeliver != null) {
|
|
return AjaxResult.error("请勿重复投递简历");
|
|
return AjaxResult.error("请勿重复投递简历");
|
|
@@ -81,7 +84,6 @@ public class ResumeDeliverServiceImpl extends ServiceImpl<ResumeDeliverMapper, R
|
|
resumeDeliver.setType(position.getType());
|
|
resumeDeliver.setType(position.getType());
|
|
resumeDeliver.setPositionId(position.getId());
|
|
resumeDeliver.setPositionId(position.getId());
|
|
resumeDeliver.setEnterpriseId(position.getUserId());
|
|
resumeDeliver.setEnterpriseId(position.getUserId());
|
|
- resumeDeliver.setOpenId(AppUtil.getUser().getOpenId());
|
|
|
|
if (!save(resumeDeliver)) {
|
|
if (!save(resumeDeliver)) {
|
|
throw new ServiceException("投递简历失败");
|
|
throw new ServiceException("投递简历失败");
|
|
}
|
|
}
|
|
@@ -207,13 +209,14 @@ public class ResumeDeliverServiceImpl extends ServiceImpl<ResumeDeliverMapper, R
|
|
public void sendMessage(ResumeDeliver resumeDeliver) throws ParseException {
|
|
public void sendMessage(ResumeDeliver resumeDeliver) throws ParseException {
|
|
JSONObject jsonObject = JSONUtil.parseObj(HttpUtil.get("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + env.getProperty("wx.appid") + "&secret=" + env.getProperty("wx.appSecret")));
|
|
JSONObject jsonObject = JSONUtil.parseObj(HttpUtil.get("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + env.getProperty("wx.appid") + "&secret=" + env.getProperty("wx.appSecret")));
|
|
JSONObject body = new JSONObject();
|
|
JSONObject body = new JSONObject();
|
|
- body.set("touser", resumeDeliver.getOpenId());
|
|
|
|
body.set("appid", env.getProperty("wx.appid"));
|
|
body.set("appid", env.getProperty("wx.appid"));
|
|
JSONObject content = new JSONObject();
|
|
JSONObject content = new JSONObject();
|
|
//面试邀请通知
|
|
//面试邀请通知
|
|
if (resumeDeliver.getState() == 1 && resumeDeliver.getIsAccept() == 0 && resumeDeliver.getType() == 0) {
|
|
if (resumeDeliver.getState() == 1 && resumeDeliver.getIsAccept() == 0 && resumeDeliver.getType() == 0) {
|
|
Position position = positionService.getById(resumeDeliver.getPositionId());
|
|
Position position = positionService.getById(resumeDeliver.getPositionId());
|
|
Enterprise enterprise = enterpriseService.getById(position.getUserId());
|
|
Enterprise enterprise = enterpriseService.getById(position.getUserId());
|
|
|
|
+ User user = userService.getById(resumeDeliver.getUserId());
|
|
|
|
+ body.set("touser", user.getOpenId());
|
|
body.set("template_id", "ll-qdaEgbDN4rEod0nJpsjUuSqHT9e12EniZfRPiNqM");
|
|
body.set("template_id", "ll-qdaEgbDN4rEod0nJpsjUuSqHT9e12EniZfRPiNqM");
|
|
body.set("page", "pages/user/resume/deliver/invite");
|
|
body.set("page", "pages/user/resume/deliver/invite");
|
|
content.set("thing5", new JSONObject().set("value", enterprise.getName()));//公司名称
|
|
content.set("thing5", new JSONObject().set("value", enterprise.getName()));//公司名称
|
|
@@ -221,33 +224,42 @@ public class ResumeDeliverServiceImpl extends ServiceImpl<ResumeDeliverMapper, R
|
|
content.set("time3", new JSONObject().set("value", DateUtils.formatDate(resumeDeliver.getInviteTime())));//面试时间
|
|
content.set("time3", new JSONObject().set("value", DateUtils.formatDate(resumeDeliver.getInviteTime())));//面试时间
|
|
content.set("thing4", new JSONObject().set("value", StringUtils.truncateString(position.getAddress(), 15))); //面试地点
|
|
content.set("thing4", new JSONObject().set("value", StringUtils.truncateString(position.getAddress(), 15))); //面试地点
|
|
}
|
|
}
|
|
- //兼职报名审核结果通知
|
|
|
|
- if (resumeDeliver.getState() == 1 && resumeDeliver.getIsAccept() == 0 && resumeDeliver.getType() == 1) {
|
|
|
|
- Position position = positionService.getById(resumeDeliver.getPositionId());
|
|
|
|
- body.set("template_id", "yhFtY-hzXerPnIxXcYcRCLpbkuNrzn5yk-rWgHVX2Aw");
|
|
|
|
- body.set("page", "pages/user/resume/application/invite");
|
|
|
|
- content.set("thing1", new JSONObject().set("value", position.getTitle()));//兼职名称
|
|
|
|
- content.set("phrase5", new JSONObject().set("value", "通过"));//状态
|
|
|
|
- }
|
|
|
|
- //兼职报名审核结果通知
|
|
|
|
|
|
+ //接单成功提醒
|
|
if (resumeDeliver.getState() == 1 && resumeDeliver.getIsAccept() == 1 && resumeDeliver.getType() == 1) {
|
|
if (resumeDeliver.getState() == 1 && resumeDeliver.getIsAccept() == 1 && resumeDeliver.getType() == 1) {
|
|
Position position = positionService.getById(resumeDeliver.getPositionId());
|
|
Position position = positionService.getById(resumeDeliver.getPositionId());
|
|
|
|
+ User user = userService.getById(resumeDeliver.getUserId());
|
|
|
|
+ body.set("touser", user.getOpenId());
|
|
body.set("template_id", "bxOGj5FbyGHSevmWf9yzwpSZDjlFZPnGBeqGgIj9w_o");
|
|
body.set("template_id", "bxOGj5FbyGHSevmWf9yzwpSZDjlFZPnGBeqGgIj9w_o");
|
|
body.set("page", "pages/user/resume/application/invite");
|
|
body.set("page", "pages/user/resume/application/invite");
|
|
content.set("thing4", new JSONObject().set("value", position.getTitle()));//兼职名称
|
|
content.set("thing4", new JSONObject().set("value", position.getTitle()));//兼职名称
|
|
content.set("thing6", new JSONObject().set("value", "对方已同意接单,请留意工作进度"));//备注
|
|
content.set("thing6", new JSONObject().set("value", "对方已同意接单,请留意工作进度"));//备注
|
|
}
|
|
}
|
|
- //兼职报名审核结果通知
|
|
|
|
|
|
+ //接单失败提醒
|
|
if (resumeDeliver.getState() == 1 && resumeDeliver.getIsAccept() == 2 && resumeDeliver.getType() == 1) {
|
|
if (resumeDeliver.getState() == 1 && resumeDeliver.getIsAccept() == 2 && resumeDeliver.getType() == 1) {
|
|
Position position = positionService.getById(resumeDeliver.getPositionId());
|
|
Position position = positionService.getById(resumeDeliver.getPositionId());
|
|
|
|
+ User user = userService.getById(resumeDeliver.getEnterpriseId());
|
|
|
|
+ body.set("touser", user.getOpenId());
|
|
body.set("template_id", "pyUsW2HqOcXmFETHFUDjuH-ekf05QVc29k0tRaY9wP8");
|
|
body.set("template_id", "pyUsW2HqOcXmFETHFUDjuH-ekf05QVc29k0tRaY9wP8");
|
|
body.set("page", "pages/user/resume/application/invite");
|
|
body.set("page", "pages/user/resume/application/invite");
|
|
content.set("thing3", new JSONObject().set("value", position.getTitle()));//兼职名称
|
|
content.set("thing3", new JSONObject().set("value", position.getTitle()));//兼职名称
|
|
content.set("thing5", new JSONObject().set("value", "对方拒绝接单,请重新选择接单人员"));//备注
|
|
content.set("thing5", new JSONObject().set("value", "对方拒绝接单,请重新选择接单人员"));//备注
|
|
}
|
|
}
|
|
|
|
+ //兼职报名审核结果通知
|
|
|
|
+ if (resumeDeliver.getState() == 1 && resumeDeliver.getIsAccept() == 0 && resumeDeliver.getType() == 1) {
|
|
|
|
+ Position position = positionService.getById(resumeDeliver.getPositionId());
|
|
|
|
+ User user = userService.getById(resumeDeliver.getUserId());
|
|
|
|
+ body.set("touser", user.getOpenId());
|
|
|
|
+ body.set("template_id", "yhFtY-hzXerPnIxXcYcRCAjQUf8CdLoYEQQi5nBgim0");
|
|
|
|
+ body.set("page", "pages/user/resume/application/invite");
|
|
|
|
+ content.set("thing1", new JSONObject().set("value", position.getTitle()));//兼职名称
|
|
|
|
+ content.set("amount4", new JSONObject().set("value", position.getSalary() + "元"));//工作报酬
|
|
|
|
+ content.set("phrase5", new JSONObject().set("value", "通过"));//状态
|
|
|
|
+ }
|
|
//兼职薪资到账通知
|
|
//兼职薪资到账通知
|
|
- if (resumeDeliver.getState() == 1 && resumeDeliver.getIsAccept() == 2 && resumeDeliver.getType() == 1 && resumeDeliver.getIsComplete() == 2) {
|
|
|
|
|
|
+ if (resumeDeliver.getState() == 1 && resumeDeliver.getIsAccept() == 1 && resumeDeliver.getType() == 1 && resumeDeliver.getIsComplete() == 2) {
|
|
Position position = positionService.getById(resumeDeliver.getPositionId());
|
|
Position position = positionService.getById(resumeDeliver.getPositionId());
|
|
|
|
+ User user = userService.getById(resumeDeliver.getUserId());
|
|
|
|
+ body.set("touser", user.getOpenId());
|
|
body.set("template_id", "87jYTnpeZJnvdQ6gHcscZ96eQYlSXpfGeFU3g9deTeA");
|
|
body.set("template_id", "87jYTnpeZJnvdQ6gHcscZ96eQYlSXpfGeFU3g9deTeA");
|
|
body.set("page", "pages/user/money/index");
|
|
body.set("page", "pages/user/money/index");
|
|
content.set("thing1", new JSONObject().set("value", position.getTitle()));//兼职名称
|
|
content.set("thing1", new JSONObject().set("value", position.getTitle()));//兼职名称
|