|
|
@@ -1,7 +1,6 @@
|
|
|
package com.goafanti.admin.controller;
|
|
|
|
|
|
import java.text.ParseException;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
@@ -16,6 +15,7 @@ import com.goafanti.common.bo.Result;
|
|
|
import com.goafanti.common.constant.AFTConstants;
|
|
|
import com.goafanti.common.constant.ErrorConstants;
|
|
|
import com.goafanti.common.controller.CertifyApiController;
|
|
|
+import com.goafanti.common.utils.DateUtils;
|
|
|
import com.goafanti.message.enums.ConsumerType;
|
|
|
import com.goafanti.message.enums.RecommendType;
|
|
|
import com.goafanti.message.enums.SubjectType;
|
|
|
@@ -39,9 +39,8 @@ public class AdminMessageController extends CertifyApiController{
|
|
|
@RequestMapping(value = "/toCreateSystemMessage", method = RequestMethod.GET)
|
|
|
public Result toCreateSystemMessage(){
|
|
|
Result res = new Result();
|
|
|
- SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
|
|
|
JsonObject jsonObject = new JsonObject();
|
|
|
- jsonObject.addProperty("createTime", format.format(new Date()));
|
|
|
+ jsonObject.addProperty("createTime", DateUtils.formatDate(new Date(), AFTConstants.YYYYMMDDHHMMSS));
|
|
|
res.setData(jsonObject);
|
|
|
return res;
|
|
|
}
|
|
|
@@ -97,8 +96,8 @@ public class AdminMessageController extends CertifyApiController{
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "必须选定目标群体"));
|
|
|
return res;
|
|
|
}
|
|
|
- SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
|
|
|
- messageServiceImpl.insertSystemMessage(targetMap,targetType, title, body, subject,format.parse(createTime),isDraft);
|
|
|
+ messageServiceImpl.insertSystemMessage(targetMap,targetType, title, body, subject,
|
|
|
+ DateUtils.parseDate(createTime,AFTConstants.YYYYMMDDHHMMSS),isDraft);
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -139,13 +138,13 @@ public class AdminMessageController extends CertifyApiController{
|
|
|
return res;
|
|
|
}
|
|
|
Map<Integer,String> sourceMap = new HashMap<Integer, String>();
|
|
|
- if(sourceType == RecommendType.TECH_SERVICE.getTypeCode()) sourceMap.put(targetType, projectIds);
|
|
|
- if(sourceType == RecommendType.PERSON_ACHIEVEMENT.getTypeCode()) sourceMap.put(targetType, personalAchievementIds);
|
|
|
- if(sourceType == RecommendType.ORGANIZATION_ACHIEVEMENT.getTypeCode()) sourceMap.put(targetType, organizationAchievementIds);
|
|
|
- if(sourceType == RecommendType.PERSONAL_DEMAND.getTypeCode()) sourceMap.put(targetType, personalDemandIds);
|
|
|
- if(sourceType == RecommendType.ORGANIZATION_DEMAND.getTypeCode()) sourceMap.put(targetType, organizationDemandIds);
|
|
|
- if(sourceType == RecommendType.EXPERT.getTypeCode()) sourceMap.put(targetType, expertIds);
|
|
|
- if(sourceType == RecommendType.NEWS.getTypeCode()) sourceMap.put(targetType, newsIds);
|
|
|
+ if(sourceType == RecommendType.TECH_SERVICE.getTypeCode()) sourceMap.put(sourceType, projectIds);
|
|
|
+ if(sourceType == RecommendType.PERSON_ACHIEVEMENT.getTypeCode()) sourceMap.put(sourceType, personalAchievementIds);
|
|
|
+ if(sourceType == RecommendType.ORGANIZATION_ACHIEVEMENT.getTypeCode()) sourceMap.put(sourceType, organizationAchievementIds);
|
|
|
+ if(sourceType == RecommendType.PERSONAL_DEMAND.getTypeCode()) sourceMap.put(sourceType, personalDemandIds);
|
|
|
+ if(sourceType == RecommendType.ORGANIZATION_DEMAND.getTypeCode()) sourceMap.put(sourceType, organizationDemandIds);
|
|
|
+ if(sourceType == RecommendType.EXPERT.getTypeCode()) sourceMap.put(sourceType, expertIds);
|
|
|
+ if(sourceType == RecommendType.NEWS.getTypeCode()) sourceMap.put(sourceType, newsIds);
|
|
|
if(StringUtils.isBlank(sourceMap.get(targetType))){
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "必须选定推荐内容"));
|
|
|
return res;
|