|
@@ -1,9 +1,7 @@
|
|
|
package com.jpsoft.employment.modules.base.api;
|
|
package com.jpsoft.employment.modules.base.api;
|
|
|
|
|
|
|
|
import com.github.pagehelper.Page;
|
|
import com.github.pagehelper.Page;
|
|
|
-import com.jpsoft.employment.modules.base.entity.FeedbackMethod;
|
|
|
|
|
-import com.jpsoft.employment.modules.base.entity.LoveProject;
|
|
|
|
|
-import com.jpsoft.employment.modules.base.entity.ParticipateProjectInfo;
|
|
|
|
|
|
|
+import com.jpsoft.employment.modules.base.entity.*;
|
|
|
import com.jpsoft.employment.modules.base.service.*;
|
|
import com.jpsoft.employment.modules.base.service.*;
|
|
|
import com.jpsoft.employment.modules.common.dto.MessageResult;
|
|
import com.jpsoft.employment.modules.common.dto.MessageResult;
|
|
|
import com.jpsoft.employment.modules.common.dto.Sort;
|
|
import com.jpsoft.employment.modules.common.dto.Sort;
|
|
@@ -17,6 +15,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
@@ -37,6 +36,12 @@ public class ParticipateApi {
|
|
|
private ParticipateProjectInfoService participateProjectInfoService;
|
|
private ParticipateProjectInfoService participateProjectInfoService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private FeedbackMethodService feedbackMethodService;
|
|
private FeedbackMethodService feedbackMethodService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private RegUserService regUserService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private NewsInfoService newsInfoService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private NewsRegUserService newsRegUserService;
|
|
|
|
|
|
|
|
@ApiOperation(value="详情")
|
|
@ApiOperation(value="详情")
|
|
|
@RequestMapping(value = "edit",method = RequestMethod.POST)
|
|
@RequestMapping(value = "edit",method = RequestMethod.POST)
|
|
@@ -66,6 +71,7 @@ public class ParticipateApi {
|
|
|
|
|
|
|
|
@ApiOperation(value="保存")
|
|
@ApiOperation(value="保存")
|
|
|
@RequestMapping(value = "save",method = RequestMethod.POST)
|
|
@RequestMapping(value = "save",method = RequestMethod.POST)
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name="loveProjectId", value="loveProjectId", required=true, paramType="query"),
|
|
@ApiImplicitParam(name="loveProjectId", value="loveProjectId", required=true, paramType="query"),
|
|
|
@ApiImplicitParam(name="feedbackId", value="feedbackId", required=true, paramType="query"),
|
|
@ApiImplicitParam(name="feedbackId", value="feedbackId", required=true, paramType="query"),
|
|
@@ -98,9 +104,30 @@ public class ParticipateApi {
|
|
|
participateProjectInfo.setContacts(contacts);
|
|
participateProjectInfo.setContacts(contacts);
|
|
|
participateProjectInfo.setContactsCompany(contactsCompany);
|
|
participateProjectInfo.setContactsCompany(contactsCompany);
|
|
|
participateProjectInfo.setDelFlag(false);
|
|
participateProjectInfo.setDelFlag(false);
|
|
|
|
|
+
|
|
|
participateProjectInfo.setCreateBy(subject);
|
|
participateProjectInfo.setCreateBy(subject);
|
|
|
participateProjectInfo.setCreateTime(new Date());
|
|
participateProjectInfo.setCreateTime(new Date());
|
|
|
participateProjectInfoService.insert(participateProjectInfo);
|
|
participateProjectInfoService.insert(participateProjectInfo);
|
|
|
|
|
+
|
|
|
|
|
+ NewsInfo newsInfo = new NewsInfo();
|
|
|
|
|
+ newsInfo.setId(UUID.randomUUID().toString());
|
|
|
|
|
+ newsInfo.setTitle(String.format("{0}参与了{1}项目",regUserService.get(subject).getRealName(),loveProjectService.get(loveProjectId).getTitle()));
|
|
|
|
|
+ newsInfo.setType("0");
|
|
|
|
|
+ newsInfo.setIsTop(false);
|
|
|
|
|
+ newsInfo.setContent(String.format("{0}参与了{1}项目",regUserService.get(subject).getRealName(),loveProjectService.get(loveProjectId).getTitle()));
|
|
|
|
|
+ newsInfo.setDelFlag(false);
|
|
|
|
|
+ newsInfo.setCreateBy(subject);
|
|
|
|
|
+ newsInfo.setCreateTime(new Date());
|
|
|
|
|
+ newsInfoService.insert(newsInfo);
|
|
|
|
|
+
|
|
|
|
|
+ NewsRegUser newsRegUser = new NewsRegUser();
|
|
|
|
|
+ newsRegUser.setId(UUID.randomUUID().toString());
|
|
|
|
|
+ newsRegUser.setRegUserId(subject);
|
|
|
|
|
+ newsRegUser.setNewsId(newsInfo.getId());
|
|
|
|
|
+ newsRegUser.setDelFlag(false);
|
|
|
|
|
+ newsRegUser.setCreateBy(subject);
|
|
|
|
|
+ newsRegUser.setCreateTime(new Date());
|
|
|
|
|
+ newsRegUserService.insert(newsRegUser);
|
|
|
}
|
|
}
|
|
|
msgResult.setResult(true);
|
|
msgResult.setResult(true);
|
|
|
msgResult.setData(participateProjectInfo);
|
|
msgResult.setData(participateProjectInfo);
|