Browse Source

Merge branch 'master' of https://git.coding.net/aft/AFT

wubb 8 years ago
parent
commit
e8440b445b

+ 46 - 2
src/main/java/com/goafanti/activity/bo/ActivityListBo.java

@@ -2,6 +2,12 @@ package com.goafanti.activity.bo;
 
 import java.util.Date;
 
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonFormat.Shape;
+import com.goafanti.common.constant.AFTConstants;
+
 public class ActivityListBo {
 	private Long	id;
 
@@ -79,7 +85,8 @@ public class ActivityListBo {
 	public void setHost(String host) {
 		this.host = host;
 	}
-
+	
+	@JsonFormat(shape = Shape.STRING)
 	public Integer getType() {
 		return type;
 	}
@@ -87,7 +94,8 @@ public class ActivityListBo {
 	public void setType(Integer type) {
 		this.type = type;
 	}
-
+	
+	@JsonFormat(shape = Shape.STRING)
 	public Integer getForm() {
 		return form;
 	}
@@ -104,4 +112,40 @@ public class ActivityListBo {
 		this.enrollDeadline = enrollDeadline;
 	}
 
+	public String getStartTimeFormattedDate() {
+		if (this.startTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.startTime, AFTConstants.YYYYMMDD);
+		}
+	}
+
+	public void setStartTimeFormattedDate(String startTimeFormattedDate) {
+
+	}
+
+	public String getEndTimeFormattedDate() {
+		if (this.endTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.endTime, AFTConstants.YYYYMMDD);
+		}
+	}
+
+	public void setEndTimeFormattedDate(String endTimeFormattedDate) {
+
+	}
+
+	public String getEnrollDeadlineFormattedDate() {
+		if (this.enrollDeadline == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.enrollDeadline, AFTConstants.YYYYMMDD);
+		}
+	}
+
+	public void setEnrollDeadlineFormattedDate(String enrollDeadlineFormattedDate) {
+
+	}
+
 }

+ 5 - 1
src/main/java/com/goafanti/activity/service/ActivityService.java

@@ -1,11 +1,15 @@
 package com.goafanti.activity.service;
 
+import com.goafanti.activity.bo.ActivityListBo;
 import com.goafanti.common.model.Activity;
 import com.goafanti.core.mybatis.page.Pagination;
 
 public interface ActivityService {
 
-	Pagination<Activity> listActivity(String sTime, String eTime, String name, String host, Integer type, Integer form,
+	Pagination<ActivityListBo> listActivity(String sTime, String eTime, String name, String host, Integer type, Integer form,
 			Integer pNo, Integer pSize);
 
+	void save(Activity a, String startTimeFormattedDate, String endTimeFormattedDate,
+			String enrollDeadlineFormattedDate);
+
 }

+ 10 - 2
src/main/java/com/goafanti/activity/service/impl/ActivityServiceImpl.java

@@ -8,6 +8,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import com.goafanti.activity.bo.ActivityListBo;
 import com.goafanti.activity.service.ActivityService;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.ActivityMapper;
@@ -23,7 +24,7 @@ public class ActivityServiceImpl extends BaseMybatisDao<ActivityMapper> implemen
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<Activity> listActivity(String sTime, String eTime, String name, String host, Integer type,
+	public Pagination<ActivityListBo> listActivity(String sTime, String eTime, String name, String host, Integer type,
 			Integer form, Integer pNo, Integer pSize) {
 
 		Map<String, Object> params = new HashMap<>();
@@ -58,7 +59,14 @@ public class ActivityServiceImpl extends BaseMybatisDao<ActivityMapper> implemen
 		if (pSize == null || pSize < 0 || pSize > 10) {
 			pSize = 10;
 		}
-		return (Pagination<Activity>) findPage("findActivityListByPage", "findActivityCount", params, pNo, pSize);
+		return (Pagination<ActivityListBo>) findPage("findActivityListByPage", "findActivityCount", params, pNo, pSize);
+	}
+
+	@Override
+	public void save(Activity a, String startTimeFormattedDate, String endTimeFormattedDate,
+			String enrollDeadlineFormattedDate) {
+		// TODO Auto-generated method stub
+		
 	}
 
 }

+ 30 - 6
src/main/java/com/goafanti/admin/controller/AdminActivityApiController.java

@@ -3,6 +3,7 @@ package com.goafanti.admin.controller;
 import javax.annotation.Resource;
 import javax.validation.Valid;
 
+import org.springframework.beans.BeanUtils;
 import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -14,6 +15,7 @@ import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseApiController;
 import com.goafanti.common.enums.ActivityFields;
+import com.goafanti.common.model.Activity;
 import com.goafanti.common.utils.StringUtils;
 
 /**
@@ -43,26 +45,48 @@ public class AdminActivityApiController extends BaseApiController {
 		res.setData(activityService.listActivity(sTime, eTime, name, host, type, form, pNo, pSize));
 		return res;
 	}
-	
+
 	/**
 	 * 新增
 	 */
 	@RequestMapping(value = "/add", method = RequestMethod.POST)
 	public Result add(@Valid InputActivity ia, BindingResult bindingResult, String startTimeFormattedDate,
-			String endTimeFormattedDate, String enrollDeadlineFormattedDate){
+			String endTimeFormattedDate, String enrollDeadlineFormattedDate) {
 		Result res = new Result();
 		if (bindingResult.hasErrors()) {
 			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
 					ActivityFields.getFieldDesc(bindingResult.getFieldError().getField())));
 			return res;
 		}
