|
|
@@ -16,6 +16,7 @@ import com.goafanti.business.service.JtBusinessService;
|
|
|
import com.goafanti.common.bo.Result;
|
|
|
import com.goafanti.common.constant.ErrorConstants;
|
|
|
import com.goafanti.common.controller.CertifyApiController;
|
|
|
+import com.goafanti.common.dao.AchievementInterestMapper;
|
|
|
import com.goafanti.common.dao.ProjectInterestMapper;
|
|
|
import com.goafanti.common.enums.AchievementAuditStatus;
|
|
|
import com.goafanti.common.enums.AchievementReleaseStatus;
|
|
|
@@ -103,6 +104,15 @@ public class PortalInterestApiController extends CertifyApiController{
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
|
|
|
return res;
|
|
|
}
|
|
|
+ if(StringUtils.isBlank(TokenManager.getUserId())) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "当前用户未登陆"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ DemandInterest demandInterest=demandInterestService.selectDemandInterestByUidAndDemandId(TokenManager.getUserId(), id);
|
|
|
+ if(demandInterest==null) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "需求"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
res.setData(demandInterestService.saveCancelDemandInterest(id));
|
|
|
return res;
|
|
|
}
|
|
|
@@ -124,13 +134,12 @@ public class PortalInterestApiController extends CertifyApiController{
|
|
|
return res;
|
|
|
}
|
|
|
Demand d = demandService.selectByPrimaryKey(id);
|
|
|
- if (null == d || d.getDeletedSign().equals(DeleteStatus.DELETED.getCode())
|
|
|
- || !d.getAuditStatus().equals(DemandAuditStatus.AUDITED.getCode())
|
|
|
- || !d.getReleaseStatus().equals(DemandReleaseStatus.RELEASED.getCode())) {
|
|
|
+ if (null == d
|
|
|
+ || !d.getAuditStatus().equals(DemandAuditStatus.AUDITED.getCode())) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "需求ID"));
|
|
|
return res;
|
|
|
}
|
|
|
- res.setData(demandInterestService.saveAchievementInterest(id));
|
|
|
+ res.setData(demandInterestService.saveDemandInterest(id));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -145,7 +154,16 @@ public class PortalInterestApiController extends CertifyApiController{
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "成果ID"));
|
|
|
return res;
|
|
|
}
|
|
|
- res.setData(achievementInterestService.saveCancelAchievementInterest(id));
|
|
|
+ if(StringUtils.isBlank(TokenManager.getUserId())) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "当前用户未登陆"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ AchievementInterest achievementInterest=achievementInterestService.selectAchievementInterestByUidAndAchievementId(TokenManager.getUserId(), id);
|
|
|
+ if(achievementInterest==null) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "找不到成果ID", "找不到成果"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ res.setData(achievementInterestService.saveCancelAchievementInterest(achievementInterest.getId()));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -169,9 +187,8 @@ public class PortalInterestApiController extends CertifyApiController{
|
|
|
}
|
|
|
|
|
|
Achievement a = achievementService.selectByPrimaryKey(id);
|
|
|
- if (null == a || a.getDeletedSign().equals(DeleteStatus.DELETED.getCode())
|
|
|
- || !a.getAuditStatus().equals(AchievementAuditStatus.AUDITED.getCode())
|
|
|
- || !a.getReleaseStatus().equals(AchievementReleaseStatus.RELEASED.getCode())) {
|
|
|
+ if (null == a
|
|
|
+ || !a.getAuditStatus().equals(AchievementAuditStatus.AUDITED.getCode())) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "成果ID"));
|
|
|
return res;
|
|
|
}
|
|
|
@@ -204,6 +221,10 @@ public class PortalInterestApiController extends CertifyApiController{
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
|
|
|
return res;
|
|
|
}
|
|
|
+ if(StringUtils.isBlank(TokenManager.getUserId())) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "当前用户未登陆"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
res.setData(demandService.selectDemandDetail(TokenManager.getUserId(), id));
|
|
|
return res;
|
|
|
}
|
|
|
@@ -233,13 +254,14 @@ public class PortalInterestApiController extends CertifyApiController{
|
|
|
public Result projectInterest(String id) {
|
|
|
Result result=new Result();
|
|
|
if(StringUtils.isBlank(id)) {
|
|
|
- result.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
|
|
|
+ result.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "项目ID"));
|
|
|
return result;
|
|
|
}
|
|
|
if(StringUtils.isBlank(TokenManager.getUserId())) {
|
|
|
result.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "当前用户未登陆"));
|
|
|
return result;
|
|
|
}
|
|
|
+ projectInterestMapper.deleteInterest(TokenManager.getUserId(), id);
|
|
|
ProjectInterest projectInterest=new ProjectInterest();
|
|
|
projectInterest.setCreateTime(new Date());
|
|
|
projectInterest.setId(UUID.randomUUID().toString());
|
|
|
@@ -289,7 +311,7 @@ public class PortalInterestApiController extends CertifyApiController{
|
|
|
result.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "当前用户未登陆"));
|
|
|
return result;
|
|
|
}
|
|
|
- result.setData(demandService.listInterestedAchievement(pageNo, pageSize));
|
|
|
+ result.setData(demandService.listInterestedDemand(pageNo, pageSize));
|
|
|
return result;
|
|
|
|
|
|
}
|
|
|
@@ -308,11 +330,8 @@ public class PortalInterestApiController extends CertifyApiController{
|
|
|
result.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "当前用户未登陆"));
|
|
|
return result;
|
|
|
}
|
|
|
-// UserInterest userInterest=new UserInterest();
|
|
|
-// userInterest.setCreateTime(new Date());
|
|
|
-// userInterest.setId(UUID.randomUUID().toString());
|
|
|
-// userInterest.setFromUid(TokenManager.getUserId());
|
|
|
-// userInterest.setToUid(id);
|
|
|
+ UserInterest userInterest=userInterestService.findByFromUidAndToUid(TokenManager.getUserId(), id);
|
|
|
+ if(userInterest==null )
|
|
|
userInterestService.insert(id);
|
|
|
return result;
|
|
|
}
|
|
|
@@ -347,7 +366,7 @@ public class PortalInterestApiController extends CertifyApiController{
|
|
|
result.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "当前用户未登陆"));
|
|
|
return result;
|
|
|
}
|
|
|
- result.setData(userIdentityService.listInterestedDemand(pageNo,pageSize));
|
|
|
+ result.setData(userIdentityService.listInterestedExpert(pageNo,pageSize));
|
|
|
return result;
|
|
|
}
|
|
|
|