|
|
@@ -1,8 +1,12 @@
|
|
|
package com.goafanti.sc.controller;
|
|
|
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
@@ -10,6 +14,7 @@ import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import com.goafanti.common.controller.BaseController;
|
|
|
import com.goafanti.common.model.ScDemand;
|
|
|
+import com.goafanti.sc.bo.ScMessageListBo;
|
|
|
import com.goafanti.sc.bo.inputAchievement;
|
|
|
import com.goafanti.sc.bo.inputDemands;
|
|
|
import com.goafanti.sc.service.CommonService;
|
|
|
@@ -32,11 +37,18 @@ public class ScWebController extends BaseController{
|
|
|
ModelAndView mv = new ModelAndView();
|
|
|
mv.setViewName("sc/achievement");
|
|
|
inputAchievement s=scAchievementService.AchievementDetails(id);
|
|
|
+ if (StringUtils.isNotBlank(s.getIntroduce()))
|
|
|
+ s.setIntroduce(s.getIntroduce().replace("\n","<br>"));
|
|
|
+ if (StringUtils.isNotBlank(s.getpIntroduce()))
|
|
|
+ s.setpIntroduce(s.getpIntroduce().replace("\n", "<br>"));
|
|
|
mv.addObject("achievementList",s);
|
|
|
- /*List<ScMessageListBo> obj = (List<ScMessageListBo>)commonService.listMessage(id,10,1).getList();
|
|
|
- JSONObject jo = new JSONObject();
|
|
|
- System.out.println(jo.toJSON(obj).toString());*/
|
|
|
- mv.addObject("listMessage", commonService.listMessage(id,10,1).getList());
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ List<ScMessageListBo> l=(List<ScMessageListBo>) commonService.listMessage(id,10,1).getList();
|
|
|
+ for (ScMessageListBo m : l) {
|
|
|
+ if (StringUtils.isNotBlank(m.getContent()))
|
|
|
+ m.setContent(m.getContent().replace("\n", "<br>"));
|
|
|
+ }
|
|
|
+ mv.addObject("listMessage",l);
|
|
|
return mv;
|
|
|
}
|
|
|
|
|
|
@@ -50,8 +62,18 @@ public class ScWebController extends BaseController{
|
|
|
mv.setViewName("sc/man");
|
|
|
}
|
|
|
inputDemands s=scDemandService.demandDetails(id);
|
|
|
+ if (StringUtils.isNotBlank(s.getIntroduce()))
|
|
|
+ s.setIntroduce(s.getIntroduce().replace("\n","<br>"));
|
|
|
+ if (StringUtils.isNotBlank(s.getPintroduce()))
|
|
|
+ s.setPintroduce(s.getPintroduce().replace("\n", "<br>"));
|
|
|
mv.addObject("demandList", s);
|
|
|
- mv.addObject("listMessage", commonService.listMessage(id,10,1).getList());
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ List<ScMessageListBo> l=(List<ScMessageListBo>) commonService.listMessage(id,10,1).getList();
|
|
|
+ for (ScMessageListBo m : l) {
|
|
|
+ if (StringUtils.isNotBlank(m.getContent()))
|
|
|
+ m.setContent(m.getContent().replace("\n", "<br>"));
|
|
|
+ }
|
|
|
+ mv.addObject("listMessage", l);
|
|
|
return mv;
|
|
|
}
|
|
|
|