-		
-		if (StringUtils.isBlank(ia.getName())){
+
+		if (StringUtils.isBlank(ia.getName())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "标题"));
 			return res;
 		}
-		
-		//if(StringUtils.)
+
+		if (StringUtils.isBlank(startTimeFormattedDate)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "活动开始时间"));
+			return res;
+		}
+
+		if (null == ia.getType()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "活动类型"));
+			return res;
+		}
+
+		if (null == ia.getForm()) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "活动形式"));
+			return res;
+		}
+
+		if (StringUtils.isBlank(ia.getAddress())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "活动地点"));
+			return res;
+		}
+
+		Activity a = new Activity();
+		BeanUtils.copyProperties(ia, a);
+		activityService.save(a, startTimeFormattedDate, endTimeFormattedDate, enrollDeadlineFormattedDate);
 		return res;
 	}
 }

+ 262 - 216
src/main/java/com/goafanti/common/model/Activity.java

@@ -2,222 +2,268 @@ package com.goafanti.common.model;
 
 import java.util.Date;
 
-public class Activity {
-    private Long id;
-
-    /**
-    * 开始时间
-    */
-    private Date startTime;
-
-    /**
-    * 结束时间
-    */
-    private Date endTime;
-
-    /**
-    * 标题
-    */
-    private String name;
-
-    /**
-    * 状态
-    */
-    private Integer status;
-
-    /**
-    * 活动地址
-    */
-    private String address;
-
-    /**
-    * 主办单位
-    */
-    private String host;
-
-    /**
-    * 承办单位
-    */
-    private String undertake;
-
-    /**
-    * 协办单位,逗号隔开
-    */
-    private String asist;
-
-    /**
-    * 活动类型
-    */
-    private Integer type;
-
-    /**
-    * 活动形式
-    */
-    private Integer form;
-
-    /**
-    * 活动图片地址
-    */
-    private String imgUrls;
-
-    /**
-    * 活动结果描述
-    */
-    private String result;
-
-    /**
-    * 创建时间(报名开始时间)
-    */
-    private Date createTime;
-
-    /**
-    * 报名截止时间
-    */
-    private Date enrollDeadline;
-
-    /**
-    * 题图地址
-    */
-    private String titleUrl;
-
-    /**
-    * 描述
-    */
-    private String desc;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Date getStartTime() {
-        return startTime;
-    }
-
-    public void setStartTime(Date startTime) {
-        this.startTime = startTime;
-    }
-
-    public Date getEndTime() {
-        return endTime;
-    }
-
-    public void setEndTime(Date endTime) {
-        this.endTime = endTime;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public Integer getStatus() {
-        return status;
-    }
-
-    public void setStatus(Integer status) {
-        this.status = status;
-    }
-
-    public String getAddress() {
-        return address;
-    }
-
-    public void setAddress(String address) {
-        this.address = address;
-    }
-
-    public String getHost() {
-        return host;
-    }
-
-    public void setHost(String host) {
-        this.host = host;
-    }
-
-    public String getUndertake() {
-        return undertake;
-    }
-
-    public void setUndertake(String undertake) {
-        this.undertake = undertake;
-    }
-
-    public String getAsist() {
-        return asist;
-    }
-
-    public void setAsist(String asist) {
-        this.asist = asist;
-    }
-
-    public Integer getType() {
-        return type;
-    }
-
-    public void setType(Integer type) {
-        this.type = type;
-    }
-
-    public Integer getForm() {
-        return form;
-    }
-
-    public void setForm(Integer form) {
-        this.form = form;
-    }
-
-    public String getImgUrls() {
-        return imgUrls;
-    }
-
-    public void setImgUrls(String imgUrls) {
-        this.imgUrls = imgUrls;
-    }
-
-    public String getResult() {
-        return result;
-    }
-
-    public void setResult(String result) {
-        this.result = result;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public Date getEnrollDeadline() {
-        return enrollDeadline;
-    }
+import org.apache.commons.lang3.time.DateFormatUtils;
 
-    public void setEnrollDeadline(Date enrollDeadline) {
-        this.enrollDeadline = enrollDeadline;
-    }
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonFormat.Shape;
+import com.goafanti.common.constant.AFTConstants;
+import com.fasterxml.jackson.annotation.JsonIgnore;
 
-    public String getTitleUrl() {
-        return titleUrl;
-    }
-
-    public void setTitleUrl(String titleUrl) {
-        this.titleUrl = titleUrl;
-    }
-
-    public String getDesc() {
-        return desc;
-    }
-
-    public void setDesc(String desc) {
-        this.desc = desc;
-    }
+public class Activity {
+	private Long	id;
+
+	/**
+	 * 开始时间
+	 */
+	private Date	startTime;
+
+	/**
+	 * 结束时间
+	 */
+	private Date	endTime;
+
+	/**
+	 * 标题
+	 */
+	private String	name;
+
+	/**
+	 * 状态
+	 */
+	private Integer	status;
+
+	/**
+	 * 活动地址
+	 */
+	private String	address;
+
+	/**
+	 * 主办单位
+	 */
+	private String	host;
+
+	/**
+	 * 承办单位
+	 */
+	private String	undertake;
+
+	/**
+	 * 协办单位,逗号隔开
+	 */
+	private String	asist;
+
+	/**
+	 * 活动类型
+	 */
+	private Integer	type;
+
+	/**
+	 * 活动形式
+	 */
+	private Integer	form;
+
+	/**
+	 * 活动图片地址
+	 */
+	private String	imgUrls;
+
+	/**
+	 * 活动结果描述
+	 */
+	private String	result;
+
+	/**
+	 * 创建时间(报名开始时间)
+	 */
+	private Date	createTime;
+
+	/**
+	 * 报名截止时间
+	 */
+	private Date	enrollDeadline;
+
+	/**
+	 * 题图地址
+	 */
+	private String	titleUrl;
+
+	/**
+	 * 描述
+	 */
+	private String	desc;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Date getStartTime() {
+		return startTime;
+	}
+
+	public void setStartTime(Date startTime) {
+		this.startTime = startTime;
+	}
+
+	public Date getEndTime() {
+		return endTime;
+	}
+
+	public void setEndTime(Date endTime) {
+		this.endTime = endTime;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public String getAddress() {
+		return address;
+	}
+
+	public void setAddress(String address) {
+		this.address = address;
+	}
+
+	public String getHost() {
+		return host;
+	}
+
+	public void setHost(String host) {
+		this.host = host;
+	}
+
+	public String getUndertake() {
+		return undertake;
+	}
+
+	public void setUndertake(String undertake) {
+		this.undertake = undertake;
+	}
+
+	public String getAsist() {
+		return asist;
+	}
+
+	public void setAsist(String asist) {
+		this.asist = asist;
+	}
+
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getType() {
+		return type;
+	}
+
+	public void setType(Integer type) {
+		this.type = type;
+	}
+
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getForm() {
+		return form;
+	}
+
+	public void setForm(Integer form) {
+		this.form = form;
+	}
+
+	public String getImgUrls() {
+		return imgUrls;
+	}
+
+	public void setImgUrls(String imgUrls) {
+		this.imgUrls = imgUrls;
+	}
+
+	public String getResult() {
+		return result;
+	}
+
+	public void setResult(String result) {
+		this.result = result;
+	}
+
+	@JsonIgnore
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public Date getEnrollDeadline() {
+		return enrollDeadline;
+	}
+
+	public void setEnrollDeadline(Date enrollDeadline) {
+		this.enrollDeadline = enrollDeadline;
+	}
+
+	public String getTitleUrl() {
+		return titleUrl;
+	}
+
+	public void setTitleUrl(String titleUrl) {
+		this.titleUrl = titleUrl;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+
+	public String getStartTimeFormattedDate() {
+		if (this.startTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.startTime, AFTConstants.YYYYMMDD);
+		}
+	}
+
+	public void setStartTimeFormattedDate(String startTimeFormattedDate) {
+
+	}
+
+	public String getEndTimeFormattedDate() {
+		if (this.endTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.endTime, AFTConstants.YYYYMMDD);
+		}
+	}
+
+	public void setEndTimeFormattedDate(String endTimeFormattedDate) {
+
+	}
+
+	public String getEnrollDeadlineFormattedDate() {
+		if (this.enrollDeadline == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.enrollDeadline, AFTConstants.YYYYMMDD);
+		}
+	}
+
+	public void setEnrollDeadlineFormattedDate(String enrollDeadlineFormattedDate) {
+
+	}
 }

+ 7 - 1
src/main/java/com/goafanti/news/controller/NewsController.java

@@ -99,7 +99,7 @@ public class NewsController extends BaseController {
 	/**
 	 * 新闻详情
 	 */
-	@RequestMapping(value = "/portal/news/detail", method = RequestMethod.GET)
+	@RequestMapping(value = "/portal/news/detailInfo", method = RequestMethod.GET)
 	@ResponseBody
 	public Result portalNewsDetail(Long id) {
 		Result res = new Result();
@@ -111,6 +111,12 @@ public class NewsController extends BaseController {
 		return res;
 	}
 	
+	@RequestMapping(value = "/portal/news/newsDetail", method = RequestMethod.GET)
+	public ModelAndView portalHighTechEvaluateIprInfo(HttpServletRequest request, ModelAndView modelview) {
+		modelview.setViewName("/portal/news/newsDetail");
+		return modelview;
+	} 
+	
 	private void handleBanners(ModelAndView modelview, BannersType bannersType) {
 		List<Banners> banners = bannersService.findPortalBanners(bannersType.getKey());
 		if (!banners.isEmpty()) {

+ 23 - 1
src/main/webapp/WEB-INF/views/common.html

@@ -29,7 +29,7 @@
 			</div>
 			<div class="rt" th:if="${isLogin}">
 				<span>欢迎光临,</span>
-				<a class="login" th:href="${basePath + isAdmin? '/admin/index.html':'/user/account/index.html'}" th:text="${userName}">个人中心</a>
+				<a class="login" th:href="${basePath + (isAdmin? '/admin/index.html':'/user/account/index.html')}" th:text="${userName}">个人中心</a>
 				<a th:href="${basePath + '/user/logout'}">退出</a>
 				<a href="#">导航</a>
 				<a href="#">关于我们</a>
@@ -123,6 +123,28 @@
 			</li>
 		</ul>
 	</th:block>
+	
+	<th:block th:fragment="banners">
+		<div id="myCarousel" class="carousel slide" th:if="${banners!=null && banners.size() > 1}">
+			<ol class="carousel-indicators">
+				<th:block th:each="banner,bannerStat:${banners}">
+					<li data-target="#myCarousel" data-slide-to="0" th:class="${bannerStat.first?'active':''}"></li>
+				</th:block>
+			</ol>
+			<div class="carousel-inner">
+				<th:block  th:each="banner,bannerStat:${banners}">
+				<div class="item" th:classappend="${bannerStat.first?'active':''}">
+					<img th:src="${staticDomain +'/upload'+  banner.imgurl}" th:alt="${banner.text}">
+				</div>
+				</th:block>
+			</div>
+			<a class="carousel-control left" href="#myCarousel" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a>
+			<a class="carousel-control right" href="#myCarousel" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
+		</div>
+		<div class="banner-item" th:if="${banners!=null && banners.size()==1}">
+			<img th:src="${staticDomain +'/upload'+  banners[0].imgurl}" th:alt="${banners[0].text}">
+		</div>
+	</th:block>
 
 	<th:block th:fragment="copyright">
 		<div onclick="window.open('http://wpa.qq.com/msgrd?v=3&uin=2035994611&site=qq&menu=yes', '_blank', 'height=502, width=644,toolbar=no,scrollbars=no,menubar=no,status=no');"

File diff suppressed because it is too large
+ 1 - 1
src/main/webapp/WEB-INF/views/portal/evaluation/index.html


+ 1 - 19
src/main/webapp/WEB-INF/views/portal/technologyTrading/index.html

@@ -32,25 +32,7 @@
 		</div>
 		<div class="secondary_navigation"></div>
 	</div>
-	<div id="myCarousel" class="carousel slide" th:if="${banners!=null && banners.size() > 1}">
-		<ol class="carousel-indicators">
-			<th:block th:each="banner,bannerStat:${banners}">
-				<li data-target="#myCarousel" data-slide-to="0" th:class="${bannerStat.first?'active':''}"></li>
-			</th:block>
-		</ol>
-		<div class="carousel-inner">
-			<th:block  th:each="banner,bannerStat:${banners}">
-			<div class="item" th:classappend="${bannerStat.first?'active':''}">
-				<img th:src="${staticDomain +'/upload'+  banner.imgurl}" th:alt="${banner.text}">
-			</div>
-			</th:block>
-		</div>
-		<a class="carousel-control left" href="#myCarousel" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a>
-		<a class="carousel-control right" href="#myCarousel" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
-	</div>
-	<div class="banner-item" th:if="${banners!=null && banners.size()==1}">
-		<img th:src="${staticDomain +'/upload'+  banners[0].imgurl}" th:alt="${banners[0].text}">
-	</div>
+	<div th:replace="common::banners"></div>
 	<div class="banner-item" th:if="${banners==null}">
 		<img th:src="${portalHost + '/img/technologyTrading_index_banner.jpg'}" alt="First slide">
 	</div>