|
|
@@ -23,16 +23,18 @@ import com.goafanti.achievement.bo.InputAchievement;
|
|
|
import com.goafanti.achievement.service.AchievementInterestService;
|
|
|
import com.goafanti.achievement.service.AchievementService;
|
|
|
import com.goafanti.banners.service.BannersService;
|
|
|
+import com.goafanti.business.service.JtBusinessService;
|
|
|
import com.goafanti.common.bo.Result;
|
|
|
import com.goafanti.common.constant.AFTConstants;
|
|
|
import com.goafanti.common.constant.ErrorConstants;
|
|
|
import com.goafanti.common.constant.PageConstants;
|
|
|
import com.goafanti.common.controller.BaseApiController;
|
|
|
-import com.goafanti.common.dao.JpushEasemobAccountMapper;
|
|
|
+import com.goafanti.common.controller.CertifyApiController;
|
|
|
import com.goafanti.common.enums.AchievementAuditStatus;
|
|
|
import com.goafanti.common.enums.AchievementFields;
|
|
|
import com.goafanti.common.enums.AttachmentType;
|
|
|
import com.goafanti.common.enums.DemandAuditStatus;
|
|
|
+import com.goafanti.common.enums.DemandDataCategory;
|
|
|
import com.goafanti.common.enums.DemandFields;
|
|
|
import com.goafanti.common.model.Achievement;
|
|
|
import com.goafanti.common.model.Demand;
|
|
|
@@ -44,7 +46,6 @@ import com.goafanti.common.model.User;
|
|
|
import com.goafanti.common.service.FieldGlossoryService;
|
|
|
import com.goafanti.common.utils.DateUtils;
|
|
|
import com.goafanti.common.utils.PasswordUtil;
|
|
|
-import com.goafanti.common.utils.TimeUtils;
|
|
|
import com.goafanti.common.utils.VerifyCodeUtils;
|
|
|
import com.goafanti.core.mybatis.page.Pagination;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
@@ -65,7 +66,7 @@ import com.goafanti.user.service.UserService;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping(value = "/app/user")
|
|
|
-public class AppUserController extends BaseApiController {
|
|
|
+public class AppUserController extends CertifyApiController {
|
|
|
@Resource
|
|
|
private UserService userServiceImpl;
|
|
|
@Resource
|
|
|
@@ -87,6 +88,8 @@ public class AppUserController extends BaseApiController {
|
|
|
@Resource
|
|
|
private UserIdentityService userIdentityService;
|
|
|
@Resource
|
|
|
+ private JtBusinessService jtBusinessService;
|
|
|
+ @Resource
|
|
|
AchievementInterestService achievementInterestService;
|
|
|
@Resource
|
|
|
JtOrderService jtOrderService;
|
|
|
@@ -95,7 +98,7 @@ public class AppUserController extends BaseApiController {
|
|
|
@Resource
|
|
|
private UserService userService;
|
|
|
@Resource(name = "passwordUtil")
|
|
|
- private PasswordUtil passwordUtil;
|
|
|
+ private PasswordUtil passwordUtil;
|
|
|
|
|
|
@RequestMapping(value = "/uploadImg",method = RequestMethod.POST)
|
|
|
public Result uploadAvatar(HttpServletRequest req){
|
|
|
@@ -300,6 +303,9 @@ public class AppUserController extends BaseApiController {
|
|
|
if (StringUtils.isNumeric(pageNo)) {
|
|
|
pNo = Integer.parseInt(pageNo);
|
|
|
}
|
|
|
+ if(TokenManager.getUserId() ==null) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.NON_LOGIN, "", ""));return res;
|
|
|
+ }
|
|
|
res.setData(demandService.listMyDemand( pNo, pSize));
|
|
|
return res;
|
|
|
}
|
|
|
@@ -613,6 +619,9 @@ public class AppUserController extends BaseApiController {
|
|
|
Result result=new Result();
|
|
|
if(null==pageNo||pageNo<0)pageNo=1;
|
|
|
if(null==pageSize||pageSize<0)pageSize=10;
|
|
|
+ if(TokenManager.getUserId() ==null) {
|
|
|
+ result.getError().add(buildError(ErrorConstants.NON_LOGIN, "", ""));return result;
|
|
|
+ }
|
|
|
Pagination<AchievementObject> p=achievementService.listMyAchievement(auditStatus, name, dataCategory,
|
|
|
startDate, endDate, pageNo, pageSize);
|
|
|
result.data(p);
|
|
|
@@ -633,16 +642,16 @@ public class AppUserController extends BaseApiController {
|
|
|
}
|
|
|
|
|
|
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;
|
|
|
}
|
|
|
|
|
|
- if (!AchievementAuditStatus.CREATE.getCode().equals(ia.getAuditStatus())
|
|
|
+ /*if (!AchievementAuditStatus.CREATE.getCode().equals(ia.getAuditStatus())
|
|
|
&& !AchievementAuditStatus.SUBMIT.getCode().equals(ia.getAuditStatus())
|
|
|
&& !AchievementAuditStatus.UNAUDITED.getCode().equals(ia.getAuditStatus())) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "当前状态无法提交审核!"));
|
|
|
return res;
|
|
|
- }
|
|
|
+ }*/
|
|
|
List<String> webPages = new ArrayList<String>();
|
|
|
List<String> appPages = new ArrayList<String>();
|
|
|
PageConstants.putAchievement(publishPages, webPages, appPages);
|
|
|
@@ -650,14 +659,13 @@ public class AppUserController extends BaseApiController {
|
|
|
if (!res.getError().isEmpty()) {
|
|
|
return res;
|
|
|
}
|
|
|
- if(webPages.size()==0 && appPages.size() == 0){
|
|
|
-
|
|
|
+ /*if(webPages.size()==0 && appPages.size() == 0){
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "页面参数错误","页面参数"));
|
|
|
return res;
|
|
|
- }
|
|
|
- if(TokenManager.getUserId() ==null) {
|
|
|
+ }*/
|
|
|
+ /*if(TokenManager.getUserId() ==null) {
|
|
|
res.getError().add(buildError(ErrorConstants.NON_LOGIN, "", ""));return res;
|
|
|
- }
|
|
|
+ }*/
|
|
|
Achievement a = new Achievement();
|
|
|
BeanUtils.copyProperties(ia, a);
|
|
|
a.setOwnerId(TokenManager.getUserId());
|
|
|
@@ -712,12 +720,12 @@ public class AppUserController extends BaseApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
|
|
|
return res;
|
|
|
}
|
|
|
- if (!DemandAuditStatus.CREATE.getCode().equals(demand.getAuditStatus())
|
|
|
+ /*if (!DemandAuditStatus.CREATE.getCode().equals(demand.getAuditStatus())
|
|
|
&& !DemandAuditStatus.UNAUDITED.getCode().equals(demand.getAuditStatus())
|
|
|
&& !DemandAuditStatus.REVOKE.getCode().equals(demand.getAuditStatus())) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "当前状态无法提交审核!"));
|
|
|
return res;
|
|
|
- }
|
|
|
+ }*/
|
|
|
//demand.setAuditStatus(DemandAuditStatus.INAUDIT.getCode()); 两步操作,先保存后提交
|
|
|
res = disposeDemand(res, demand, keywords, publishPages);
|
|
|
if (!res.getError().isEmpty()) {
|
|
|
@@ -725,11 +733,11 @@ public class AppUserController extends BaseApiController {
|
|
|
}
|
|
|
List<String> webPages = new ArrayList<String>();
|
|
|
List<String> appPages = new ArrayList<String>();
|
|
|
- PageConstants.putDemand(publishPages, webPages, appPages);
|
|
|
- if(webPages.size()==0 && appPages.size() == 0){
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "页面参数错误"));
|
|
|
- return res;
|
|
|
- }
|
|
|
+// PageConstants.putDemand(publishPages, webPages, appPages);
|
|
|
+// if(webPages.size()==0 && appPages.size() == 0){
|
|
|
+// res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "页面参数错误"));
|
|
|
+// return res;
|
|
|
+// }
|
|
|
Demand d = new Demand();
|
|
|
BeanUtils.copyProperties(demand, d);
|
|
|
d.setEmployerId(TokenManager.getUserId());
|
|
|
@@ -742,11 +750,11 @@ public class AppUserController extends BaseApiController {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
- /*if (!DemandDataCategory.USERDEMAND.getCode().equals(demand.getDataCategory())
|
|
|
- && !DemandDataCategory.ORGDEMAND.getCode().equals(demand.getDataCategory())) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "数据类型"));
|
|
|
- return res;
|
|
|
- }*/
|
|
|
+// if (!DemandDataCategory.USERDEMAND.getCode().equals(demand.getDataCategory())
|
|
|
+// && !DemandDataCategory.ORGDEMAND.getCode().equals(demand.getDataCategory())) {
|
|
|
+// res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "数据类型"));
|
|
|
+// return res;
|
|
|
+// }
|
|
|
|
|
|
if (StringUtils.isBlank(demand.getKeyword())) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词"));
|
|
|
@@ -782,4 +790,47 @@ public class AppUserController extends BaseApiController {
|
|
|
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 收藏列表 0 成果 1需求 2项目
|
|
|
+ * */
|
|
|
+ @RequestMapping(value="/appMyCollection",method=RequestMethod.GET)
|
|
|
+ public Result listProjectIInterestedIn(Integer type,Integer pageNo,Integer pageSize) {
|
|
|
+ Result res=new Result();
|
|
|
+ if(StringUtils.isBlank(TokenManager.getUserId())) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "当前用户未登陆"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if(null==type||type>3||type<0) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "列表类型", "列表类型请指定"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if (type==0) {
|
|
|
+ res.setData(achievementService.myCollectionAchievement(pageNo, pageSize));
|
|
|
+ } else if(type==1){
|
|
|
+ res.setData(demandService.myCollectionDemand(pageNo, pageSize));
|
|
|
+ } else if(type==2){
|
|
|
+ res.setData(jtBusinessService.myCollectionProject(pageNo,pageSize));
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ /*
|
|
|
+ * 关注列表 -专家
|
|
|
+ * */
|
|
|
+ @RequestMapping(value="/appMyInterested",method=RequestMethod.GET)
|
|
|
+ public Result appMyInterested(Integer type,Integer pageNo,Integer pageSize) {
|
|
|
+ Result result=new Result();
|
|
|
+ if(StringUtils.isBlank(TokenManager.getUserId())) {
|
|
|
+ result.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "当前用户未登陆"));
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ if (type==0) {
|
|
|
+ result.setData(userIdentityService.appMyInterestedExpert(pageNo,pageSize));
|
|
|
+ }else if(type==1){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ //result.setData(userIdentityService.listInterestedExpert(pageNo,pageSize));
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
}
|