Browse Source

Merge remote-tracking branch 'origin/dev' into test

wanghui 8 years ago
parent
commit
5aabbecc11
25 changed files with 1160 additions and 629 deletions
  1. 11 4
      src/main/java/com/goafanti/achievement/bo/AchievementListBo.java
  2. 23 1
      src/main/java/com/goafanti/achievement/bo/AchievementOrgOwnerDetailBo.java
  3. 2 2
      src/main/java/com/goafanti/achievement/service/AchievementService.java
  4. 14 7
      src/main/java/com/goafanti/achievement/service/impl/AchievementServiceImpl.java
  5. 69 8
      src/main/java/com/goafanti/admin/controller/AdminAchievementApiController.java
  6. 67 9
      src/main/java/com/goafanti/admin/controller/AdminDemandApiController.java
  7. 2 1
      src/main/java/com/goafanti/common/constant/ErrorConstants.java
  8. 13 1
      src/main/java/com/goafanti/common/controller/WebpageController.java
  9. 33 0
      src/main/java/com/goafanti/common/dao/MarketingManagementMapper.java
  10. 91 89
      src/main/java/com/goafanti/common/enums/AttachmentType.java
  11. 26 0
      src/main/java/com/goafanti/common/enums/MarketingPage.java
  12. 82 5
      src/main/java/com/goafanti/common/mapper/AchievementMapper.xml
  13. 92 7
      src/main/java/com/goafanti/common/mapper/DemandMapper.xml
  14. 33 0
      src/main/java/com/goafanti/common/mapper/MarketingManagementMapper.xml
  15. 281 281
      src/main/java/com/goafanti/common/utils/FileUtils.java
  16. 9 1
      src/main/java/com/goafanti/demand/bo/DemandManageDetailBo.java
  17. 12 1
      src/main/java/com/goafanti/demand/bo/DemandManageListBo.java
  18. 2 2
      src/main/java/com/goafanti/demand/service/DemandService.java
  19. 14 8
      src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java
  20. 27 0
      src/main/java/com/goafanti/marketing/bo/MarketingManagementBo.java
  21. 51 0
      src/main/java/com/goafanti/marketing/service/MarketingManagementService.java
  22. 49 0
      src/main/java/com/goafanti/marketing/service/impl/MarketingManagementServiceImpl.java
  23. 2 2
      src/main/resources/props/config_local.properties
  24. 96 94
      src/main/resources/props/error.properties
  25. 59 106
      src/main/webapp/WEB-INF/views/portal/index.html

+ 11 - 4
src/main/java/com/goafanti/achievement/bo/AchievementListBo.java

