|
|
@@ -2,14 +2,18 @@ package com.goafanti.achievement.controller;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.Valid;
|
|
|
+import javax.xml.soap.Detail;
|
|
|
|
|
|
+import org.apache.ibatis.annotations.ResultMap;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
@@ -25,15 +29,21 @@ import com.goafanti.common.constant.AFTConstants;
|
|
|
import com.goafanti.common.constant.ErrorConstants;
|
|
|
import com.goafanti.common.constant.PageConstants;
|
|
|
import com.goafanti.common.controller.CertifyApiController;
|
|
|
+import com.goafanti.common.dao.AchievementKeywordMapper;
|
|
|
+import com.goafanti.common.dao.AchievementPublishMapper;
|
|
|
import com.goafanti.common.enums.AchievementAuditStatus;
|
|
|
import com.goafanti.common.enums.AchievementFields;
|
|
|
import com.goafanti.common.enums.AchievementOrderStatus;
|
|
|
import com.goafanti.common.enums.AttachmentType;
|
|
|
+import com.goafanti.common.enums.DemandAuditStatus;
|
|
|
import com.goafanti.common.model.Achievement;
|
|
|
import com.goafanti.common.model.AchievementOrder;
|
|
|
import com.goafanti.common.model.AftFile;
|
|
|
+import com.goafanti.common.model.Demand;
|
|
|
import com.goafanti.common.utils.StringUtils;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
+import com.goafanti.portal.bo.AchievementObject;
|
|
|
+import com.goafanti.portal.bo.AchievementResultObject;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping(value = "/api/user/achievement")
|
|
|
@@ -44,7 +54,10 @@ public class UserAchievementApiController extends CertifyApiController {
|
|
|
private AftFileService aftFileService;
|
|
|
@Resource
|
|
|
private AchievementOrderService achievementOrderService;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private AchievementKeywordMapper achievementKeywordMapper;
|
|
|
+ @Autowired
|
|
|
+ private AchievementPublishMapper achievementPublishMapper;
|
|
|
/**
|
|
|
* 成果需求匹配列表
|
|
|
*/
|
|
|
@@ -147,6 +160,23 @@ public class UserAchievementApiController extends CertifyApiController {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+ @RequestMapping(value = "/achievementDetail",method=RequestMethod.GET)
|
|
|
+ private Result Detail(String id) {
|
|
|
+ Result result=new Result();
|
|
|
+ if (StringUtils.isBlank(id)) {
|
|
|
+ result.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "成果ID"));
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ AchievementResultObject achievementObjects=achievementService.getAchievementDetailById(id);
|
|
|
+ List<String>keywords=achievementKeywordMapper.getKeywordsByAchievementId(id);
|
|
|
+ List<String> publishPages=achievementPublishMapper.getPublishPagesById(id);
|
|
|
+ achievementObjects.setKeywords(keywords);
|
|
|
+ achievementObjects.setPublishPages(publishPages);
|
|
|
+ result.setData(achievementObjects);
|
|
|
+// AchievementResultObject achievementResultObject=new AchievementResultObject()
|
|
|
+ return result;
|
|
|
+ }
|
|
|
/**
|
|
|
* 个人成果详情详情
|
|
|
*/
|
|
|
@@ -190,7 +220,7 @@ public class UserAchievementApiController extends CertifyApiController {
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isBlank(ia.getId())) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "成果ID"));
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -221,7 +251,63 @@ public class UserAchievementApiController extends CertifyApiController {
|
|
|
res.setData(achievementService.updateAchievement(a, keywords, null,webPages,appPages));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 刷新发布时间
|
|
|
+ * @param id
|
|
|
+ * @param auditStatus
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/refreshPublish", method = RequestMethod.POST)
|
|
|
+ public Result refreshPublish(String id,Integer auditStatus){
|
|
|
+ Result res = new Result();
|
|
|
+ if (StringUtils.isBlank(id)) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "成果ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if (null == auditStatus) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "成果状态错误", "成果状态"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if (AchievementAuditStatus.AUDITED.getCode() != auditStatus) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "当前状态无法刷新发布,"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ Achievement a = new Achievement();
|
|
|
+ a.setId(id);
|
|
|
+ a.setReleaseDate(new Date());
|
|
|
+// a.setAuditStatus(auditStatus);
|
|
|
+ achievementService.updateByPrimaryKeySelective(a);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 提交审核
|
|
|
+ * @param id
|
|
|
+ * @param auditStatus
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/commit", method = RequestMethod.POST)
|
|
|
+ public Result refreshAuditStatus(String id){
|
|
|
+ Result res = new Result();
|
|
|
+ if (StringUtils.isBlank(id)) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "成果ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ AchievementResultObject achievementResultObject=achievementService.getAchievementDetailById(id);
|
|
|
+ if(achievementResultObject==null) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "成果ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if (AchievementAuditStatus.CREATE.getCode() != achievementResultObject.getAuditStatus()) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "当前状态无法提交审核,"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ Achievement a = new Achievement();
|
|
|
+ a.setId(id);
|
|
|
+ a.setAuditStatus(AchievementAuditStatus.SUBMIT.getCode());
|
|
|
+ achievementService.updateByPrimaryKeySelective(a);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
/**
|
|
|
* 下载文本文件
|
|
|
*/
|
|
|
@@ -325,20 +411,16 @@ public class UserAchievementApiController extends CertifyApiController {
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isBlank(ia.getKeyword())) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词1"));
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词"));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
if (null == keywords || keywords.length < 1) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词2"));
|
|
|
- return res;
|
|
|
- }
|
|
|
-
|
|
|
- if (null == ia.getCooperationMode()) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到合作方式", "合作方式"));
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词"));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
for (int i = 0; i < keywords.length; i++) {
|
|
|
if (AFTConstants.KEYWORDLENTH < keywords[i].length()) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "关键词长度"));
|