@@ -116,6 +116,10 @@ public class AchievementListBo {
 	private String			transferModeS;
 	
 	private String	ownerTypeS;
+	/**
+	 * 是否展示在首页 0-否  1-是
+	 */
+	private Integer hot;
 	
 	public String getOrgId() {
 		return orgId;
@@ -334,9 +338,12 @@ public class AchievementListBo {
 	public void setOwnerTypeS(String ownerTypeS) {
 		this.ownerTypeS = ownerTypeS;
 	}
-	
-	
-	
-	
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getHot() {
+		return hot;
+	}
 
+	public void setHot(Integer hot) {
+		this.hot = hot;
+	}
 }

+ 23 - 1
src/main/java/com/goafanti/achievement/bo/AchievementOrgOwnerDetailBo.java

@@ -1,5 +1,7 @@
 package com.goafanti.achievement.bo;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonFormat.Shape;
 import com.goafanti.common.model.Achievement;
 
 public class AchievementOrgOwnerDetailBo extends Achievement {
@@ -12,7 +14,11 @@ public class AchievementOrgOwnerDetailBo extends Achievement {
 	private String	iOwnerEmail;
 
 	private String	iOwnerPostalAddress;
-
+	
+	private Integer hot;
+	
+	private String coverImg;
+	
 	public String getiOwnerPostalAddress() {
 		return iOwnerPostalAddress;
 	}
@@ -52,5 +58,21 @@ public class AchievementOrgOwnerDetailBo extends Achievement {
 	public void setiOwnerEmail(String iOwnerEmail) {
 		this.iOwnerEmail = iOwnerEmail;
 	}
+	
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getHot() {
+		return hot;
+	}
+
+	public void setHot(Integer hot) {
+		this.hot = hot;
+	}
 
+	public String getCoverImg() {
+		return coverImg;
+	}
+
+	public void setCoverImg(String coverImg) {
+		this.coverImg = coverImg;
+	}
 }

+ 2 - 2
src/main/java/com/goafanti/achievement/service/AchievementService.java

@@ -21,7 +21,7 @@ public interface AchievementService {
 
 	Pagination<AchievementListBo> listUserOwnerAchievement(String username, String ownerName, String ownerId, Integer auditStatus, Integer serialNumber,
 			String name, String keyword, Integer category, Integer status, String releaseDateStartDate,
-			String releaseDateEndDate, Integer releaseStatus, Integer pNo, Integer pSize);
+			String releaseDateEndDate, Integer releaseStatus, Integer pNo, Integer pSize,Integer boutique,Integer effective);
 
 	void saveAchievement(Achievement a, String[] keywords);
 
@@ -41,7 +41,7 @@ public interface AchievementService {
 
 	Pagination<AchievementListBo> listOrgOwnerAchievement(String unitName, String ownerName, String ownerId, Integer auditStatus, Integer serialNumber,
 			String name, String keyword, Integer category, Integer status, String releaseDateStartDate,
-			String releaseDateEndDate, Integer releaseStatus, Integer pNo, Integer pSize);
+			String releaseDateEndDate, Integer releaseStatus, Integer pNo, Integer pSize,Integer boutique,Integer hot);
 
 	AchievementUserOwnerDetailBo selectUserOwnerDetail(String id);
 

+ 14 - 7
src/main/java/com/goafanti/achievement/service/impl/AchievementServiceImpl.java

@@ -92,7 +92,8 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 	@Override
 	public Pagination<AchievementListBo> listUserOwnerAchievement(String username, String ownerName, String ownerId,
 			Integer auditStatus, Integer serialNumber, String name, String keyword, Integer category, Integer status,
-			String releaseDateStartDate, String releaseDateEndDate, Integer releaseStatus, Integer pNo, Integer pSize) {
+			String releaseDateStartDate, String releaseDateEndDate, Integer releaseStatus, Integer pNo, Integer pSize
+			,Integer boutique,Integer hot) {
 		if (pNo == null || pNo < 0) {
 			pNo = 1;
 		}
@@ -103,7 +104,7 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 		return (Pagination<AchievementListBo>) findPage("findUserOwnerAchievementListByPage",
 				"findUserOwnerAchievementCount",
 				disposeParams(username, ownerName, ownerId, auditStatus, serialNumber, name, keyword, category, status,
-						releaseDateStartDate, releaseDateEndDate, releaseStatus, UserType.PERSONAL.getCode()),
+						releaseDateStartDate, releaseDateEndDate, releaseStatus, UserType.PERSONAL.getCode(),boutique,hot),
 				pNo, pSize);
 	}
 
@@ -111,7 +112,8 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 	@Override
 	public Pagination<AchievementListBo> listOrgOwnerAchievement(String unitName, String ownerName, String ownerId,
 			Integer auditStatus, Integer serialNumber, String name, String keyword, Integer category, Integer status,
-			String releaseDateStartDate, String releaseDateEndDate, Integer releaseStatus, Integer pNo, Integer pSize) {
+			String releaseDateStartDate, String releaseDateEndDate, Integer releaseStatus, Integer pNo, Integer pSize,
+			Integer boutique,Integer hot) {
 		if (pNo == null || pNo < 0) {
 			pNo = 1;
 		}
@@ -122,7 +124,7 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 		return (Pagination<AchievementListBo>) findPage("findOrgOwnerAchievementListByPage",
 				"findOrgOwnerAchievementCount",
 				disposeParams(unitName, ownerName, ownerId, auditStatus, serialNumber, name, keyword, category, status,
-						releaseDateStartDate, releaseDateEndDate, releaseStatus, UserType.ORGANIZATION.getCode()),
+						releaseDateStartDate, releaseDateEndDate, releaseStatus, UserType.ORGANIZATION.getCode(),boutique,hot),
 				pNo, pSize);
 	}
 
@@ -204,13 +206,13 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 		}
 		return (Pagination<AchievementListBo>) findPage("findAchievementListByPage",
 				"findAchievementCount", disposeParams(null, null, TokenManager.getUserId(), auditStatus, serialNumber,
-						name, keyword, category, status, releaseDateStartDate, releaseDateEndDate, releaseStatus, null),
+						name, keyword, category, status, releaseDateStartDate, releaseDateEndDate, releaseStatus, null,null,null),
 				pNo, pSize);
 	}
 
 	private Map<String, Object> disposeParams(String username, String ownerName, String ownerId, Integer auditStatus,
 			Integer serialNumber, String name, String keyword, Integer category, Integer status,
-			String releaseDateStartDate, String releaseDateEndDate, Integer releaseStatus, Integer type) {
+			String releaseDateStartDate, String releaseDateEndDate, Integer releaseStatus, Integer type,Integer boutique,Integer hot) {
 		Map<String, Object> params = new HashMap<>();
 
 		Date rStart = null;
@@ -281,7 +283,12 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 		if (null != releaseStatus) {
 			params.put("releaseStatus", releaseStatus);
 		}
-
+		if (null != boutique){
+			params.put("boutique", boutique);
+		}
+		if(null != hot){
+			params.put("hot", hot);
+		}
 		if (TokenManager.hasRole(AFTConstants.TECHBROKER)) {
 			params.put("techBrokerId", TokenManager.getAdminId());
 		}

+ 69 - 8
src/main/java/com/goafanti/admin/controller/AdminAchievementApiController.java

@@ -34,12 +34,15 @@ import com.goafanti.common.enums.AchievementReleaseStatus;
 import com.goafanti.common.enums.AchievementSwitchSign;
 import com.goafanti.common.enums.AttachmentType;
 import com.goafanti.common.enums.DeleteStatus;
+import com.goafanti.common.enums.MarketingPage;
 import com.goafanti.common.model.Achievement;
 import com.goafanti.common.model.AchievementOrder;
 import com.goafanti.common.model.AftFile;
+import com.goafanti.common.model.MarketingManagement;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.marketing.service.MarketingManagementService;
 import com.goafanti.user.service.UserService;
 @RestController
 @RequestMapping(value = "/api/admin/achievement")
@@ -52,6 +55,8 @@ public class AdminAchievementApiController extends CertifyApiController {
     private AftFileService			aftFileService;
     @Resource
     private AchievementOrderService	achievementOrderService;
+    @Resource
+    private MarketingManagementService marketingManagementService;
     /**
      * 个人成果列表
      */
@@ -59,7 +64,7 @@ public class AdminAchievementApiController extends CertifyApiController {
     private Result userList(String username, String ownerName, String ownerId, Integer auditStatus,
             Integer serialNumber, String name, String keyword, Integer category, Integer status,
             String releaseDateStartDate, String releaseDateEndDate, Integer releaseStatus, String pageNo,
-            String pageSize) {
+            String pageSize,Integer boutique,Integer hot) {
         Result res = new Result();
         Integer pNo = 1;
         Integer pSize = 10;
@@ -70,7 +75,7 @@ public class AdminAchievementApiController extends CertifyApiController {
             pNo = Integer.parseInt(pageNo);
         }
         res.setData(achievementService.listUserOwnerAchievement(username, ownerName, ownerId, auditStatus, serialNumber, name,
-                keyword, category, status, releaseDateStartDate, releaseDateEndDate, releaseStatus, pNo, pSize));
+                keyword, category, status, releaseDateStartDate, releaseDateEndDate, releaseStatus, pNo, pSize,boutique,hot));
         return res;
     }
     /**
@@ -79,7 +84,7 @@ public class AdminAchievementApiController extends CertifyApiController {
     @RequestMapping(value = "/orgList", method = RequestMethod.GET)
     private Result orgList(String unitName, String ownerName, String ownerId, Integer auditStatus, Integer serialNumber, String name,
             String keyword, Integer category, Integer status, String releaseDateStartDate, String releaseDateEndDate,
-            Integer releaseStatus, String pageNo, String pageSize) {
+            Integer releaseStatus, String pageNo, String pageSize,Integer boutique,Integer hot) {
         Result res = new Result();
         Integer pNo = 1;
         Integer pSize = 10;
@@ -90,7 +95,7 @@ public class AdminAchievementApiController extends CertifyApiController {
             pNo = Integer.parseInt(pageNo);
         }
         res.setData(achievementService.listOrgOwnerAchievement(unitName, ownerName, ownerId, auditStatus, serialNumber, name,
-                keyword, category, status, releaseDateStartDate, releaseDateEndDate, releaseStatus, pNo, pSize));
+                keyword, category, status, releaseDateStartDate, releaseDateEndDate, releaseStatus, pNo, pSize,boutique,hot));
         return res;
     }
     /**
@@ -148,7 +153,7 @@ public class AdminAchievementApiController extends CertifyApiController {
      */
     @RequestMapping(value = "/apply", method = RequestMethod.POST)
     private Result apply(@Valid InputAchievement ia, BindingResult bindingResult,
-            @RequestParam(name = "keywords[]", required = false) String[] keywords) {
+            @RequestParam(name = "keywords[]", required = false) String[] keywords,String coverImg,Integer hot) {
         Result res = new Result();
         if (bindingResult.hasErrors()) {
             res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
@@ -166,6 +171,22 @@ public class AdminAchievementApiController extends CertifyApiController {
         Achievement a = new Achievement();
         BeanUtils.copyProperties(ia, a);
         achievementService.saveAchievement(a, keywords);
+        if(null != hot && hot == 1){ //属于营销活动
+        	int marketHisCount = marketingManagementService.getMarketingCount(
+        			MarketingPage.mainAchievement.getPageUrl(), MarketingPage.mainAchievement.getBoothType(),1);
+        	if(marketHisCount >= MarketingPage.mainAchievement.getBoothSize()) { //展位已满
+        		 res.getError().add(buildError(ErrorConstants.MARKET_BOOTH_MAX, "",marketHisCount));
+        		 return res;
+        	}else{ //保存营销记录
+        		MarketingManagement mm = new MarketingManagement();
+        		mm.setShowPage(MarketingPage.mainAchievement.getPageUrl()); //营销页面
+        		mm.setCategory(MarketingPage.mainAchievement.getBoothType()); //营销分类
+            	if(StringUtils.isNotBlank(coverImg)) mm.setCoverImg(coverImg);
+            	mm.setProductId(a.getId());
+            	mm.setEffective(1);
+        		marketingManagementService.save(mm);
+        	}    	
+        }      
         return res;
     }
     /**
@@ -173,7 +194,7 @@ public class AdminAchievementApiController extends CertifyApiController {
      */
     @RequestMapping(value = "/update", method = RequestMethod.POST)
     public Result update(@Valid InputAchievement ia, BindingResult bindingResult, Integer switchSign,
-            @RequestParam(name = "keywords[]", required = false) String[] keywords) {
+            @RequestParam(name = "keywords[]", required = false) String[] keywords,String coverImg,Integer hot) {
         Result res = new Result();
         if (bindingResult.hasErrors()) {
             res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
@@ -210,7 +231,45 @@ public class AdminAchievementApiController extends CertifyApiController {
         Achievement a = new Achievement();
         BeanUtils.copyProperties(ia, a);
         achievementService.updateAchievement(a, keywords, switchSign);
-        return res;
+        //更新营销活动
+       MarketingManagement mm = marketingManagementService.selectMarket(
+    		   MarketingPage.mainAchievement.getPageUrl(), MarketingPage.mainAchievement.getBoothType(), a.getId());
+       if (null != mm) {
+			if(mm.getEffective() == 1){ //原本属于营销有效
+				if (null != coverImg) mm.setCoverImg(coverImg);
+				if (null != hot) mm.setEffective(hot);
+				marketingManagementService.update(mm);
+			}else if(mm.getEffective() == 0){ //原本属于营销无效
+				int marketHisCount = marketingManagementService.getMarketingCount(
+						MarketingPage.mainAchievement.getPageUrl(), MarketingPage.mainAchievement.getBoothType(), 1);
+				if (marketHisCount >= MarketingPage.mainAchievement.getBoothSize()) { // 展位已满
+					res.getError().add(buildError(ErrorConstants.MARKET_BOOTH_MAX,"", marketHisCount));
+					return res;
+				}else{
+					if (null != hot) mm.setEffective(hot);
+					if (null != coverImg) mm.setCoverImg(coverImg);
+					marketingManagementService.update(mm);
+				}
+			}
+		}else{
+    	   if(null != hot && hot == 1){ //属于营销活动
+           	int marketHisCount = marketingManagementService.getMarketingCount(
+           			MarketingPage.mainAchievement.getPageUrl(), MarketingPage.mainAchievement.getBoothType(),1);
+           	if(marketHisCount >= MarketingPage.mainAchievement.getBoothSize()) { //展位已满
+           		 res.getError().add(buildError(ErrorConstants.MARKET_BOOTH_MAX, "",marketHisCount));
+           		 return res;
+           	}else{ //保存营销记录
+           		mm = new MarketingManagement();
+           		mm.setShowPage(MarketingPage.mainAchievement.getPageUrl()); //营销页面
+           		mm.setCategory(MarketingPage.mainAchievement.getBoothType()); //营销分类
+               	if(StringUtils.isNotBlank(coverImg)) mm.setCoverImg(coverImg);
+               	mm.setProductId(a.getId());
+               	mm.setEffective(1);
+           		marketingManagementService.save(mm);
+           	}    	
+           } 
+       }    
+       return res;
     }
     /**
      * 科技成果匹配科技需求
@@ -399,7 +458,8 @@ public class AdminAchievementApiController extends CertifyApiController {
         Result res = new Result();
         AttachmentType attachmentType = AttachmentType.getField(sign);
         if (attachmentType == AttachmentType.ACHIEVEMENT_TECHNICAL_PICTURE
-                || attachmentType == AttachmentType.ACHIEVEMENT_MATURITY_PICTURE) {
+                || attachmentType == AttachmentType.ACHIEVEMENT_MATURITY_PICTURE
+                || attachmentType == AttachmentType.ACHIEVEMENT_COVER_PICTURE) {
             res.setData(handleFiles(res, "/achievement/", false, req, sign, "achievement"));
         } else {
             res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
@@ -422,6 +482,7 @@ public class AdminAchievementApiController extends CertifyApiController {
                     return res;
                 }
             }
+            marketingManagementService.deleteByProductId(Arrays.asList(ids));
             res.setData(achievementService.deleteByPrimaryKey(Arrays.asList(ids)));
         }
         return res;

+ 67 - 9
src/main/java/com/goafanti/admin/controller/AdminDemandApiController.java

@@ -36,9 +36,11 @@ import com.goafanti.common.enums.DemandImportFields;
 import com.goafanti.common.enums.DemandOrderStatus;
 import com.goafanti.common.enums.DemandReleaseStatus;
 import com.goafanti.common.enums.DemandSwitchSign;
+import com.goafanti.common.enums.MarketingPage;
 import com.goafanti.common.model.AftFile;
 import com.goafanti.common.model.Demand;
 import com.goafanti.common.model.DemandOrder;
+import com.goafanti.common.model.MarketingManagement;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.shiro.token.TokenManager;
@@ -46,6 +48,7 @@ import com.goafanti.demand.bo.DemandImportBo;
 import com.goafanti.demand.bo.InputDemand;
 import com.goafanti.demand.service.DemandOrderService;
 import com.goafanti.demand.service.DemandService;
+import com.goafanti.marketing.service.MarketingManagementService;
 import com.goafanti.user.service.UserService;
 
 @RestController
@@ -59,7 +62,8 @@ public class AdminDemandApiController extends CertifyApiController {
 	private AftFileService		aftFileService;
 	@Resource
 	private DemandOrderService	demandOrderService;
-
+	@Resource
+    private MarketingManagementService marketingManagementService;
 	/**
 	 * 科技需求匹配科技成果
 	 */
@@ -192,7 +196,7 @@ public class AdminDemandApiController extends CertifyApiController {
 	public Result userList(String employerName, Integer auditStatus, Integer province, Integer serialNumber, String name, String keyword,
 			Integer infoSources, Integer demandType, String validityPeriodStartDate, String validityPeriodEndDate,
 			String username, Integer status, Integer releaseStatus, String releaseDateStartDate,
-			String releaseDateEndDate, String pageNo, String pageSize) {
+			String releaseDateEndDate, String pageNo, String pageSize,Integer boutique,Integer hot) {
 		Result res = new Result();
 		Integer pNo = 1;
 		Integer pSize = 10;
@@ -205,7 +209,7 @@ public class AdminDemandApiController extends CertifyApiController {
 		}
 		res.setData(demandService.selectUserDemandManageList(employerName, auditStatus, province, serialNumber, name, keyword,
 				infoSources, demandType, validityPeriodStartDate, validityPeriodEndDate, username, status,
-				releaseStatus, releaseDateStartDate, releaseDateEndDate, pNo, pSize));
+				releaseStatus, releaseDateStartDate, releaseDateEndDate, pNo, pSize,boutique,hot));
 		return res;
 	}
 
@@ -216,7 +220,7 @@ public class AdminDemandApiController extends CertifyApiController {
 	public Result orgList(String employerName, Integer auditStatus, Integer province, Integer serialNumber, String name, String keyword,
 			Integer infoSources, Integer demandType, String validityPeriodStartDate, String validityPeriodEndDate,
 			String unitName, Integer status, Integer releaseStatus, String releaseDateStartDate,
-			String releaseDateEndDate, String pageNo, String pageSize) {
+			String releaseDateEndDate, String pageNo, String pageSize,Integer boutique,Integer hot) {
 		Result res = new Result();
 		Integer pNo = 1;
 		Integer pSize = 10;
@@ -229,7 +233,7 @@ public class AdminDemandApiController extends CertifyApiController {
 		}
 		res.setData(demandService.selectOrgDemandManageList(employerName, auditStatus, province, serialNumber, name, keyword,
 				infoSources, demandType, validityPeriodStartDate, validityPeriodEndDate, unitName, status,
-				releaseStatus, releaseDateStartDate, releaseDateEndDate, pNo, pSize));
+				releaseStatus, releaseDateStartDate, releaseDateEndDate, pNo, pSize,boutique,hot));
 		return res;
 	}
 
@@ -239,7 +243,7 @@ public class AdminDemandApiController extends CertifyApiController {
 	@RequestMapping(value = "/apply", method = RequestMethod.POST)
 	public Result userApply(@Valid InputDemand demand, BindingResult bindingResult,
 			@RequestParam(name = "keywords[]", required = false) String[] keywords,
-			String validityPeriodFormattedDate) {
+			String validityPeriodFormattedDate,String coverImg,Integer hot) {
 		Result res = new Result();
 		if (bindingResult.hasErrors()) {
 			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
@@ -256,10 +260,25 @@ public class AdminDemandApiController extends CertifyApiController {
 		if (!res.getError().isEmpty()) {
 			return res;
 		}
-
 		Demand d = new Demand();
 		BeanUtils.copyProperties(demand, d);
 		demandService.saveUserDemand(d, validityPeriodFormattedDate, keywords);
+		if (null != hot && hot == 1) { // 属于营销活动
+			int marketHisCount = marketingManagementService.getMarketingCount(MarketingPage.mainDemand.getPageUrl(),
+					MarketingPage.mainDemand.getBoothType(), 1);
+			if (marketHisCount >= MarketingPage.mainDemand.getBoothSize()) { // 展位已满
+				res.getError().add(buildError(ErrorConstants.MARKET_BOOTH_MAX, "",marketHisCount));
+				return res;
+			} else { // 保存营销记录
+				MarketingManagement mm = new MarketingManagement();
+				mm.setShowPage(MarketingPage.mainDemand.getPageUrl()); // 营销页面
+				mm.setCategory(MarketingPage.mainDemand.getBoothType()); // 营销分类
+				if (StringUtils.isNotBlank(coverImg)) mm.setCoverImg(coverImg);
+				mm.setProductId(d.getId());
+				mm.setEffective(1);
+				marketingManagementService.save(mm);
+			}
+		}
 		return res;
 	}
 
@@ -328,7 +347,7 @@ public class AdminDemandApiController extends CertifyApiController {
 
 		AttachmentType attachmentType = AttachmentType.getField(sign);
 
-		if (attachmentType == AttachmentType.DEMAND_PICTURE) {
+		if (attachmentType == AttachmentType.DEMAND_PICTURE|| attachmentType == AttachmentType.DEMAND_COVER_PICTURE) {
 			res.setData(handleFiles(res, "/demand/", false, req, sign, uid));
 		} else {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
@@ -365,7 +384,7 @@ public class AdminDemandApiController extends CertifyApiController {
 	@RequestMapping(value = "/update", method = RequestMethod.POST)
 	public Result updateUser(@Valid InputDemand demand, BindingResult bindingResult, Integer switchSign,
 			@RequestParam(name = "keywords[]", required = false) String[] keywords,
-			String validityPeriodFormattedDate) {
+			String validityPeriodFormattedDate,String coverImg,Integer hot) {
 		Result res = new Result();
 		if (bindingResult.hasErrors()) {
 			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
@@ -404,6 +423,44 @@ public class AdminDemandApiController extends CertifyApiController {
 		Demand d = new Demand();
 		BeanUtils.copyProperties(demand, d);
 		res.setData(demandService.updateUserDemand(d, validityPeriodFormattedDate, keywords, switchSign));
+		// 更新营销活动
+		MarketingManagement mm = marketingManagementService.selectMarket(MarketingPage.mainDemand.getPageUrl(),
+				MarketingPage.mainDemand.getBoothType(), d.getId());
+		if (null != mm) {
+			if(mm.getEffective() == 1){
+				if (null != coverImg) mm.setCoverImg(coverImg);
+				if (null != hot) mm.setEffective(hot);
+				marketingManagementService.update(mm);
+			}else if(mm.getEffective() == 0){
+				int marketHisCount = marketingManagementService.getMarketingCount(
+						MarketingPage.mainDemand.getPageUrl(), MarketingPage.mainDemand.getBoothType(), 1);
+				if (marketHisCount >= MarketingPage.mainDemand.getBoothSize()) { // 展位已满
+					res.getError().add(buildError(ErrorConstants.MARKET_BOOTH_MAX,"", marketHisCount));
+					return res;
+				}else{
+					if (null != hot) mm.setEffective(hot);
+					if (null != coverImg) mm.setCoverImg(coverImg);
+					marketingManagementService.update(mm);
+				}
+			}
+		} else {
+			if (null != hot && hot == 1) { // 属于营销活动
+				int marketHisCount = marketingManagementService.getMarketingCount(
+						MarketingPage.mainDemand.getPageUrl(), MarketingPage.mainDemand.getBoothType(), 1);
+				if (marketHisCount >= MarketingPage.mainDemand.getBoothSize()) { // 展位已满
+					res.getError().add(buildError(ErrorConstants.MARKET_BOOTH_MAX,"", marketHisCount));
+					return res;
+				} else { // 保存营销记录
+					mm = new MarketingManagement();
+					mm.setShowPage(MarketingPage.mainDemand.getPageUrl()); // 营销页面
+					mm.setCategory(MarketingPage.mainDemand.getBoothType()); // 营销分类
+					if (StringUtils.isNotBlank(coverImg)) mm.setCoverImg(coverImg);
+					mm.setProductId(d.getId());
+					mm.setEffective(1);
+					marketingManagementService.save(mm);
+				}
+			}
+		}		
 		return res;
 	}
 
@@ -467,6 +524,7 @@ public class AdminDemandApiController extends CertifyApiController {
 					return res;
 				}
 			}
+			marketingManagementService.deleteByProductId(Arrays.asList(ids));
 			res.setData(demandService.deleteByPrimaryKey(Arrays.asList(ids)));
 		}
 		return res;

+ 2 - 1
src/main/java/com/goafanti/common/constant/ErrorConstants.java

@@ -103,5 +103,6 @@ public class ErrorConstants {
 	public static final String	WRONG_MONEY							= "WRONG_MONEY";
 
 	public static final String	M_CODE_ERROR						= "M_CODE_ERROR";
-
+	
+	public static final String MARKET_BOOTH_MAX						= "MARKET_BOOTH_MAX";				
 }

+ 13 - 1
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -18,11 +18,14 @@ import com.goafanti.banners.enums.BannersType;
 import com.goafanti.banners.service.BannersService;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.enums.AchievementMaturity;
+import com.goafanti.common.enums.MarketingPage;
 import com.goafanti.common.enums.UserType;
 import com.goafanti.common.model.Banners;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.dataGlossory.service.DistrictGlossoryService;
 import com.goafanti.demand.service.DemandService;
+import com.goafanti.marketing.bo.MarketingManagementBo;
+import com.goafanti.marketing.service.MarketingManagementService;
 import com.goafanti.portal.bo.InternationalListBo;
 import com.goafanti.user.bo.UserPartnerDetailBo;
 import com.goafanti.user.service.OrganizationIdentityService;
@@ -57,6 +60,9 @@ public class WebpageController extends BaseController {
 
 	@Resource
 	private NewsService newsService;
+	
+	@Resource
+	private MarketingManagementService marketingManagementService; 
 
 	/**
 	 * 首页
@@ -68,8 +74,14 @@ public class WebpageController extends BaseController {
 		if (!banners.isEmpty()) {
 			modelview.addObject("banner", banners.get(0));
 		}
-		modelview.addObject("zfwl", newsService.findIndexNewsList(0, NewsType.ZFWL.getCode(), 2));
+		//modelview.addObject("zfwl", newsService.findIndexNewsList(0, NewsType.ZFWL.getCode(), 2));
 		modelview.addObject("jtdt", newsService.findIndexNewsList(0, NewsType.JTDT.getCode(), 4));
+		List<MarketingManagementBo> achievementList = marketingManagementService.selectMarketList(
+				MarketingPage.mainAchievement.getPageUrl(), MarketingPage.mainAchievement.getBoothType());
+		List<MarketingManagementBo> demandList = marketingManagementService.selectMarketList(
+				MarketingPage.mainDemand.getPageUrl(), MarketingPage.mainDemand.getBoothType());
+		modelview.addObject("achievementList", achievementList);
+		modelview.addObject("demandList", demandList);
 		return modelview;
 	}
 

+ 33 - 0
src/main/java/com/goafanti/common/dao/MarketingManagementMapper.java

@@ -2,6 +2,8 @@ package com.goafanti.common.dao;
 
 import com.goafanti.common.model.MarketingManagement;
 import com.goafanti.common.model.MarketingManagementExample;
+import com.goafanti.marketing.bo.MarketingManagementBo;
+
 import java.util.List;
 import org.apache.ibatis.annotations.Param;
 
@@ -93,4 +95,35 @@ public interface MarketingManagementMapper {
      * @mbg.generated Tue Sep 26 14:34:04 CST 2017
      */
     int updateByPrimaryKey(MarketingManagement record);
+    
+    /**
+     *  查询营销页面活动数量
+     * @param showPage 
+     * @param category
+     * @param effective
+     * @return
+     */
+     int getMarketingCount(@Param("showPage")String showPage, @Param("category")Integer category, @Param("effective")Integer effective);
+    
+    /**
+     * 查询已有的活动产品
+     * @param showPage
+     * @param category
+     * @param productId
+     */
+    MarketingManagement selectMarket(@Param("showPage")String showPage, @Param("category")Integer category, @Param("productId")String productId);
+
+    /**
+     * 取消营销活动
+     * @param productIds
+     */
+	void deleteByProductId(@Param("productIds")List<String> productIds);
+	
+	/**
+	 * 查询营销活动列表
+	 * @param showPage
+	 * @param category
+	 * @return
+	 */
+	List<MarketingManagementBo> selectMarketList(@Param("showPage")String showPage, @Param("category")Integer category);
 }

+ 91 - 89
src/main/java/com/goafanti/common/enums/AttachmentType.java

@@ -1,89 +1,91 @@
-package com.goafanti.common.enums;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public enum AttachmentType {
-	COPYRIGHT_AUTH("copyright_auth", "软著证书"),
-	COPYRIGHT_APPLY("copyright_apply", "软著申请书"),
-	DEFAULT("attachment", "附件"),
-	PATENT_PRORY_STATEMENT("patent_prory_statement", "专利代理委托书"),
-	PATENT_WRITING("patent_writing", "专利稿件"),
-	AUTHORIZATION_NOTICE("authorization_notice", "授权通知书 "),
-	PATENT_CERTIFICATE("patent_certificate", "专利证书"),
-	PATENT_TEMPLATE("patent_template", "专利代理委托书模版"),
-	INSTITUTION("institution", "研发部门制度"),
-	PROTOCOL("protocol", "产学研技术中心协议"),
-	PROOF("proof", "研发活动立项证明材料"),
-	ACTIVITY_COST_ACCOUNT("activity_cost_account", "研发活动费用台帐"),
-	TECH_PRODUCT("tech_product", "高新技术产品台帐"),
-	PROPERTY_RIGHT("property_right", "知识产权证书"),
-	ACHIEVEMENT("achievement", "科技成果附件"),
-	RATEPAY("ratepay", "企业纳税申报表"),
-	FINANCE("finance", "企业财务报表"),
-	ROSTER("roster", "企业花名册"),
-	SOCIAL_SECURITY("social_security", "企业社保情况表"),
-	HONOR("honor", "荣誉及其他证明材料"),
-	LAST_YEAR_RATEPAY("last_year_ratepay", "上年度纳税申报表"),
-	TECH_PROJECT("tech_project", "科技项目申报材料"),
-	STANDARD("standard", "标准制定附件"),
-	MANUSCRIPT("manuscript", "知识产权稿件"),
-	ORGCODE("orgcode", "组织结构代码证"),
-	LICENCE("licence", "营业执照"),
-	DEMAND_PICTURE("demand_picture", "科技需求图片资料"),
-	DEMAND_TEXT_FILE("demand_text_file", "科技需求文本文件资料"),
-	ACHIEVEMENT_TECHNICAL_PICTURE("achievement_technical_picture", "科技成果技术图片"),
-	ACHIEVEMENT_MATURITY_PICTURE("achievement_maturity_picture", "科技成果成熟度资料图片"),
-	ACHIEVEMENT_MATURITY_TEXT_FILE("achievement_maturity_text_file", "科技成果成熟度资料文本文件"),
-	ACHIEVEMENT_TECH_PLAN("achievement_tech_plan", "科技成果技术方案文件"),
-	ACHIEVEMENT_BUSINESS_PLAN("achievement_business_plan", "科技成果商业计划书"),
-	DEMAND_TEMPLATE("demand_template", "科技需求批量导入模板"),
-	ACHIEVEMENT_TEMPLATE("achievement_template", "科技成果批量导入模板"),
-	DEMAND_ORDER_FILE("demand_order_file", "科技需求意向单/交易单附件"),
-	BANNERS_PIC("banners", "广告图片"),
-	NEWS_TITLE_PICTURE("news_title_picture", "新闻题图图片"),
-	NEWS_CONTENT_PICTURE("news_content_picture", "新闻内容图片"),
-	LECTURE_PICTURE("lecture_picture", "科技讲堂展示图片"),
-	ACTIVITY_TITLE_PICTURE("activity_title_picture", "活动题图"),
-	ACTIVITY_CONTENT_PICTURE("activity_content_picture", "活动内容图片");
-	
-
-	private AttachmentType(String code, String desc) {
-		this.code = code;
-		this.desc = desc;
-	}
-
-	private static Map<String, AttachmentType> status = new HashMap<String, AttachmentType>();
-
-	static {
-		for (AttachmentType value : AttachmentType.values()) {
-			status.put(value.getCode(), value);
-		}
-	}
-
-	public static AttachmentType getField(String code) {
-		if (containsType(code)) {
-			return status.get(code);
-		}
-		return DEFAULT;
-	}
-
-	public static String getFieldDesc(String code) {
-		return getField(code).getDesc();
-	}
-
-	public static boolean containsType(String code) {
-		return status.containsKey(code);
-	}
-
-	private String	code;
-	private String	desc;
-
-	public String getCode() {
-		return code;
-	}
-
-	public String getDesc() {
-		return desc;
-	}
-}
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum AttachmentType {
+	COPYRIGHT_AUTH("copyright_auth", "软著证书"),
+	COPYRIGHT_APPLY("copyright_apply", "软著申请书"),
+	DEFAULT("attachment", "附件"),
+	PATENT_PRORY_STATEMENT("patent_prory_statement", "专利代理委托书"),
+	PATENT_WRITING("patent_writing", "专利稿件"),
+	AUTHORIZATION_NOTICE("authorization_notice", "授权通知书 "),
+	PATENT_CERTIFICATE("patent_certificate", "专利证书"),
+	PATENT_TEMPLATE("patent_template", "专利代理委托书模版"),
+	INSTITUTION("institution", "研发部门制度"),
+	PROTOCOL("protocol", "产学研技术中心协议"),
+	PROOF("proof", "研发活动立项证明材料"),
+	ACTIVITY_COST_ACCOUNT("activity_cost_account", "研发活动费用台帐"),
+	TECH_PRODUCT("tech_product", "高新技术产品台帐"),
+	PROPERTY_RIGHT("property_right", "知识产权证书"),
+	ACHIEVEMENT("achievement", "科技成果附件"),
+	RATEPAY("ratepay", "企业纳税申报表"),
+	FINANCE("finance", "企业财务报表"),
+	ROSTER("roster", "企业花名册"),
+	SOCIAL_SECURITY("social_security", "企业社保情况表"),
+	HONOR("honor", "荣誉及其他证明材料"),
+	LAST_YEAR_RATEPAY("last_year_ratepay", "上年度纳税申报表"),
+	TECH_PROJECT("tech_project", "科技项目申报材料"),
+	STANDARD("standard", "标准制定附件"),
+	MANUSCRIPT("manuscript", "知识产权稿件"),
+	ORGCODE("orgcode", "组织结构代码证"),
+	LICENCE("licence", "营业执照"),
+	DEMAND_PICTURE("demand_picture", "科技需求图片资料"),
+	DEMAND_TEXT_FILE("demand_text_file", "科技需求文本文件资料"),
+	ACHIEVEMENT_TECHNICAL_PICTURE("achievement_technical_picture", "科技成果技术图片"),
+	ACHIEVEMENT_MATURITY_PICTURE("achievement_maturity_picture", "科技成果成熟度资料图片"),
+	ACHIEVEMENT_MATURITY_TEXT_FILE("achievement_maturity_text_file", "科技成果成熟度资料文本文件"),
+	ACHIEVEMENT_TECH_PLAN("achievement_tech_plan", "科技成果技术方案文件"),
+	ACHIEVEMENT_BUSINESS_PLAN("achievement_business_plan", "科技成果商业计划书"),
+	ACHIEVEMENT_COVER_PICTURE("achievement_cover_picture","科技成果封面图"),
+	DEMAND_TEMPLATE("demand_template", "科技需求批量导入模板"),
+	ACHIEVEMENT_TEMPLATE("achievement_template", "科技成果批量导入模板"),
+	DEMAND_ORDER_FILE("demand_order_file", "科技需求意向单/交易单附件"),
+	DEMAND_COVER_PICTURE("demand_cover_picture","科技需求封面图"),
+	BANNERS_PIC("banners", "广告图片"),
+	NEWS_TITLE_PICTURE("news_title_picture", "新闻题图图片"),
+	NEWS_CONTENT_PICTURE("news_content_picture", "新闻内容图片"),
+	LECTURE_PICTURE("lecture_picture", "科技讲堂展示图片"),
+	ACTIVITY_TITLE_PICTURE("activity_title_picture", "活动题图"),
+	ACTIVITY_CONTENT_PICTURE("activity_content_picture", "活动内容图片");
+	
+
+	private AttachmentType(String code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<String, AttachmentType> status = new HashMap<String, AttachmentType>();
+
+	static {
+		for (AttachmentType value : AttachmentType.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static AttachmentType getField(String code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return DEFAULT;
+	}
+
+	public static String getFieldDesc(String code) {
+		return getField(code).getDesc();
+	}
+
+	public static boolean containsType(String code) {
+		return status.containsKey(code);
+	}
+
+	private String	code;
+	private String	desc;
+
+	public String getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+}

+ 26 - 0
src/main/java/com/goafanti/common/enums/MarketingPage.java

@@ -0,0 +1,26 @@
+package com.goafanti.common.enums;
+
+public enum MarketingPage {
+	mainAchievement("/index",1,5), //首页成果
+	mainDemand("/index",2,5),	// 首页需求
+	mainPolicy("/index",6,3); //首页政策
+	
+	MarketingPage(String pageUrl,Integer boothType,Integer boothSize){
+		this.boothSize = boothSize;
+		this.pageUrl = pageUrl;
+		this.boothType = boothType;
+	};
+	private Integer boothSize;
+	private Integer boothType;
+	private String pageUrl;
+	public Integer getBoothSize() {
+		return boothSize;
+	}
+	public Integer getBoothType() {
+		return boothType;
+	}
+	public String getPageUrl() {
+		return pageUrl;
+	}
+
+}

+ 82 - 5
src/main/java/com/goafanti/common/mapper/AchievementMapper.xml

@@ -697,10 +697,25 @@
   		a.id, a.serial_number as serialNumber, a.data_category as dataCategory, 
   		a.name, a.keyword, a.category, a.owner_name as ownerName, a.owner_type as ownerType, 
   		ui.username as username, a.owner_id as ownerId, a.org_id as orgId, a.contacts,
-  		a.release_date as releaseDate, a.audit_status as auditStatus, ad.name as techBrokerId
+  		a.release_date as releaseDate, a.audit_status as auditStatus, ad.name as techBrokerId,a.boutique
+  	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		,1 as hot
+	</if>
+	<if test="hot != null and hot == 0"><!-- 不在首页 -->
+		,0 as hot
+	</if>
+	<if test="hot==null"><!-- 无首页参数 -->
+		,ifnull(mm.effective,0) as hot
+	</if>
   	from achievement a
   	LEFT JOIN admin ad on a.id = a.tech_broker_id
   	LEFT JOIN user_identity ui on a.owner_id = ui.uid
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		inner join marketing_management mm on a.id = mm.product_id
+	</if>
+	<if test="hot == null"> <!-- 无首页参数 -->
+		left join marketing_management mm on a.id = mm.product_id 
+	</if>
   	where a.deleted_sign = 0 and a.owner_type = 0
   	<if test="ownerName != null">
   		and  a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
@@ -742,6 +757,15 @@
 	<if test="techBrokerId != null">
 	   and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
 	</if>
+	<if test="boutique != null">
+		and a.boutique = #{boutique,jdbcType=INTEGER}
+	</if>
+	<if test="hot != null and hot == 0"><!-- 不在首页 -->
+		and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
+	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		and mm.effective = 1
+	</if>
 	order by a.serial_number desc
 	<if test="page_sql!=null">
 			${page_sql}
@@ -752,6 +776,12 @@
   	select 
   		count(1)
   	from achievement
+  	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		inner join marketing_management mm on a.id = mm.product_id
+	</if>
+	<if test="hot == null"> <!-- 无首页参数 -->
+		left join marketing_management mm on a.id = mm.product_id 
+	</if>
   	where deleted_sign = 0 and owner_type = 0
   	<if test="ownerName != null">
   		and  a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
@@ -793,6 +823,15 @@
 	<if test="techBrokerId != null">
 	   and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
 	</if>
+	<if test="boutique != null">
+		and a.boutique = #{boutique,jdbcType=INTEGER}
+	</if>
+	<if test="hot != null and hot = 0"><!-- 不在首页 -->
+		and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
+	</if>
+	<if test="hot != null and hot = 1"><!-- 在首页 -->
+		and mm.effective = 1
+	</if>
   </select>
   
   
@@ -803,9 +842,24 @@
   		a.name, a.keyword, a.category, a.owner_name as ownerName, a.owner_type as ownerType, 
   		oi.unit_name as username, a.owner_id as ownerId, a.org_id as orgId, a.contacts,
   		a.release_date as releaseDate, a.audit_status as auditStatus, ad.name as techBrokerId,a.boutique
+  	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		,1 as hot
+	</if>
+	<if test="hot != null and hot == 0"><!-- 无首页参数 -->
+		,0 as hot
+	</if>
+	<if test="hot==null"><!-- 在首页 -->
+		,ifnull(mm.effective,0) as hot
+	</if>
   	from achievement a
   	LEFT JOIN admin ad on ad.id = a.tech_broker_id
-  	LEFT JOIN organization_identity oi on a.owner_id = oi.uid
+	LEFT JOIN organization_identity oi on a.owner_id = oi.uid
+  	<if test="hot != null and hot == 1"> <!-- 在首页 -->
+		inner join marketing_management mm on a.id = mm.product_id
+	</if>
+	<if test="hot == null"> <!-- 无首页参数 -->
+		left join marketing_management mm on a.id = mm.product_id 
+	</if>
   	where a.deleted_sign = 0 and a.owner_type = 1
   	<if test="ownerName != null">
   		and  a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
@@ -847,6 +901,15 @@
 	<if test="techBrokerId != null">
 	   and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
 	</if>
+	<if test="boutique != null">
+		and a.boutique = #{boutique,jdbcType=INTEGER}
+	</if>
+	<if test="hot != null and hot == 0"><!-- 不在首页 -->
+		and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
+	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		and mm.effective = 1
+	</if>
 	order by serial_number desc
 	<if test="page_sql!=null">
 			${page_sql}
@@ -858,8 +921,14 @@
   		count(1)
   	from achievement a
   	<if test="unitName != null">
-  	LEFT JOIN organization_identity oi on a.owner_id = oi.uid
+  		LEFT JOIN organization_identity oi on a.owner_id = oi.uid
   	</if>
+  	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		inner join marketing_management mm on a.id = mm.product_id
+	</if>
+	<if test="hot == null"> <!-- 无首页参数 -->
+		left join marketing_management mm on a.id = mm.product_id 
+	</if>
   	where a.deleted_sign = 0 and a.owner_type = 1
   	<if test="ownerName != null">
   		and  a.owner_name like CONCAT('%',#{ownerName,jdbcType=VARCHAR},'%')
@@ -901,6 +970,12 @@
 	<if test="techBrokerId != null">
 	   and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
 	</if>
+	<if test="hot != null and hot == 0"><!-- 不在首页 -->
+		and a.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
+	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		and  mm.effective = 1
+	</if>
   </select>
   
   
@@ -1016,10 +1091,11 @@
 		    a.create_time as createTime, a.release_status as releaseStatus, 
 		    a.release_date as releaseDate, a.audit_status as auditStatus, a.tech_broker_id as techBrokerId,
 		    ui.username as iOwnerName, ui.province, ui.city, ui.area, u.email as iOwnerEmail,
-		    ui.id_number as iOwnerIdNumber, u.mobile as iOwnerMobile
+		    ui.id_number as iOwnerIdNumber, u.mobile as iOwnerMobile,a.boutique,ifnull(mm.effective,0) as hot,mm.cover_img as coverImg
     from achievement a
     left join user_identity ui on a.owner_id = ui.uid
     left join user u on u.id = a.owner_id
+    left join marketing_management mm on a.id = mm.product_id
     where a.id = #{id,jdbcType=VARCHAR}
   </select>
   
@@ -1041,10 +1117,11 @@
 		    a.create_time as createTime, a.release_status as releaseStatus, 
 		    a.release_date as releaseDate, a.audit_status as auditStatus, a.tech_broker_id as techBrokerId,
 		    oi.unit_name as iOwnerName, oi.postal_address as iOwnerPostalAddress, u.email as iOwnerEmail,
-		    oi.org_code as iOwnerIdNumber, u.mobile as iOwnerMobile,a.jmrh_flag as jmrhFlag , a.boutique as boutique
+		    oi.org_code as iOwnerIdNumber, u.mobile as iOwnerMobile,a.boutique,ifnull(mm.effective,0) hot,mm.cover_img as coverImg
     from achievement a
     left join organization_identity oi on a.owner_id = oi.uid
     left join user u on u.id = a.owner_id
+    left join marketing_management mm on a.id = mm.product_id
     where a.id = #{id,jdbcType=VARCHAR}
   </select>
   

+ 92 - 7
src/main/java/com/goafanti/common/mapper/DemandMapper.xml

@@ -489,13 +489,28 @@
 	  ui.username, d.demand_type as demandType, d.validity_period as validityPeriod, 
 	  d.employer_name as employerName, ui.province, d.status, 
 	  d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,
-	  d.employer_id as employerId, d.audit_status as auditStatus
+	  d.employer_id as employerId, d.audit_status as auditStatus,d.boutique
+	 <if test="hot != null and hot == 1"><!-- 在首页 -->
+		,1 as hot
+	 </if>
+	 <if test="hot != null and hot == 0"><!-- 不在首页 -->
+		,0 as hot
+	 </if>
+	 <if test="hot==null"><!-- 无首页参数 -->
+		,ifnull(mm.effective,0) as hot
+	 </if>
 	from  demand d 
 	LEFT JOIN user_identity ui on d.employer_id = ui.uid
 	LEFT JOIN admin a on a.id = d.tech_broker_id
 	<if test="adminId != null">
 		LEFT JOIN user u on d.employer_id = u.id
 	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		inner join marketing_management mm on d.id = mm.product_id
+	</if>
+	<if test="hot == null"> <!-- 无首页参数 -->
+		left join marketing_management mm on d.id = mm.product_id 
+	</if>
 	where d.deleted_sign = 0 and d.data_category = 0 
 	<if test="adminId != null">
 		and (u.mid = #{adminId,jdbcType=VARCHAR}
@@ -549,6 +564,15 @@
 	<if test="rEnd != null">
 	   and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
 	</if>
+	<if test="boutique != null">
+		and d.boutique = #{boutique,jdbcType=INTEGER}
+	</if>
+	<if test="hot != null and hot == 0"><!-- 不在首页 -->
+		and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
+	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		and mm.effective = 1
+	</if>
   	order by d.serial_number desc
   	<if test="page_sql!=null">
 		${page_sql}
@@ -556,14 +580,20 @@
   </select>
   
   <select id ="findManageUserDemandCount" parameterType="String" resultType="java.lang.Integer">
-  		select 
-	 count(1)
+  	select 
+	count(1)
 	from  demand d 
 	LEFT JOIN user_identity ui on d.employer_id = ui.uid
 	LEFT JOIN admin a on a.id = d.tech_broker_id
 	<if test="adminId != null">
 		LEFT JOIN user u on d.employer_id = u.id
 	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		inner join marketing_management mm on d.id = mm.product_id
+	</if>
+	<if test="hot == null"> <!-- 无首页参数 -->
+		left join marketing_management mm on d.id = mm.product_id 
+	</if>
 	where d.deleted_sign = 0 and d.data_category = 0 
 	<if test="adminId != null">
 		and (u.mid = #{adminId,jdbcType=VARCHAR}
@@ -617,6 +647,15 @@
 	<if test="rEnd != null">
 	   and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
 	</if>
+	<if test="boutique != null">
+		and d.boutique = #{boutique,jdbcType=INTEGER}
+	</if>
+	<if test="hot != null and hot == 0"><!-- 不在首页 -->
+		and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
+	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		and mm.effective = 1
+	</if>
   </select>
   
    <select id="findManageOrgDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandManageListBo">
@@ -628,12 +667,27 @@
 	  d.release_status as releaseStatus, d.release_date as releaseDate, a.name as techBrokerId,
 	  d.employer_id as employerId, d.audit_status as auditStatus,
 	  d.tech_broker_id as techBrokerId,d.boutique
+	 <if test="hot != null and hot == 1"><!-- 在首页 -->
+		,1 as hot
+	 </if>
+	 <if test="hot != null and hot == 0"><!-- 不在首页 -->
+		,0 as hot
+	 </if>
+	 <if test="hot==null"><!-- 无首页参数 -->
+		,ifnull(mm.effective,0) as hot
+	 </if>
 	from  demand d 
 	LEFT JOIN organization_identity oi on d.employer_id = oi.uid
 	LEFT JOIN admin a on a.id = d.tech_broker_id
 	<if test="adminId != null">
 		LEFT JOIN user u on d.employer_id = u.id
 	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		inner join marketing_management mm on d.id = mm.product_id
+	</if>
+	<if test="hot == null"> <!-- 无首页参数 -->
+		left join marketing_management mm on d.id = mm.product_id 
+	</if>
 	where d.deleted_sign = 0 and d.data_category = 1 
 	<if test="adminId != null">
 		and (u.mid = #{adminId,jdbcType=VARCHAR}
@@ -691,6 +745,15 @@
 	<if test="rEnd != null">
 	   and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
 	</if>
+	<if test="boutique != null">
+		and d.boutique = #{boutique,jdbcType=INTEGER}
+	</if>
+	<if test="hot != null and hot == 0"><!-- 不在首页 -->
+		and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
+	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		and mm.effective = 1
+	</if>
   	order by d.serial_number desc
   	<if test="page_sql!=null">
 			${page_sql}
@@ -698,14 +761,23 @@
   </select>
   
   <select id ="findManageOrgDemandCount" parameterType="String" resultType="java.lang.Integer">
-  		select 
-	 count(1)
+  	select 
+	count(1)
 	from  demand d 
 	LEFT JOIN organization_identity oi on d.employer_id = oi.uid
 	LEFT JOIN admin a on a.id = d.tech_broker_id
 	<if test="adminId != null">
 		LEFT JOIN user u on d.employer_id = u.id
 	</if>
+	<if test="adminId != null">
+		LEFT JOIN user u on d.employer_id = u.id
+	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		inner join marketing_management mm on d.id = mm.product_id
+	</if>
+	<if test="hot == null"> <!-- 无首页参数 -->
+		left join marketing_management mm on d.id = mm.product_id 
+	</if>
 	where d.deleted_sign = 0 and d.data_category = 1
 	<if test="adminId != null">
 		and (u.mid = #{adminId,jdbcType=VARCHAR}
@@ -763,6 +835,15 @@
 	<if test="rEnd != null">
 	   and d.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
 	</if>
+	<if test="boutique != null">
+		and d.boutique = #{boutique,jdbcType=INTEGER}
+	</if>
+	<if test="hot != null and hot == 0"><!-- 不在首页 -->
+		and d.id not in(select mm.product_id from marketing_management mm where mm.effective = 1)
+	</if>
+	<if test="hot != null and hot == 1"><!-- 在首页 -->
+		and mm.effective = 1
+	</if>
   </select>
   
   <select id="selectUserDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandManageDetailBo">
@@ -779,11 +860,13 @@
   		info.postal_address as address, u.email as mailbox,  u.mobile as mobile, d.audit_status as auditStatus,
   		d.employer_address as employerAddress, d.employer_contacts_mobile as employerContactsMobile,
   		d.employer_contacts_mailbox as employerContactsMailbox, d.employer_name as employerName,
-  		d.tech_broker_id as techBrokerId,  u.mobile as contactsName
+  		d.tech_broker_id as techBrokerId,  u.mobile as contactsName,
+  		d.boutique,ifnull(mm.effective,0) as hot,mm.cover_img as coverImg
   	from demand d 
   	left join user_identity ui on ui.uid = d.employer_id
   	left join user_info info on info.uid = d.employer_id
   	left join user u on u.id = d.employer_id
+  	left join marketing_management mm on d.id = mm.product_id
   	where d.data_category = 0 and d.id = #{id,jdbcType=VARCHAR}
   </select>
   
@@ -802,10 +885,12 @@
   		oi.postal_address as address, u.email as mailbox,  d.contacts, d.audit_status as auditStatus,
   		d.tech_broker_id as techBrokerId,
   		d.employer_address as employerAddress, d.employer_contacts_mobile as employerContactsMobile,
-  		d.employer_contacts_mailbox as employerContactsMailbox, d.employer_name as employerName,d.boutique
+  		d.employer_contacts_mailbox as employerContactsMailbox, d.employer_name as employerName,
+  		d.boutique,ifnull(mm.effective,0) as hot,mm.cover_img as coverImg
   	from demand d 
   	left join organization_identity oi on oi.uid = d.employer_id
   	left join user u on u.id = d.employer_id
+  	left join marketing_management mm on d.id = mm.product_id
   	where d.data_category = 1 and d.id = #{id,jdbcType=VARCHAR}
   </select>
   

+ 33 - 0
src/main/java/com/goafanti/common/mapper/MarketingManagementMapper.xml

@@ -330,4 +330,37 @@
       effective = #{effective,jdbcType=INTEGER}
     where id = #{id,jdbcType=VARCHAR}
   </update>
+  <select id="getMarketingCount" resultType="java.lang.Integer">
+  	 select count(0) from marketing_management 
+  	 where show_page = #{showPage,jdbcType=VARCHAR} 
+  	 and category = #{category,jdbcType=INTEGER} 
+  	 and effective = #{effective,jdbcType=INTEGER}
+  </select>
+  <select id="selectMarket"  resultMap="BaseResultMap">
+  	 select 
+  	 <include refid="Base_Column_List" /> 
+  	 from marketing_management
+  	 where show_page = #{showPage,jdbcType=VARCHAR} 
+  	 and category = #{category,jdbcType=INTEGER} 
+  	 and product_id = #{productId,jdbcType=VARCHAR}
+  </select>
+  <select id="deleteByProductId">
+  	update marketing_management set effective = 0
+  	where  product_id in 
+	<foreach item="item"  collection="productIds" open="(" separator="," close=")">
+		#{item}
+	</foreach>
+  </select>
+  <select id="selectMarketList" resultType="com.goafanti.marketing.bo.MarketingManagementBo">
+  	<if test="category == 1"> <!-- 成果 -->
+  		select mm.product_id as productId,x.owner_type as ownerType,x.summary,x.name,mm.cover_img as coverImg
+		from marketing_management mm left join achievement x on mm.product_id = x.id
+		where mm.effective =1 and x.audit_status=3 and x.deleted_sign = 0 and mm.show_page= #{showPage,jdbcType=VARCHAR}
+  	</if>
+  	<if test="category == 2"> <!-- 需求 -->
+  		select mm.product_id as productId,x.demand_type as ownerType,x.name,mm.cover_img as coverImg
+		from marketing_management mm left join demand x on mm.product_id = x.id
+		where mm.effective =1  and x.audit_status =3 and x.deleted_sign = 0 and mm.show_page= #{showPage,jdbcType=VARCHAR}
+  	</if>
+  </select>
 </mapper>

+ 281 - 281
src/main/java/com/goafanti/common/utils/FileUtils.java

@@ -1,281 +1,281 @@
-package com.goafanti.common.utils;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.util.regex.Pattern;
-
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.web.multipart.MultipartFile;
-
-import com.goafanti.common.enums.AttachmentType;
-
-public class FileUtils {
-	@Value(value = "${upload.private.path}")
-	private String					uploadPrivatePath	= null;
-
-	private static final Pattern	SLASH_PATTERN		= Pattern.compile("^/|/$");
-	private static final String		SLASH				= "/";
-	private static final String		UNDERLINE			= "_";
-
-	/**
-	 * response 输出JSON
-	 * 
-	 * @param hresponse
-	 * @param resultMap
-	 * @throws IOException
-	 */
-	public static void out(HttpServletResponse response, String jsonStr) {
-		PrintWriter out = null;
-		try {
-			response.setHeader("Content-Type", "application/json");
-			response.setCharacterEncoding("UTF-8");
-			out = response.getWriter();
-			out.println(jsonStr);
-		} catch (Exception e) {
-			LoggerUtils.fmtError(FileUtils.class, e, "输出数据失败");
-		} finally {
-			if (null != out) {
-				out.flush();
-				out.close();
-			}
-		}
-	}
-
-	/**
-	 * Excel报表导出
-	 * 
-	 * @param response
-	 * @param fileName
-	 * @param workbook
-	 */
-	public static void downloadExcel(HttpServletResponse response, String fileName, HSSFWorkbook workbook) {
-		String fn = null;
-		try {
-			fn = URLEncoder.encode(fileName, "UTF-8");
-		} catch (UnsupportedEncodingException e1) {
-			fn = fileName;
-		}
-		response.setContentType("application/x-download;charset=UTF-8");
-		response.setHeader("Content-Disposition", "attachment; filename=\"" + fn + "\";");
-		OutputStream out = null;
-		try {
-			out = response.getOutputStream();
-			workbook.write(out);
-		} catch (IOException e) {
-			LoggerUtils.fmtError(FileUtils.class, e, "输出Excel失败");
-		} finally {
-			if (null != out) {
-				try {
-					out.flush();
-					out.close();
-				} catch (IOException e) {
-					out = null;
-				}
-			}
-		}
-	}
-
-	/**
-	 * 根据上传文件 拼接fileName
-	 * 
-	 * @param mf
-	 * @param isPrivate
-	 * @param sign
-	 * @param path
-	 * @return
-	 */
-	public static String mosaicFileName(MultipartFile mf, boolean isPrivate, String sign, String path, String uid) {
-		String suffix = mf.getOriginalFilename().substring(mf.getOriginalFilename().lastIndexOf("."));
-		boolean uniq = false;
-		if (sign.indexOf("protocol") != -1 || sign.indexOf("achievement") != -1 || sign.indexOf("honor") != -1
-				|| sign.indexOf("proof") != -1 || sign.indexOf("activity_cost_account") != -1
-				|| sign.indexOf("tech_product") != -1 || sign.indexOf("property_ritht") != -1
-				|| sign.indexOf("tech_project") != -1 || sign.indexOf("patent_prory_statement") != -1
-				|| sign.indexOf("patent_writing") != -1 || sign.indexOf("authorization_notice") != -1
-				|| sign.indexOf("patent_certificate") != -1 || sign.indexOf("standard") != -1
-				|| sign.indexOf("demand_picture") != -1 || sign.indexOf("demand_text_file") != -1
-				|| sign.indexOf("achievement_technical_picture") != -1
-				|| sign.indexOf("achievement_maturity_picture") != -1 || sign.indexOf("demand_order_file") != -1
-				|| sign.indexOf("lecture_picture") != -1
-				|| sign.indexOf("news") != -1) {
-			uniq = true;
-		}
-		String fileName = "";
-		if (isPrivate || sign != "") {
-			if (uniq) {
-				fileName = path + uid + "/" + System.nanoTime() + "_" + sign + suffix;
-			} else {
-				fileName = path + uid + "/" + sign + suffix;
-			}
-		} else {
-			fileName = path + uid + "/" + System.nanoTime() + suffix;
-		}
-		return fileName;
-	}
-
-	/**
-	 * 获取下载文件名称
-	 * 
-	 * @param path
-	 * @return
-	 */
-	public static String getDownloadFileName(String path) {
-		if (StringUtils.isBlank(path) || path.lastIndexOf(".") < 0) {
-			return null;
-		}
-		String prefix = "附件";
-		String suffix = path.substring(path.lastIndexOf("."));
-		if (path.indexOf(AttachmentType.PATENT_PRORY_STATEMENT.getCode()) != -1) {
-			prefix = "专利代理委托书";
-		} else if (path.indexOf(AttachmentType.PATENT_WRITING.getCode()) != -1) {
-			prefix = "专利稿件";
-		} else if (path.indexOf(AttachmentType.AUTHORIZATION_NOTICE.getCode()) != -1) {
-			prefix = "授权通知书";
-		} else if (path.indexOf(AttachmentType.PATENT_CERTIFICATE.getCode()) != -1) {
-			prefix = "专利证书";
-		} else if (path.indexOf(AttachmentType.PROOF.getCode()) != -1) {
-			prefix = "立项证明材料";
-		} else if (path.indexOf(AttachmentType.ACTIVITY_COST_ACCOUNT.getCode()) != -1) {
-			prefix = "研发活动费用台帐";
-		} else if (path.indexOf(AttachmentType.TECH_PRODUCT.getCode()) != -1) {
-			prefix = "高新技术产品台帐";
-		} else if (path.indexOf(AttachmentType.PROPERTY_RIGHT.getCode()) != -1) {
-			prefix = "知识产权证书";
-		} else if (path.indexOf(AttachmentType.ROSTER.getCode()) != -1) {
-			prefix = subStr(path) + "花名册";
-		} else if (path.indexOf(AttachmentType.SOCIAL_SECURITY.getCode()) != -1) {
-			prefix = subStr(path) + "社保情况";
-		} else if (path.indexOf(AttachmentType.HONOR.getCode()) != -1) {
-			prefix = "荣誉材料证明";
-		} else if (path.indexOf(AttachmentType.ACHIEVEMENT.getCode()) != -1) {
-			prefix = "科技成果附件";
-		} else if (path.indexOf(AttachmentType.INSTITUTION.getCode()) != -1) {
-			prefix = "制度目录";
-		} else if (path.indexOf(AttachmentType.PROTOCOL.getCode()) != -1) {
-			prefix = "技术协议";
-		} else if (path.indexOf(AttachmentType.FINANCE.getCode()) != -1) {
-			prefix = subStr(path) + "财务报表";
-		} else if (path.indexOf(AttachmentType.RATEPAY.getCode()) != -1) {
-			prefix = subStr(path) + "纳税申报表";
-		} else if (path.indexOf(AttachmentType.TECH_PROJECT.getCode()) != -1) {
-			prefix = "科技项目资料";
-		} else if (path.indexOf(AttachmentType.STANDARD.getCode()) != -1) {
-			prefix = "标准制定";
-		} else if (path.indexOf(AttachmentType.MANUSCRIPT.getCode()) != -1) {
-			prefix = "稿件";
-		} else if (path.indexOf(AttachmentType.DEMAND_TEXT_FILE.getCode()) != -1) {
-			prefix = "科技需求文本文件资料";
-		} else if (path.indexOf(AttachmentType.ACHIEVEMENT_MATURITY_TEXT_FILE.getCode()) != -1) {
-			prefix = "科技成果成熟度资料文本文件";
-		} else if (path.indexOf(AttachmentType.ACHIEVEMENT_TECH_PLAN.getCode()) != -1) {
-			prefix = "科技成果技术方案文件";
-		} else if (path.indexOf(AttachmentType.ACHIEVEMENT_BUSINESS_PLAN.getCode()) != -1) {
-			prefix = "科技成果商业计划书";
-		}
-
-		return prefix + suffix;
-	}
-
-	public static String getSuffix(String path) {
-		if (StringUtils.isBlank(path) || path.lastIndexOf(".") < 0) {
-			return "";
-		}
-		return path.substring(path.lastIndexOf("."));
-	}
-
-	/**
-	 * 拼接文件路径
-	 * 
-	 * @param root
-	 * @param params
-	 * @return
-	 */
-	public static String buildFilePath(String... params) {
-		StringBuilder sb = new StringBuilder();
-		if (params != null) {
-			for (String s : params) {
-				sb.append(SLASH);
-				sb.append(SLASH_PATTERN.matcher(s).replaceAll(""));
-			}
-		}
-		return sb.toString();
-	}
-
-	/**
-	 * 拼接文件名字
-	 * 
-	 * @param root
-	 * @param params
-	 * @return
-	 */
-	public static String buildFileName(String... params) {
-		return StringUtils.join(params, UNDERLINE);
-	}
-
-	// year
-	private static String subStr(String s) {
-		return "企业" + s.substring(s.lastIndexOf(UNDERLINE) + 1, s.lastIndexOf("."));
-	}
-
-	public static boolean deleteFile(String realFilePath) {
-		return new File(realFilePath).delete();
-	}
-
-	/**
-	 * 
-	 * @param response
-	 * @param fileName
-	 * @param realFilePath
-	 */
-	public static void downloadFile(HttpServletResponse response, String fileName, String realFilePath) {
-		InputStream in = null;
-		OutputStream out = null;
-		byte[] buffer = new byte[8 * 1024];
-		try {
-			File file = new File(realFilePath);
-			in = new FileInputStream(file);
-			out = response.getOutputStream();
-			// 设置文件MIME类型
-			response.setContentType("application/octet-stream");
-			fileName = java.net.URLEncoder.encode(fileName, "UTF-8");
-			response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
-			response.setHeader("Content-Length", String.valueOf(file.length()));
-			for (;;) {
-				int bytes = in.read(buffer);
-				if (bytes == -1) {
-					break;
-				}
-				out.write(buffer, 0, bytes);
-			}
-		} catch (IOException e) {
-			LoggerUtils.fmtError(FileUtils.class, e, "IO错误:%s", e.getMessage());
-		} finally {
-			try {
-				if (in != null) {
-					in.close();
-				}
-			} catch (IOException e) {
-				in = null;
-				LoggerUtils.fmtError(FileUtils.class, e, "IO错误:%s", e.getMessage());
-			}
-			try {
-				if (out != null) {
-					out.close();
-				}
-			} catch (IOException e) {
-				out = null;
-				LoggerUtils.fmtError(FileUtils.class, e, "IO错误:%s", e.getMessage());
-			}
-		}
-	}
-
-}
+package com.goafanti.common.utils;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.regex.Pattern;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.multipart.MultipartFile;
+
+import com.goafanti.common.enums.AttachmentType;
+
+public class FileUtils {
+	@Value(value = "${upload.private.path}")
+	private String					uploadPrivatePath	= null;
+
+	private static final Pattern	SLASH_PATTERN		= Pattern.compile("^/|/$");
+	private static final String		SLASH				= "/";
+	private static final String		UNDERLINE			= "_";
+
+	/**
+	 * response 输出JSON
+	 * 
+	 * @param hresponse
+	 * @param resultMap
+	 * @throws IOException
+	 */
+	public static void out(HttpServletResponse response, String jsonStr) {
+		PrintWriter out = null;
+		try {
+			response.setHeader("Content-Type", "application/json");
+			response.setCharacterEncoding("UTF-8");
+			out = response.getWriter();
+			out.println(jsonStr);
+		} catch (Exception e) {
+			LoggerUtils.fmtError(FileUtils.class, e, "输出数据失败");
+		} finally {
+			if (null != out) {
+				out.flush();
+				out.close();
+			}
+		}
+	}
+
+	/**
+	 * Excel报表导出
+	 * 
+	 * @param response
+	 * @param fileName
+	 * @param workbook
+	 */
+	public static void downloadExcel(HttpServletResponse response, String fileName, HSSFWorkbook workbook) {
+		String fn = null;
+		try {
+			fn = URLEncoder.encode(fileName, "UTF-8");
+		} catch (UnsupportedEncodingException e1) {
+			fn = fileName;
+		}
+		response.setContentType("application/x-download;charset=UTF-8");
+		response.setHeader("Content-Disposition", "attachment; filename=\"" + fn + "\";");
+		OutputStream out = null;
+		try {
+			out = response.getOutputStream();
+			workbook.write(out);
+		} catch (IOException e) {
+			LoggerUtils.fmtError(FileUtils.class, e, "输出Excel失败");
+		} finally {
+			if (null != out) {
+				try {
+					out.flush();
+					out.close();
+				} catch (IOException e) {
+					out = null;
+				}
+			}
+		}
+	}
+
+	/**
+	 * 根据上传文件 拼接fileName
+	 * 
+	 * @param mf
+	 * @param isPrivate
+	 * @param sign
+	 * @param path
+	 * @return
+	 */
+	public static String mosaicFileName(MultipartFile mf, boolean isPrivate, String sign, String path, String uid) {
+		String suffix = mf.getOriginalFilename().substring(mf.getOriginalFilename().lastIndexOf("."));
+		boolean uniq = false;
+		if (sign.indexOf("protocol") != -1 || sign.indexOf("achievement") != -1 || sign.indexOf("honor") != -1
+				|| sign.indexOf("proof") != -1 || sign.indexOf("activity_cost_account") != -1
+				|| sign.indexOf("tech_product") != -1 || sign.indexOf("property_ritht") != -1
+				|| sign.indexOf("tech_project") != -1 || sign.indexOf("patent_prory_statement") != -1
+				|| sign.indexOf("patent_writing") != -1 || sign.indexOf("authorization_notice") != -1
+				|| sign.indexOf("patent_certificate") != -1 || sign.indexOf("standard") != -1
+				|| sign.indexOf("demand_picture") != -1 || sign.indexOf("demand_text_file") != -1
+				|| sign.indexOf("achievement_technical_picture") != -1
+				|| sign.indexOf("achievement_maturity_picture") != -1 || sign.indexOf("demand_order_file") != -1
+				|| sign.indexOf("lecture_picture") != -1|| sign.indexOf("cover_picture") != -1 
+				|| sign.indexOf("news") != -1) {
+			uniq = true;
+		}
+		String fileName = "";
+		if (isPrivate || sign != "") {
+			if (uniq) {
+				fileName = path + uid + "/" + System.nanoTime() + "_" + sign + suffix;
+			} else {
+				fileName = path + uid + "/" + sign + suffix;
+			}
+		} else {
+			fileName = path + uid + "/" + System.nanoTime() + suffix;
+		}
+		return fileName;
+	}
+
+	/**
+	 * 获取下载文件名称
+	 * 
+	 * @param path
+	 * @return
+	 */
+	public static String getDownloadFileName(String path) {
+		if (StringUtils.isBlank(path) || path.lastIndexOf(".") < 0) {
+			return null;
+		}
+		String prefix = "附件";
+		String suffix = path.substring(path.lastIndexOf("."));
+		if (path.indexOf(AttachmentType.PATENT_PRORY_STATEMENT.getCode()) != -1) {
+			prefix = "专利代理委托书";
+		} else if (path.indexOf(AttachmentType.PATENT_WRITING.getCode()) != -1) {
+			prefix = "专利稿件";
+		} else if (path.indexOf(AttachmentType.AUTHORIZATION_NOTICE.getCode()) != -1) {
+			prefix = "授权通知书";
+		} else if (path.indexOf(AttachmentType.PATENT_CERTIFICATE.getCode()) != -1) {
+			prefix = "专利证书";
+		} else if (path.indexOf(AttachmentType.PROOF.getCode()) != -1) {
+			prefix = "立项证明材料";
+		} else if (path.indexOf(AttachmentType.ACTIVITY_COST_ACCOUNT.getCode()) != -1) {
+			prefix = "研发活动费用台帐";
+		} else if (path.indexOf(AttachmentType.TECH_PRODUCT.getCode()) != -1) {
+			prefix = "高新技术产品台帐";
+		} else if (path.indexOf(AttachmentType.PROPERTY_RIGHT.getCode()) != -1) {
+			prefix = "知识产权证书";
+		} else if (path.indexOf(AttachmentType.ROSTER.getCode()) != -1) {
+			prefix = subStr(path) + "花名册";
+		} else if (path.indexOf(AttachmentType.SOCIAL_SECURITY.getCode()) != -1) {
+			prefix = subStr(path) + "社保情况";
+		} else if (path.indexOf(AttachmentType.HONOR.getCode()) != -1) {
+			prefix = "荣誉材料证明";
+		} else if (path.indexOf(AttachmentType.ACHIEVEMENT.getCode()) != -1) {
+			prefix = "科技成果附件";
+		} else if (path.indexOf(AttachmentType.INSTITUTION.getCode()) != -1) {
+			prefix = "制度目录";
+		} else if (path.indexOf(AttachmentType.PROTOCOL.getCode()) != -1) {
+			prefix = "技术协议";
+		} else if (path.indexOf(AttachmentType.FINANCE.getCode()) != -1) {
+			prefix = subStr(path) + "财务报表";
+		} else if (path.indexOf(AttachmentType.RATEPAY.getCode()) != -1) {
+			prefix = subStr(path) + "纳税申报表";
+		} else if (path.indexOf(AttachmentType.TECH_PROJECT.getCode()) != -1) {
+			prefix = "科技项目资料";
+		} else if (path.indexOf(AttachmentType.STANDARD.getCode()) != -1) {
+			prefix = "标准制定";
+		} else if (path.indexOf(AttachmentType.MANUSCRIPT.getCode()) != -1) {
+			prefix = "稿件";
+		} else if (path.indexOf(AttachmentType.DEMAND_TEXT_FILE.getCode()) != -1) {
+			prefix = "科技需求文本文件资料";
+		} else if (path.indexOf(AttachmentType.ACHIEVEMENT_MATURITY_TEXT_FILE.getCode()) != -1) {
+			prefix = "科技成果成熟度资料文本文件";
+		} else if (path.indexOf(AttachmentType.ACHIEVEMENT_TECH_PLAN.getCode()) != -1) {
+			prefix = "科技成果技术方案文件";
+		} else if (path.indexOf(AttachmentType.ACHIEVEMENT_BUSINESS_PLAN.getCode()) != -1) {
+			prefix = "科技成果商业计划书";
+		}
+
+		return prefix + suffix;
+	}
+
+	public static String getSuffix(String path) {
+		if (StringUtils.isBlank(path) || path.lastIndexOf(".") < 0) {
+			return "";
+		}
+		return path.substring(path.lastIndexOf("."));
+	}
+
+	/**
+	 * 拼接文件路径
+	 * 
+	 * @param root
+	 * @param params
+	 * @return
+	 */
+	public static String buildFilePath(String... params) {
+		StringBuilder sb = new StringBuilder();
+		if (params != null) {
+			for (String s : params) {
+				sb.append(SLASH);
+				sb.append(SLASH_PATTERN.matcher(s).replaceAll(""));
+			}
+		}
+		return sb.toString();
+	}
+
+	/**
+	 * 拼接文件名字
+	 * 
+	 * @param root
+	 * @param params
+	 * @return
+	 */
+	public static String buildFileName(String... params) {
+		return StringUtils.join(params, UNDERLINE);
+	}
+
+	// year
+	private static String subStr(String s) {
+		return "企业" + s.substring(s.lastIndexOf(UNDERLINE) + 1, s.lastIndexOf("."));
+	}
+
+	public static boolean deleteFile(String realFilePath) {
+		return new File(realFilePath).delete();
+	}
+
+	/**
+	 * 
+	 * @param response
+	 * @param fileName
+	 * @param realFilePath
+	 */
+	public static void downloadFile(HttpServletResponse response, String fileName, String realFilePath) {
+		InputStream in = null;
+		OutputStream out = null;
+		byte[] buffer = new byte[8 * 1024];
+		try {
+			File file = new File(realFilePath);
+			in = new FileInputStream(file);
+			out = response.getOutputStream();
+			// 设置文件MIME类型
+			response.setContentType("application/octet-stream");
+			fileName = java.net.URLEncoder.encode(fileName, "UTF-8");
+			response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
+			response.setHeader("Content-Length", String.valueOf(file.length()));
+			for (;;) {
+				int bytes = in.read(buffer);
+				if (bytes == -1) {
+					break;
+				}
+				out.write(buffer, 0, bytes);
+			}
+		} catch (IOException e) {
+			LoggerUtils.fmtError(FileUtils.class, e, "IO错误:%s", e.getMessage());
+		} finally {
+			try {
+				if (in != null) {
+					in.close();
+				}
+			} catch (IOException e) {
+				in = null;
+				LoggerUtils.fmtError(FileUtils.class, e, "IO错误:%s", e.getMessage());
+			}
+			try {
+				if (out != null) {
+					out.close();
+				}
+			} catch (IOException e) {
+				out = null;
+				LoggerUtils.fmtError(FileUtils.class, e, "IO错误:%s", e.getMessage());
+			}
+		}
+	}
+
+}

+ 9 - 1
src/main/java/com/goafanti/demand/bo/DemandManageDetailBo.java

@@ -49,7 +49,7 @@ public class DemandManageDetailBo extends DemandManageListBo {
 
 	private String		employerContactsMailbox;
 
-	
+	private String      coverImg;
 	
 	public String getEmployerAddress() {
 		return employerAddress;
@@ -219,4 +219,12 @@ public class DemandManageDetailBo extends DemandManageListBo {
 	public void setMailbox(String mailbox) {
 		this.mailbox = mailbox;
 	}
+
+	public String getCoverImg() {
+		return coverImg;
+	}
+
+	public void setCoverImg(String coverImg) {
+		this.coverImg = coverImg;
+	}
 }

+ 12 - 1
src/main/java/com/goafanti/demand/bo/DemandManageListBo.java

@@ -15,7 +15,10 @@ public class DemandManageListBo extends DemandListBo {
 	private String	employerName;
 
 	private Integer	province;
-
+	/**
+	 * 是否在首页 0-否 1-是
+	 */
+	private Integer hot;
 	/**
 	 * 是否属于精品  0- 否 1-是
 	 */
@@ -87,4 +90,12 @@ public class DemandManageListBo extends DemandListBo {
 	public void setBoutique(Integer boutique) {
 		this.boutique = boutique;
 	}
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getHot() {
+		return hot;
+	}
+
+	public void setHot(Integer hot) {
+		this.hot = hot;
+	}
 }

+ 2 - 2
src/main/java/com/goafanti/demand/service/DemandService.java

@@ -23,12 +23,12 @@ public interface DemandService {
 	Pagination<DemandManageListBo> selectUserDemandManageList(String employerName, Integer auditStatus, Integer province,
 			Integer serialNumber, String name, String keyword, Integer infoSources, Integer demandType,
 			String validityPeriodStartDate, String validityPeriodEndDate, String username, Integer status,
-			Integer releaseStatus, String releaseDateStartDate, String releaseDateEndDate, Integer pNo, Integer pSize);
+			Integer releaseStatus, String releaseDateStartDate, String releaseDateEndDate, Integer pNo, Integer pSize,Integer boutique,Integer hot);
 
 	Pagination<DemandManageListBo> selectOrgDemandManageList(String employerName, Integer auditStatus, Integer province, Integer serialNumber,
 			String name, String keyword, Integer infoSources, Integer demandType, String validityPeriodStartDate,
 			String validityPeriodEndDate, String username, Integer status, Integer releaseStatus,
-			String releaseDateStartDate, String releaseDateEndDate, Integer pNo, Integer pSize);
+			String releaseDateStartDate, String releaseDateEndDate, Integer pNo, Integer pSize,Integer boutique,Integer hot);
 
 	void saveUserDemand(Demand d, String validityPeriodFormattedDate, String[] keywords);
 

+ 14 - 8
src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java

@@ -89,11 +89,11 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 			Integer province, Integer serialNumber, String name, String keyword, Integer infoSources,
 			Integer demandType, String validityPeriodStartDate, String validityPeriodEndDate, String username,
 			Integer status, Integer releaseStatus, String releaseDateStartDate, String releaseDateEndDate, Integer pNo,
-			Integer pSize) {
+			Integer pSize,Integer boutique,Integer hot) {
 
 		Map<String, Object> params = disposeParams(auditStatus, province, serialNumber, name, keyword, infoSources,
 				demandType, validityPeriodStartDate, validityPeriodEndDate, username, status, releaseStatus,
-				releaseDateStartDate, releaseDateEndDate);
+				releaseDateStartDate, releaseDateEndDate,boutique,hot);
 
 		if (pNo == null || pNo < 0) {
 			pNo = 1;
@@ -138,10 +138,10 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 			Integer province, Integer serialNumber, String name, String keyword, Integer infoSources,
 			Integer demandType, String validityPeriodStartDate, String validityPeriodEndDate, String username,
 			Integer status, Integer releaseStatus, String releaseDateStartDate, String releaseDateEndDate, Integer pNo,
-			Integer pSize) {
+			Integer pSize,Integer boutique,Integer hot) {
 		Map<String, Object> params = disposeParams(auditStatus, province, serialNumber, name, keyword, infoSources,
 				demandType, validityPeriodStartDate, validityPeriodEndDate, username, status, releaseStatus,
-				releaseDateStartDate, releaseDateEndDate);
+				releaseDateStartDate, releaseDateEndDate,boutique,hot);
 
 		if (pNo == null || pNo < 0) {
 			pNo = 1;
@@ -276,10 +276,11 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 	@Override
 	public Pagination<DemandListBo> listDemand(Integer auditStatus, Integer serialNumber, String name, String keyword,
 			Integer demandType, String validityPeriodStartDate, String validityPeriodEndDate, Integer status,
-			Integer releaseStatus, String releaseDateStartDate, String releaseDateEndDate, Integer pNo, Integer pSize) {
+			Integer releaseStatus, String releaseDateStartDate, String releaseDateEndDate, Integer pNo, Integer pSize
+			) {
 		Map<String, Object> params = disposeParams(auditStatus, null, serialNumber, name, keyword, null, demandType,
 				validityPeriodStartDate, validityPeriodEndDate, null, status, releaseStatus, releaseDateStartDate,
-				releaseDateEndDate);
+				releaseDateEndDate,null,null);
 
 		params.put("employerId", TokenManager.getUserId());
 
@@ -497,7 +498,7 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 	private Map<String, Object> disposeParams(Integer auditStatus, Integer province, Integer serialNumber, String name,
 			String keyword, Integer infoSources, Integer demandType, String validityPeriodStartDate,
 			String validityPeriodEndDate, String username, Integer status, Integer releaseStatus,
-			String releaseDateStartDate, String releaseDateEndDate) {
+			String releaseDateStartDate, String releaseDateEndDate,Integer boutique,Integer hot) {
 		Map<String, Object> params = new HashMap<>();
 		Date vStart = null;
 		Date vEnd = null;
@@ -588,7 +589,12 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 		if (null != releaseStatus) {
 			params.put("releaseStatus", releaseStatus);
 		}
-
+		if (null != boutique) {
+			params.put("boutique", boutique);
+		}
+		if (null != hot) {
+			params.put("hot", hot);
+		}
 		return params;
 	}
 

+ 27 - 0
src/main/java/com/goafanti/marketing/bo/MarketingManagementBo.java

@@ -0,0 +1,27 @@
+package com.goafanti.marketing.bo;
+
+import com.goafanti.common.model.MarketingManagement;
+
+public class MarketingManagementBo extends MarketingManagement{
+	private String name; /** 名字 **/
+	private String summary; /** 简介 **/
+	private String ownerType; /** 用户类型 **/
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public String getSummary() {
+		return summary;
+	}
+	public void setSummary(String summary) {
+		this.summary = summary;
+	}
+	public String getOwnerType() {
+		return ownerType;
+	}
+	public void setOwnerType(String ownerType) {
+		this.ownerType = ownerType;
+	}
+}

+ 51 - 0
src/main/java/com/goafanti/marketing/service/MarketingManagementService.java

@@ -0,0 +1,51 @@
+package com.goafanti.marketing.service;
+
+import java.util.List;
+
+import com.goafanti.common.model.MarketingManagement;
+import com.goafanti.marketing.bo.MarketingManagementBo;
+
+public interface MarketingManagementService {
+	/**
+	 * 
+	 * @param mm 保存营销活动
+	 */
+	public void save(MarketingManagement mm);
+	
+	/**
+	 * 
+	 * @param mm 更新营销活动
+	 */
+	public void update(MarketingManagement mm);
+	
+	/**
+	 * 
+	 * @param showPage 页面地址
+	 * @param category 营销类型  
+	 * @return
+	 */
+	public Integer getMarketingCount(String showPage,Integer category,Integer effective);
+
+	/**
+	 * 
+	 * @param showPage 页面地址
+	 * @param category 分类
+	 * @param productId 产品编号
+	 * @return
+	 */
+	public MarketingManagement selectMarket(String showPage,Integer category,String productId);
+	
+	/**
+	 * 取消营销活动
+	 * @param productIds
+	 */
+	public void deleteByProductId(List<String> productIds);
+	
+	/**
+	 * 查询营销活动
+	 * @param showPage 页面
+	 * @param category 分类
+	 * @return
+	 */
+	public List<MarketingManagementBo> selectMarketList(String showPage,Integer category);
+}

+ 49 - 0
src/main/java/com/goafanti/marketing/service/impl/MarketingManagementServiceImpl.java

@@ -0,0 +1,49 @@
+package com.goafanti.marketing.service.impl;
+
+import java.util.List;
+import java.util.UUID;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.common.dao.MarketingManagementMapper;
+import com.goafanti.common.model.MarketingManagement;
+import com.goafanti.marketing.bo.MarketingManagementBo;
+import com.goafanti.marketing.service.MarketingManagementService;
+
+@Service
+public class MarketingManagementServiceImpl implements MarketingManagementService {
+	@Autowired
+	MarketingManagementMapper marketingManagementMapper;
+	@Override
+	public void save(MarketingManagement mm) {
+		mm.setId(UUID.randomUUID().toString());
+		marketingManagementMapper.insert(mm);
+	}
+
+	@Override
+	public void update(MarketingManagement mmb) {
+		marketingManagementMapper.updateByPrimaryKeySelective(mmb);
+	}
+
+	@Override
+	public Integer getMarketingCount(String showPage, Integer category, Integer effective) {
+		return marketingManagementMapper.getMarketingCount(showPage, category, effective);
+	}
+
+	@Override
+	public MarketingManagement selectMarket(String showPage, Integer category, String productId) {
+		return marketingManagementMapper.selectMarket(showPage, category, productId);
+	}
+
+	@Override
+	public void deleteByProductId(List<String> productIds) {
+		marketingManagementMapper.deleteByProductId(productIds);
+	}
+
+	@Override
+	public List<MarketingManagementBo> selectMarketList(String showPage, Integer category) {
+		return marketingManagementMapper.selectMarketList(showPage, category);
+	}
+
+}

+ 2 - 2
src/main/resources/props/config_local.properties

@@ -59,8 +59,8 @@ portal.host=//sf.jishutao.com/portal/2.0.3
 avatar.host=//sb.jishutao.com
 avatar.upload.host=//sb.jishutao.com/upload
 
-upload.path=E:/data/public/upload
-upload.private.path=E:/data/private/upload
+upload.path=F:/data/public/upload
+upload.private.path=F:/data/private/upload
 
 accessKey=LTAIqTgQLLwz252Z
 accessSecret=ICGuiUnqzaar7urw4zecVcJrJ1MHg9

+ 96 - 94
src/main/resources/props/error.properties

@@ -1,94 +1,96 @@
-org.apache.shiro.authc.UnknownAccountException=\u8D26\u53F7\u6216\u5BC6\u7801\u4E0D\u5339\u914D\u3002
-org.apache.shiro.authc.IncorrectCredentialsException=\u8D26\u53F7\u6216\u5BC6\u7801\u4E0D\u5339\u914D\u3002
-org.apache.shiro.authc.LockedAccountException=\u8BE5\u8D26\u53F7\u5DF2\u51BB\u7ED3\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u3002
-org.apache.shiro.authc.DisabledAccountException=\u8BE5\u8D26\u53F7\u5DF2\u51BB\u7ED3\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u3002
-org.apache.shiro.authc.ExcessiveAttemptsException=\u5C1D\u8BD5\u6B21\u6570\u8FC7\u591A\uFF0C\u8D26\u53F7\u6682\u65F6\u88AB\u9501\u5B9A\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002
-org.apache.shiro.session.ExpiredSessionException=\u767B\u5F55\u4FE1\u606F\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55\u3002
-org.springframework.dao.DataIntegrityViolationException=\u670D\u52A1\u5668\u6253\u4E86\u4E2A\u76F9\u513F\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6216\u7A0D\u540E\u518D\u8BD5\u3002
-org.springframework.jdbc.BadSqlGrammarException=\u6570\u636E\u5F02\u5E38\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6216\u7A0D\u540E\u518D\u8BD5\u3002
-java.text.ParseException=\u53C2\u6570\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u6838\u5BF9\u8F93\u5165\u6570\u636E\u540E\u518D\u8BD5\u3002
-java.lang.IllegalArgumentException=\u53C2\u6570\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u6838\u5BF9\u8F93\u5165\u6570\u636E\u540E\u518D\u8BD5\u3002
-com.alibaba.fastjson.JSONException=\u53C2\u6570\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u6838\u5BF9\u8F93\u5165\u6570\u636E\u540E\u518D\u8BD5\u3002
-
-
-NON_LOGIN=\u7528\u6237\u672A\u767B\u5F55\u3002
-
-VCODE_ERROR=\u56FE\u5F62\u9A8C\u8BC1\u7801\u8F93\u5165\u9519\u8BEF\uFF01
-
-NO_AUTH_ERROR=\u672A\u6388\u6743\u6216\u6388\u6743\u8FC7\u671F\u3002
-
-NO_CERTIFY=\u8BA4\u8BC1\u7528\u6237\u624D\u80FD\u4F7F\u7528\u8BE5\u529F\u80FD
-
-PARAM_ERROR={0}\u53C2\u6570\u9519\u8BEF
-
-PARAM_INTEGER_ERROR={0}\u53C2\u6570\u5FC5\u987B\u4E3A\u6570\u5B57\u3002
-
-PARAM_EMPTY_ERROR={0}\u5FC5\u987B\u6307\u5B9A\u3002
-
-PARAM_SIZE_ERROR={0}\u53C2\u6570\u957F\u5EA6\u4E0D\u6B63\u786E\uFF0C\u5FC5\u987B\u5728{min}\u548C{max}\u4E4B\u95F4\u3002
-
-PARAM_PATTERN_ERROR={0}\u53C2\u6570\u683C\u5F0F\u987B\u6B63\u786E\u6307\u5B9A{1}\u3002
-
-EMAIL_SIZE_ERROR=\u90AE\u7BB1\u5730\u5740\u957F\u5EA6\u9519\u8BEF\uFF01
-
-EMAIL_PATTERN_ERROR=\u90AE\u7BB1\u5730\u5740\u683C\u5F0F\u9519\u8BEF\uFF01
-
-MOBILE_SIZE_ERROR=\u624B\u673A\u53F7\u957F\u5EA6\u9519\u8BEF\uFF01
-
-MOBILE_PATTERN_ERROR=\u624B\u673A\u53F7\u683C\u5F0F\u9519\u8BEF\uFF01
-
-DUNPLICATE_KAY_ERROR={0}\u5DF2\u88AB\u4ED6\u4EBA\u6CE8\u518C\uFF01
-
-DATA_EMPTY_ERROR=\u5F53\u524D{0}\u6CA1\u6709\u6570\u636E\u3002
-
-PWD_NOT_MATCH_ERROR=\u539F\u5BC6\u7801\u8F93\u5165\u4E0D\u5339\u914D\u3002
-
-MCODE_ERROR=\u624B\u673A\u9A8C\u8BC1\u7801\u9519\u8BEF\uFF01
-
-NON_CERTIFIED=\u672A\u901A\u8FC7\u5B9E\u540D\u8BA4\u8BC1\uFF0C\u65E0\u6CD5\u64CD\u4F5C\uFF01
-
-FILE_NON_EXISTENT=\u6587\u4EF6\u4E0D\u5B58\u5728\uFF01
-
-RECORD_CALLBACK=\u5F53\u524D\u8BB0\u5F55\u5DF2\u9000\u5355\uFF0C\u65E0\u6CD5\u4FEE\u6539\uFF01
-
-RECORD_SETTLEMENT=\u5F53\u524D\u8BB0\u5F55\u5DF2\u7ED3\u6B3E\uFF0C\u65E0\u6CD5\u4FEE\u6539\uFF01
-
-RECORD_REJECT=\u5F53\u524D\u7533\u8BF7\u672A\u901A\u8FC7\uFF0C\u65E0\u6CD5\u4FEE\u6539\uFF0C\u8BF7\u91CD\u65B0\u7533\u8BF7\uFF01
-
-CONTRACT_PATENT_CREATED=\u5F53\u524D\u5408\u540C\u4E13\u5229\u7533\u8BF7\u5DF2\u521B\u5EFA,\u65E0\u6CD5\u91CD\u590D\u521B\u5EFA\uFF01
-
-CONTRACT_COPYRIGHT_CREATED=\u5F53\u524D\u5408\u540C\u8F6F\u8457\u7533\u8BF7\u5DF2\u521B\u5EFA,\u65E0\u6CD5\u91CD\u590D\u521B\u5EFA\uFF01
-
-CONTRACT_TECHPROJECT_CREATED=\u5F53\u524D\u5408\u540C\u79D1\u6280\u9879\u76EE\u7533\u8BF7\u5DF2\u521B\u5EFA,\u65E0\u6CD5\u91CD\u590D\u521B\u5EFA\uFF01
-
-CONTRACT_COGNIZANCE_CREATED=\u5F53\u524D\u5408\u540C\u9AD8\u4F01\u8BA4\u5B9A\u7533\u8BF7\u5DF2\u521B\u5EFA,\u65E0\u6CD5\u91CD\u590D\u521B\u5EFA\uFF01
-
-EVALUATE_ID=\u8BC4\u4F30\u62A5\u544A\u627E\u4E0D\u5230\uFF01
-EVALUATE_STEP=\u9519\u8BEF\u7684\u8BC4\u4F30\u6B65\u9AA4\uFF01
-EVALUATE_PARAM=\u8BC4\u4F30\u53C2\u6570\u9519\u8BEF\uFF01
-
-CONTRACT_YEAR_SECTION=\u5F53\u524D\u7533\u8BF7\u5E74\u4EFD\u5DF2\u4E0E\u5176\u4ED6\u5408\u540C\u7533\u8BF7\u5E74\u4EFD\u91CD\u53E0\uFF0C\u65E0\u6CD5\u63D0\u4EA4\u65B0\u7533\u8BF7\uFF01
-
-VCODE_EMPTY_ERROR=\u56FE\u50CF\u9A8C\u8BC1\u7801\u4E0D\u80FD\u4E3A\u7A7A\uFF01
-
-MCODE_FREQUENCY_ERROR=\u624B\u673A\u9A8C\u8BC1\u7801\u53D1\u9001\u9891\u7E41\uFF01
-
-NON_REGISTER=\u8BE5\u7528\u6237\u672A\u6CE8\u518C\uFF01
-
-MCODE_EMPTY_ERROR=\u624B\u673A\u9A8C\u8BC1\u7801\u4E0D\u80FD\u4E3A\u7A7A\uFF01
-
-MCODE_OVERTIME_ERROR=\u624B\u673A\u9A8C\u8BC1\u7801\u8D85\u65F6\u5931\u6548\uFF01
-
-RESET_CODE_ERROR=\u9875\u9762\u5931\u6548,\u8BF7\u91CD\u65B0\u83B7\u53D6\u9A8C\u8BC1\u7801\uFF01
-
-RESET_CODE_OVERTIME=\u9875\u9762\u8D85\u65F6\u5931\u6548,\u8BF7\u91CD\u65B0\u83B7\u53D6\u9A8C\u8BC1\u7801\uFF01
-
-IDENTITY_PAY_OVER_TIME=\u8D85\u8FC7\u6253\u6B3E\u65E5\u671F5\u65E5\uFF0C\u65E0\u6CD5\u63D0\u4EA4\u786E\u8BA4\uFF01
-
-OVER_MAX_WRONG_COUNT=\u8F93\u5165\u9519\u8BEF\u91D1\u989D\u6B21\u6570\u8FC7\u591A\uFF01
-
-WRONG_MONEY=\u8F93\u5165\u6253\u6B3E\u91D1\u989D\u9519\u8BEF\uFF0C\u60A8\u8FD8\u6709{0}\u6B21\u673A\u4F1A\uFF01
-
-M_CODE_ERROR=\u624B\u673A\u9A8C\u8BC1\u7801\u83B7\u53D6\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\uFF01
-
-MOBILE_SAME_ERROR=\u65B0\u624B\u673A\u53F7\u5FC5\u987B\u548C\u539F\u624B\u673A\u53F7\u4E0D\u540C\uFF01
+org.apache.shiro.authc.UnknownAccountException=\u8D26\u53F7\u6216\u5BC6\u7801\u4E0D\u5339\u914D\u3002
+org.apache.shiro.authc.IncorrectCredentialsException=\u8D26\u53F7\u6216\u5BC6\u7801\u4E0D\u5339\u914D\u3002
+org.apache.shiro.authc.LockedAccountException=\u8BE5\u8D26\u53F7\u5DF2\u51BB\u7ED3\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u3002
+org.apache.shiro.authc.DisabledAccountException=\u8BE5\u8D26\u53F7\u5DF2\u51BB\u7ED3\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u3002
+org.apache.shiro.authc.ExcessiveAttemptsException=\u5C1D\u8BD5\u6B21\u6570\u8FC7\u591A\uFF0C\u8D26\u53F7\u6682\u65F6\u88AB\u9501\u5B9A\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002
+org.apache.shiro.session.ExpiredSessionException=\u767B\u5F55\u4FE1\u606F\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55\u3002
+org.springframework.dao.DataIntegrityViolationException=\u670D\u52A1\u5668\u6253\u4E86\u4E2A\u76F9\u513F\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6216\u7A0D\u540E\u518D\u8BD5\u3002
+org.springframework.jdbc.BadSqlGrammarException=\u6570\u636E\u5F02\u5E38\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6216\u7A0D\u540E\u518D\u8BD5\u3002
+java.text.ParseException=\u53C2\u6570\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u6838\u5BF9\u8F93\u5165\u6570\u636E\u540E\u518D\u8BD5\u3002
+java.lang.IllegalArgumentException=\u53C2\u6570\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u6838\u5BF9\u8F93\u5165\u6570\u636E\u540E\u518D\u8BD5\u3002
+com.alibaba.fastjson.JSONException=\u53C2\u6570\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u6838\u5BF9\u8F93\u5165\u6570\u636E\u540E\u518D\u8BD5\u3002
+
+
+NON_LOGIN=\u7528\u6237\u672A\u767B\u5F55\u3002
+
+VCODE_ERROR=\u56FE\u5F62\u9A8C\u8BC1\u7801\u8F93\u5165\u9519\u8BEF\uFF01
+
+NO_AUTH_ERROR=\u672A\u6388\u6743\u6216\u6388\u6743\u8FC7\u671F\u3002
+
+NO_CERTIFY=\u8BA4\u8BC1\u7528\u6237\u624D\u80FD\u4F7F\u7528\u8BE5\u529F\u80FD
+
+PARAM_ERROR={0}\u53C2\u6570\u9519\u8BEF
+
+PARAM_INTEGER_ERROR={0}\u53C2\u6570\u5FC5\u987B\u4E3A\u6570\u5B57\u3002
+
+PARAM_EMPTY_ERROR={0}\u5FC5\u987B\u6307\u5B9A\u3002
+
+PARAM_SIZE_ERROR={0}\u53C2\u6570\u957F\u5EA6\u4E0D\u6B63\u786E\uFF0C\u5FC5\u987B\u5728{min}\u548C{max}\u4E4B\u95F4\u3002
+
+PARAM_PATTERN_ERROR={0}\u53C2\u6570\u683C\u5F0F\u987B\u6B63\u786E\u6307\u5B9A{1}\u3002
+
+EMAIL_SIZE_ERROR=\u90AE\u7BB1\u5730\u5740\u957F\u5EA6\u9519\u8BEF\uFF01
+
+EMAIL_PATTERN_ERROR=\u90AE\u7BB1\u5730\u5740\u683C\u5F0F\u9519\u8BEF\uFF01
+
+MOBILE_SIZE_ERROR=\u624B\u673A\u53F7\u957F\u5EA6\u9519\u8BEF\uFF01
+
+MOBILE_PATTERN_ERROR=\u624B\u673A\u53F7\u683C\u5F0F\u9519\u8BEF\uFF01
+
+DUNPLICATE_KAY_ERROR={0}\u5DF2\u88AB\u4ED6\u4EBA\u6CE8\u518C\uFF01
+
+DATA_EMPTY_ERROR=\u5F53\u524D{0}\u6CA1\u6709\u6570\u636E\u3002
+
+PWD_NOT_MATCH_ERROR=\u539F\u5BC6\u7801\u8F93\u5165\u4E0D\u5339\u914D\u3002
+
+MCODE_ERROR=\u624B\u673A\u9A8C\u8BC1\u7801\u9519\u8BEF\uFF01
+
+NON_CERTIFIED=\u672A\u901A\u8FC7\u5B9E\u540D\u8BA4\u8BC1\uFF0C\u65E0\u6CD5\u64CD\u4F5C\uFF01
+
+FILE_NON_EXISTENT=\u6587\u4EF6\u4E0D\u5B58\u5728\uFF01
+
+RECORD_CALLBACK=\u5F53\u524D\u8BB0\u5F55\u5DF2\u9000\u5355\uFF0C\u65E0\u6CD5\u4FEE\u6539\uFF01
+
+RECORD_SETTLEMENT=\u5F53\u524D\u8BB0\u5F55\u5DF2\u7ED3\u6B3E\uFF0C\u65E0\u6CD5\u4FEE\u6539\uFF01
+
+RECORD_REJECT=\u5F53\u524D\u7533\u8BF7\u672A\u901A\u8FC7\uFF0C\u65E0\u6CD5\u4FEE\u6539\uFF0C\u8BF7\u91CD\u65B0\u7533\u8BF7\uFF01
+
+CONTRACT_PATENT_CREATED=\u5F53\u524D\u5408\u540C\u4E13\u5229\u7533\u8BF7\u5DF2\u521B\u5EFA,\u65E0\u6CD5\u91CD\u590D\u521B\u5EFA\uFF01
+
+CONTRACT_COPYRIGHT_CREATED=\u5F53\u524D\u5408\u540C\u8F6F\u8457\u7533\u8BF7\u5DF2\u521B\u5EFA,\u65E0\u6CD5\u91CD\u590D\u521B\u5EFA\uFF01
+
+CONTRACT_TECHPROJECT_CREATED=\u5F53\u524D\u5408\u540C\u79D1\u6280\u9879\u76EE\u7533\u8BF7\u5DF2\u521B\u5EFA,\u65E0\u6CD5\u91CD\u590D\u521B\u5EFA\uFF01
+
+CONTRACT_COGNIZANCE_CREATED=\u5F53\u524D\u5408\u540C\u9AD8\u4F01\u8BA4\u5B9A\u7533\u8BF7\u5DF2\u521B\u5EFA,\u65E0\u6CD5\u91CD\u590D\u521B\u5EFA\uFF01
+
+EVALUATE_ID=\u8BC4\u4F30\u62A5\u544A\u627E\u4E0D\u5230\uFF01
+EVALUATE_STEP=\u9519\u8BEF\u7684\u8BC4\u4F30\u6B65\u9AA4\uFF01
+EVALUATE_PARAM=\u8BC4\u4F30\u53C2\u6570\u9519\u8BEF\uFF01
+
+CONTRACT_YEAR_SECTION=\u5F53\u524D\u7533\u8BF7\u5E74\u4EFD\u5DF2\u4E0E\u5176\u4ED6\u5408\u540C\u7533\u8BF7\u5E74\u4EFD\u91CD\u53E0\uFF0C\u65E0\u6CD5\u63D0\u4EA4\u65B0\u7533\u8BF7\uFF01
+
+VCODE_EMPTY_ERROR=\u56FE\u50CF\u9A8C\u8BC1\u7801\u4E0D\u80FD\u4E3A\u7A7A\uFF01
+
+MCODE_FREQUENCY_ERROR=\u624B\u673A\u9A8C\u8BC1\u7801\u53D1\u9001\u9891\u7E41\uFF01
+
+NON_REGISTER=\u8BE5\u7528\u6237\u672A\u6CE8\u518C\uFF01
+
+MCODE_EMPTY_ERROR=\u624B\u673A\u9A8C\u8BC1\u7801\u4E0D\u80FD\u4E3A\u7A7A\uFF01
+
+MCODE_OVERTIME_ERROR=\u624B\u673A\u9A8C\u8BC1\u7801\u8D85\u65F6\u5931\u6548\uFF01
+
+RESET_CODE_ERROR=\u9875\u9762\u5931\u6548,\u8BF7\u91CD\u65B0\u83B7\u53D6\u9A8C\u8BC1\u7801\uFF01
+
+RESET_CODE_OVERTIME=\u9875\u9762\u8D85\u65F6\u5931\u6548,\u8BF7\u91CD\u65B0\u83B7\u53D6\u9A8C\u8BC1\u7801\uFF01
+
+IDENTITY_PAY_OVER_TIME=\u8D85\u8FC7\u6253\u6B3E\u65E5\u671F5\u65E5\uFF0C\u65E0\u6CD5\u63D0\u4EA4\u786E\u8BA4\uFF01
+
+OVER_MAX_WRONG_COUNT=\u8F93\u5165\u9519\u8BEF\u91D1\u989D\u6B21\u6570\u8FC7\u591A\uFF01
+
+WRONG_MONEY=\u8F93\u5165\u6253\u6B3E\u91D1\u989D\u9519\u8BEF\uFF0C\u60A8\u8FD8\u6709{0}\u6B21\u673A\u4F1A\uFF01
+
+M_CODE_ERROR=\u624B\u673A\u9A8C\u8BC1\u7801\u83B7\u53D6\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\uFF01
+
+MOBILE_SAME_ERROR=\u65B0\u624B\u673A\u53F7\u5FC5\u987B\u548C\u539F\u624B\u673A\u53F7\u4E0D\u540C\uFF01
+
+MARKET_BOOTH_MAX = \u8425\u9500\u6D3B\u52A8\u5C55\u4F4D\u5DF2\u6EE1{0}\u4E2A

+ 59 - 106
src/main/webapp/WEB-INF/views/portal/index.html

@@ -74,8 +74,7 @@
 	</div>
 	<div id="product">
 		<div class="caption">
-			精品成果<a
-				th:href="${basePath + '/portal/technologyTrading/achievement.html'}">MORE+</a>
+			精品成果<a th:href="${basePath + '/portal/technologyTrading/achievement.html'}">MORE+</a>
 		</div>
 		<div class="content">
 			<div class="con_hover">
@@ -83,69 +82,64 @@
 					alt="" />
 					<p>详情</p>
 				</a>
-			</div>
-			<div class="cont cont_top1">
-				<a
-					th:href="${basePath + '/portal/technologyTrading/achievementDetail?id=66b56b38-4e12-4089-892f-12f43d15387d&type=1'}">
+			</div>			
+			<div class="cont cont_top1" th:if="${#lists.size(achievementList) ge 1}">
+				<a th:href="@{/portal/technologyTrading/achievementDetail(id=${achievementList[0].productId},type=${achievementList[0].ownerType})}">
 					<div class="img">
-						<img th:src="${portalHost+'/img/index_one.png'}" alt="" /> <img
-							th:src="${portalHost+'/img/product1.jpg'}" alt="" />
+						<img th:src="${portalHost+'/img/index_one.png'}" alt="" /> 
+						<img th:src="${avatarUploadHost+achievementList[0].coverImg}" alt="" />
 					</div>
 					<div class="text">
-						<h2>军民两用无人飞行器系统</h2>
-						<p>军民两用无人飞行器系统包括TX-03、TX-05两个系列,其中TX-03系列属于小型全电无人飞行器</p>
+						<h2 th:text="${achievementList[0].name}"></h2>
+						<p th:text="${achievementList[0].summary}"></p>
 					</div>
 				</a>
 			</div>
-			<div class="cont cont_bottom1">
-				<a
-					th:href="${basePath + '/portal/technologyTrading/achievementDetail?id=03120e15-6eb2-4066-9d04-ca59278fba8d&type=1'}">
+			<div class="cont cont_top1" th:if="${#lists.size(achievementList) ge 2}">
+				<a th:href="@{/portal/technologyTrading/achievementDetail(id=${achievementList[1].productId},type=${achievementList[1].ownerType})}">
 					<div class="img">
-						<img th:src="${portalHost+'/img/index_two.png'}" alt="" /> <img
-							th:src="${portalHost+'/img/product2.jpg'}" alt="" />
+						<img th:src="${portalHost+'/img/index_two.png'}" alt="" /> 
+						<img th:src="${avatarUploadHost+achievementList[1].coverImg}" alt="" />
 					</div>
 					<div class="text">
-						<h2>新型炭纳米管-石墨烯交联网络高导热薄膜</h2>
-						<p>新型碳纳米管-石墨烯交联网络高导热薄膜由石墨烯片层堆积而成,在石墨烯片层之间原位生长碳纳米管</p>
+						<h2 th:text="${achievementList[1].name}"></h2>
+						<p th:text="${achievementList[1].summary}"></p>
 					</div>
 				</a>
 			</div>
-			<div class="cont cont_top2">
-				<a
-					th:href="${basePath + '/portal/technologyTrading/achievementDetail?id=73e9d01d-fc19-4585-a6e3-9ae4c9c274c6&type=1'}">
+			<div class="cont cont_top1" th:if="${#lists.size(achievementList) ge 3}">
+				<a th:href="@{/portal/technologyTrading/achievementDetail(id=${achievementList[2].productId},type=${achievementList[2].ownerType})}">
 					<div class="img">
-						<img th:src="${portalHost+'/img/index_three.png'}" alt="" /> <img
-							th:src="${portalHost+'/img/product3.jpg'}" alt="" />
+						<img th:src="${portalHost+'/img/index_three.png'}" alt="" /> 
+						<img th:src="${avatarUploadHost+achievementList[2].coverImg}" alt="" />
 					</div>
 					<div class="text">
-						<h2>基于原位氧化吸附热敏染料废水处理技术</h2>
-						<p>1、反应在常温、常压、开放体系中进行,条件温和,占地面积小,运行可靠,操作维护简单,投资和运行成本均较低</p>
+						<h2 th:text="${achievementList[2].name}"></h2>
+						<p th:text="${achievementList[2].summary}"></p>
 					</div>
 				</a>
 			</div>
-			<div class="cont cont_bottom2">
-				<a
-					th:href="${basePath + '/portal/technologyTrading/achievementDetail?id=4ce4132f-3749-46da-843b-d4448c78a65b&type=1'}">
+			<div class="cont cont_top1" th:if="${#lists.size(achievementList) ge 4}">
+				<a th:href="@{/portal/technologyTrading/achievementDetail(id=${achievementList[3].productId},type=${achievementList[3].ownerType})}">
 					<div class="img">
-						<img th:src="${portalHost+'/img/index_four.png'}" alt="" /> <img
-							th:src="${portalHost+'/img/product4.jpg'}" alt="" />
+						<img th:src="${portalHost+'/img/index_four.png'}" alt="" /> 
+						<img th:src="${avatarUploadHost+achievementList[3].coverImg}" alt="" />
 					</div>
 					<div class="text">
-						<h2>智能网联驾驶技术</h2>
-						<p>自1990年开展地面无人驾驶车辆技术研究,并联合各大汽车企业开展了自动驾驶汽车技术研发与应用</p>
+						<h2 th:text="${achievementList[3].name}"></h2>
+						<p th:text="${achievementList[3].summary}"></p>
 					</div>
 				</a>
 			</div>
-			<div class="cont cont_top3">
-				<a
-					th:href="${basePath + '/portal/technologyTrading/achievementDetail?id=3ffb74be-fb8c-48df-9e29-31cc721ec44e&type=1'}">
+			<div class="cont cont_top1" th:if="${#lists.size(achievementList) ge 5}">
+				<a th:href="@{/portal/technologyTrading/achievementDetail(id=${achievementList[4].productId},type=${achievementList[4].ownerType})}">
 					<div class="img">
-						<img th:src="${portalHost+'/img/index_five.png'}" alt="" /> <img
-							th:src="${portalHost+'/img/product5.jpg'}" alt="" />
+						<img th:src="${portalHost+'/img/index_five.png'}" alt="" /> 
+						<img th:src="${avatarUploadHost+achievementList[4].coverImg}" alt="" />
 					</div>
 					<div class="text">
-						<h2>MR-PET高端医学影像装备的关键技术与关键部</h2>
-						<p>正电子发射断层成像(Positron Emission Tomography,以下简称PET)是一种非侵入性的造影方法</p>
+						<h2 th:text="${achievementList[4].name}"></h2>
+						<p th:text="${achievementList[4].summary}"></p>
 					</div>
 				</a>
 			</div>
@@ -153,56 +147,52 @@
 	</div>
 	<div id="policy">
 		<div class="captions">
-			智&nbsp;&nbsp;&nbsp;&nbsp;政  <a
-				th:href="${basePath + '/portal/thinkTank/policyList.html'}">MORE+</a>
+			智&nbsp;&nbsp;&nbsp;&nbsp;政  
+			<a th:href="${basePath + '/portal/thinkTank/policyList.html'}">MORE+</a>
 		</div>
 		<div class="pol_cont">
-			<div class="pol_left">
+			<div class="pol_left" th:if="${#lists.size(jtdt) ge 1}">
 				<img th:src="${portalHost+'/img/policy.jpg'}" alt="" />
 				<div class="pol_left_cont">
-					<h3>解读习近平总书记在中央财经领导小组第十六次会议上关于知识产权工作的重要论述</h3>
-					<p>“要调动拥有知识产权的自然人和法人的积极性和主动性,提升产权意识,自觉运用法律武器依法维权。</p>
+					<h3 th:text="${jtdt[0].title}"></h3>
+					<p th:text="${jtdt[0].summary}"></p>
 					<div class="pol_bottom">
 						<div class="more rf">
-							<a
-								th:href="${basePath + '/portal/news/newsDetail?id=116557327490236416'}">MORE+</a>
+							<a th:href="@{/portal/news/newsDetail(id=${jtdt[0].id})}">MORE+</a>
 						</div>
-						<div class="data">2017-09-18</div>
+						<div class="data" th:text=${jtdt[0].createTimeFormattedDate}></div>
 					</div>
 				</div>
 			</div>
-			<div class="pol_right">
+			<div class="pol_right" th:if="${#lists.size(jtdt) ge 2}">
 				<div class="pol_right_big">
-					<h3>国务院知识产权局印发《“十三五”国家知识产权保护和运用规划重点任务分工方案》</h3>
-					<p>中央组织部、中央编办、中央综治办、中央网信办,国务院知识产权战略实施工作部际联席会议各成员单位,民政部、食品药品监管总局</p>
+					<h3 th:text="${jtdt[1].title}"></h3>
+					<p th:text="${jtdt[1].summary}"></p>
 					<div class="pol_bottom">
 						<div class="more rf">
-							<a
-								th:href="${basePath + '/portal/news/newsDetail?id=116558483981484032'}">MORE+</a>
+							<a th:href="@{/portal/news/newsDetail(id=${jtdt[1].id})}">MORE+</a>
 						</div>
-						<div class="data">2017-09-18</div>
+						<div class="data" th:text=${jtdt[1].createTimeFormattedDate}></div>
 					</div>
 				</div>
-				<div class="pol_right_sm">
-					<h3>科技部发布国家重点研发计划智能机器人等重点专项2017年度项目申报指南</h3>
-					<p>各省、自治区、直辖市及计划单列市科技厅(委、局),新疆生产建设兵团科技局,国务院各有关部门科技主管司局,各有关单位</p>
+				<div class="pol_right_sm" th:if="${#lists.size(jtdt) ge 3}">
+					<h3 th:text="${jtdt[2].title}"></h3>
+					<p th:text="${jtdt[2].summary}"></p>
 					<div class="pol_bottom">
 						<div class="more rf">
-							<a
-								th:href="${basePath + '/portal/news/newsDetail?id=116557895017316352'}">MORE+</a>
+							<a th:href="@{/portal/news/newsDetail(id=${jtdt[2].id})}">MORE+</a>
 						</div>
-						<div class="data">2017-09-18</div>
+						<div class="data" th:text=${jtdt[2].createTimeFormattedDate}></div>
 					</div>
 				</div>
-				<div class="pol_right_sm pol_act">
-					<h3>开展湖南省2017年高新技术企业认定工作的通知</h3>
-					<p>申报条件:(一)在中国境内(不含港、澳、台地区)注册的企业,近三年内通过自主研发、受让、受赠、并购等方式</p>
+				<div class="pol_right_sm pol_act" th:if="${#lists.size(jtdt) ge 4}">
+					<h3 th:text="${jtdt[3].title}"></h3>
+					<p th:text="${jtdt[3].summary}"></p>
 					<div class="pol_bottom">
 						<div class="more rf">
-							<a
-								th:href="${basePath + '/portal/news/newsDetail?id=116548420894081024'}">MORE+</a>
+							<a th:href="@{/portal/news/newsDetail(id=${jtdt[3].id})}">MORE+</a>
 						</div>
-						<div class="data">2017-09-18</div>
+						<div class="data" th:text=${jtdt[3].createTimeFormattedDate}></div>
 					</div>
 				</div>
 			</div>
@@ -211,52 +201,15 @@
 	<div class="need_main">
 		<div id="need">
 			<div class="caption">精品需求</div>
-			<span class="more"><a
-				th:href="${basePath + '/portal/technologyTrading/demand.html'}">MORE+</a></span>
+			<span class="more"><a th:href="${basePath + '/portal/technologyTrading/demand.html'}">MORE+</a></span>
 			<div class="carousel">
 				<span class="need_prev"><</span>
 				<div class="need_imgs">
 					<ul>
-						<li><a
-							th:href="${basePath + '/portal/technologyTrading/demandDetail?id=cdee3d8f-affe-45b0-9fd2-542cb2ed16fa&type=1'}">
-								<img th:src="${portalHost+'/img/need_img1.jpg'}" alt="" />
-								<p>新型纳米涂料技术</p>
-								<div class="need_black">
-									<img th:src="${portalHost+'/img/search_txt.png'}" alt="" />
-									<p>详情</p>
-								</div>
-						</a></li>
-						<li><a
-							th:href="${basePath + '/portal/technologyTrading/demandDetail?id=b17c5768-327d-4d90-8557-e4f21af050b0&type=1'}">
-								<img th:src="${portalHost+'/img/need_img2.jpg'}" alt="" />
-								<p>汽车空调的辅助制冷装置</p>
-								<div class="need_black">
-									<img th:src="${portalHost+'/img/search_txt.png'}" alt="" />
-									<p>详情</p>
-								</div>
-						</a></li>
-						<li><a
-							th:href="${basePath + '/portal/technologyTrading/demandDetail?id=e6b9869a-15aa-437a-afdd-0c289acd8cbf&type=1'}">
-								<img th:src="${portalHost+'/img/need_img1.jpg'}" alt="" />
-								<p>高性能铅炭电池</p>
-								<div class="need_black">
-									<img th:src="${portalHost+'/img/search_txt.png'}" alt="" />
-									<p>详情</p>
-								</div>
-						</a></li>
-						<li><a
-							th:href="${basePath + '/portal/technologyTrading/demandDetail?id=9b815c37-9748-4224-9770-07df8f35a6d9&type=1'}">
-								<img th:src="${portalHost+'/img/need_img2.jpg'}" alt="" />
-								<p>ABS板材改性工程塑料的配方及研究</p>
-								<div class="need_black">
-									<img th:src="${portalHost+'/img/search_txt.png'}" alt="" />
-									<p>详情</p>
-								</div>
-						</a></li>
-						<li><a
-							th:href="${basePath + '/portal/technologyTrading/demandDetail?id=5335f8d9-0e4d-4263-8d99-8faf92de5f1d&type=1'}">
-								<img th:src="${portalHost+'/img/need_img3.jpg'}" alt="" />
-								<p>机械领域新型产品或技术</p>
+						<li th:each="item:${demandList}"><a
+							th:href="@{/portal/technologyTrading/demandDetail(id=${item.productId},type=${item.ownerType})}">
+								<img th:src="${avatarUploadHost + item.coverImg}" alt="" />
+								<p th:text="${item.name}"></p>
 								<div class="need_black">
 									<img th:src="${portalHost+'/img/search_txt.png'}" alt="" />
 									<p>详情</p>