Преглед изворни кода

Merge branch 'test' of
ssh://anderx@git.jishutao.com:55555/jishutao/jitao-server.git into test

Conflicts:
src/main/java/com/goafanti/common/controller/PublicController.java
src/main/webapp/WEB-INF/views/user/signIn.html

anderx пре 7 година
родитељ
комит
4d4d447eee
35 измењених фајлова са 2702 додато и 131 уклоњено
  1. 0 17
      src/main/java/com/goafanti/business/service/JtBusinessService.java
  2. 0 12
      src/main/java/com/goafanti/business/service/impl/JtBusinessServiceImpl.java
  3. 55 8
      src/main/java/com/goafanti/common/controller/WebpageController.java
  4. 1 2
      src/main/java/com/goafanti/common/dao/JtBusinessProjectMapper.java
  5. 1 1
      src/main/java/com/goafanti/common/dao/UserMapper.java
  6. 1 1
      src/main/java/com/goafanti/common/mapper/DemandMapper.xml
  7. 0 35
      src/main/java/com/goafanti/common/mapper/JtBusinessProjectMapper.xml
  8. 1 5
      src/main/java/com/goafanti/common/mapper/UserMapper.xml
  9. 1 0
      src/main/java/com/goafanti/common/model/News.java
  10. 1 1
      src/main/java/com/goafanti/core/shiro/token/TokenManager.java
  11. 1 1
      src/main/java/com/goafanti/core/shiro/token/UserRealm.java
  12. 50 0
      src/main/java/com/goafanti/evaluation/bo/ForecastIncome.java
  13. 102 0
      src/main/java/com/goafanti/evaluation/bo/Step1.java
  14. 79 0
      src/main/java/com/goafanti/evaluation/bo/Step2.java
  15. 128 0
      src/main/java/com/goafanti/evaluation/bo/Step3.java
  16. 25 0
      src/main/java/com/goafanti/evaluation/bo/Step4.java
  17. 25 0
      src/main/java/com/goafanti/evaluation/bo/Step5.java
  18. 19 0
      src/main/java/com/goafanti/evaluation/bo/Step6.java
  19. 67 0
      src/main/java/com/goafanti/evaluation/bo/Step7.java
  20. 32 0
      src/main/java/com/goafanti/evaluation/bo/YearIncome.java
  21. 632 0
      src/main/java/com/goafanti/evaluation/controller/UserEvaluationApiController.java
  22. 81 0
      src/main/java/com/goafanti/evaluation/enums/ProfitRate.java
  23. 57 0
      src/main/java/com/goafanti/evaluation/service/ValueEvaluationService.java
  24. 0 1
      src/main/java/com/goafanti/news/controller/AdminNewsApiController.java
  25. 0 14
      src/main/java/com/goafanti/user/bo/InputUser.java
  26. 8 7
      src/main/java/com/goafanti/user/controller/UserRegisterController.java
  27. 2 4
      src/main/resources/props/config_local.properties
  28. 4 18
      src/main/webapp/WEB-INF/views/common.html
  29. 463 0
      src/main/webapp/WEB-INF/views/portal/evaluation/evaluate.html
  30. 234 0
      src/main/webapp/WEB-INF/views/portal/evaluation/index.html
  31. 465 1
      src/main/webapp/WEB-INF/views/portal/index.html
  32. 147 0
      src/main/webapp/WEB-INF/views/portal/service/safeguarding.html
  33. 1 2
      src/main/webapp/WEB-INF/views/portal/service/serviceIndex.html
  34. 1 1
      src/main/webapp/WEB-INF/views/portal/technologyTrading/tradingIndex.html
  35. 18 0
      src/main/webapp/WEB-INF/views/user/account/evaluateInfo.html

+ 0 - 17
src/main/java/com/goafanti/business/service/JtBusinessService.java

@@ -40,21 +40,4 @@ public interface JtBusinessService {
 	 */
 	List<JtBusinessCategory> getCategoryByModule(Integer module);
 	
-	/**
-	 * 查看模块项目
-	 * @param module
-	 * @param isHost
-	 * @param size
-	 * @return
-	 */
-	List<JtBusinessProject> getKJListByIds(Integer module, Integer isHost, Integer size);
-	/**
-	 * 根据名字查看二级分类
-	 * @param name
-	 * @param isHost
-	 * @param size
-	 * @return
-	 */
-	List<JtBusinessProject> getModuleByName(String  name, Integer isHost, Integer size);
-	
 }

+ 0 - 12
src/main/java/com/goafanti/business/service/impl/JtBusinessServiceImpl.java

@@ -438,18 +438,6 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 	public List<JtBusinessCategory> getCategoryByModule(Integer module) {
 		return jtBusinessCategoryMapper.getCategoryByModule(module);
 	}
-
-	@Override
-	public List<JtBusinessProject> getKJListByIds(Integer module,
-			Integer isHost, Integer size) {
-		return jtBusinessProjectMapper.getKJListByIds( module,  isHost,  size);
-	}
-
-	@Override
-	public List<JtBusinessProject> getModuleByName(String name, Integer isHost,
-			Integer size) {
-		return jtBusinessProjectMapper.getModuleByName(name, isHost, size);
-	}
 	
 	
 	

+ 55 - 8
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -1,5 +1,6 @@
 package com.goafanti.common.controller;
 
+
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
@@ -385,7 +386,15 @@ public class WebpageController extends BaseController {
 		//高企服务
 		JtBusinessCategory gaoqi = jtBusinessService.getBusinessCategoryByLayerAndName(1, "高新技术企业服务");
 		if (gaoqi != null) {
-			List<JtBusinessProject> gaoqiList = jtBusinessService.getKJListByIds(2,null,6);
+			List<JtBusinessCategory> scienceProject = jtBusinessService.getCategoryByModule(2);
+			List<JtBusinessProject> gaoqiList = new ArrayList<JtBusinessProject>();
+			for (JtBusinessCategory jtBusinessCategory : scienceProject) {
+				List<JtBusinessProject> list = jtBusinessService.getBusinessProjectByCategoryId(jtBusinessCategory.getId(), 6, null);
+				gaoqiList.addAll(list);
+			}
+			if(gaoqiList.size()>6){
+				gaoqiList.subList(0, 6);
+			}
 			/*List<JtBusinessProject> gaoqiList = jtBusinessService.getBusinessProjectByCategoryId(gaoqi2.getId(), 6, null);*/
 			for (JtBusinessProject project : gaoqiList) {
 				if (project.getMinImgUrl() != null && project.getMinImgUrl().length() <= 0)
@@ -402,16 +411,32 @@ public class WebpageController extends BaseController {
 		//企业资质认证
 		JtBusinessCategory qiyerenzheng = jtBusinessService.getBusinessCategoryByLayerAndName(1, "企业资质认定");
 		if (qiyerenzheng != null) {
-			
-			List<JtBusinessProject> qyrzCategories = jtBusinessService.getModuleByName("企业资质认定", null, 12);
-			
+			//获得所有下级id
+			List<JtBusinessCategory> xaiji = jtBusinessService.getBusinessCategoryBySuperId(qiyerenzheng.getId(), 10);
+			List<JtBusinessProject> qyrzCategories = new ArrayList<JtBusinessProject>();
+			for (int i = 0; i < xaiji.size(); i++) {
+				List<JtBusinessProject> list = jtBusinessService.getBusinessProjectByCategoryId(xaiji.get(i).getId(), 10, null);
+				qyrzCategories.addAll(list);
+			}
+			if(qyrzCategories.size()>10){
+				qyrzCategories.subList(0, 10);
+			}
 			modelview.addObject("qyrzCategories", qyrzCategories);
 			modelview.addObject("qyrzc1", qiyerenzheng);
 		}
 		//管理体系认证
 		JtBusinessCategory manageSys2 = jtBusinessService.getBusinessCategoryByLayerAndName(1, "管理体系认证");
 		if (manageSys2 != null) {
-			List<JtBusinessProject> qyrzCategories = jtBusinessService.getModuleByName("管理体系认证", null, 18);
+			//获得所有下级id
+			List<JtBusinessCategory> xaiji = jtBusinessService.getBusinessCategoryBySuperId(manageSys2.getId(), 10);
+			List<JtBusinessProject> qyrzCategories = new ArrayList<JtBusinessProject>();
+			for (int i = 0; i < xaiji.size(); i++) {
+				List<JtBusinessProject> list = jtBusinessService.getBusinessProjectByCategoryId(xaiji.get(i).getId(), 18, null);
+				qyrzCategories.addAll(list);
+			}
+			if(qyrzCategories.size()>18){
+				qyrzCategories.subList(0, 18);
+			}
 			//List<JtBusinessProject> manageSysPro = jtBusinessService.getBusinessProjectByCategoryId(manageSys2.getId(),18, null);
 			modelview.addObject("manageSystemList", qyrzCategories);
 			modelview.addObject("managerSysc1", manageSys2);
@@ -420,9 +445,19 @@ public class WebpageController extends BaseController {
 		//科技项目
 		//获得所有模块为5的科技项目id
 		JtBusinessCategory scienceProject1 = jtBusinessService.getBusinessCategoryByLayerAndName(1, "科技项目");
-		List<JtBusinessProject> manageSysPro = jtBusinessService.getKJListByIds(5,1,12);
-		modelview.addObject("scienceProjectList", manageSysPro);
-		modelview.addObject("spc1", scienceProject1);
+		List<JtBusinessCategory> scienceProject = jtBusinessService.getCategoryByModule(5);
+		List<JtBusinessProject> manageSysPro = new ArrayList<JtBusinessProject>();
+		for (JtBusinessCategory jtBusinessCategory : scienceProject) {
+			List<JtBusinessProject> list = jtBusinessService.getBusinessProjectByCategoryId(jtBusinessCategory.getId(), 12, 1);
+			manageSysPro.addAll(list);
+		}
+		if(null != manageSysPro){
+			if(manageSysPro.size()>12){
+				manageSysPro.subList(0, 12);
+			}
+			modelview.addObject("scienceProjectList", manageSysPro);
+			modelview.addObject("spc1", scienceProject1);
+		}
 		/****************************以上是新修改的部分********************************************/
 		// 咨询师
 		List<UserIdentityBo> userIdentityBos = userIdentityService.getExperts(8);
@@ -1259,10 +1294,22 @@ public class WebpageController extends BaseController {
 		return res;
 	}
 	
+	/**
+	 * 知识产权维权
+	 * @param request
+	 * @param modelview
+	 * @return
+	 */
 	@RequestMapping(value = "/portal/service/safeguarding", method = RequestMethod.GET)
 	public ModelAndView portalServiceSafeguarding(HttpServletRequest request, ModelAndView modelview){
 		modelview.setViewName("/portal/service/safeguarding");
 		return modelview;
 	}
 	
+	@RequestMapping(value = "/portal/evaluation/evaluate", method = RequestMethod.GET)
+	public ModelAndView evaluate(HttpServletRequest request, ModelAndView modelview) {
+		modelview.setViewName("/portal/evaluation/evaluate");
+		return modelview;
+	}
+	
 }

+ 1 - 2
src/main/java/com/goafanti/common/dao/JtBusinessProjectMapper.java

@@ -84,8 +84,7 @@ public interface JtBusinessProjectMapper {
   
 	JtBusinessProjectResult selectByPrimaryKeyWithModule(@Param("id")String id,@Param("uid")String uid);
   
-	List<JtBusinessProject> getKJListByIds(@Param("module")Integer module, @Param("isHot")Integer isHost, @Param("size")Integer size);
-	List<JtBusinessProject> getModuleByName(@Param("name")String name, @Param("isHot")Integer isHost, @Param("size")Integer size);
+
      
   
 }

+ 1 - 1
src/main/java/com/goafanti/common/dao/UserMapper.java

@@ -91,7 +91,7 @@ public interface UserMapper {
 
 	Long selectNumberByPrimaryKey(String userId);
 	
-	User selectByMobieAndType(@Param("mobile")String mobile, @Param("type")Integer type);
+	User selectByMobieAndType(String mobile, Integer type);
 
 	List<OrganizationContactBook> findAllContacts(String uid);
 

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

@@ -616,7 +616,7 @@
   <select id="findAppDemandCount" parameterType="String" resultType="java.lang.Integer">
   		select count(1)
 	from  demand d 
-	where d.deleted_sign = 0 and d.audit_status=2 and d.info_sources=1  
+	where d.deleted_sign = 0 and d.audit_status=2 and d.info_sources=1 and d.release_status=1
 	<if test="employerId != null">
 	and d.employer_id = #{employerId, jdbcType=VARCHAR}
 	</if>

+ 0 - 35
src/main/java/com/goafanti/common/mapper/JtBusinessProjectMapper.xml

@@ -839,39 +839,4 @@
   	and b.module = 5 
   	</if>
   </select>
-  
-  <!-- 查看科技服务项目   -->
-  <select id="getKJListByIds" resultType="com.goafanti.common.model.JtBusinessProject">
-    select 
-	    p.id,
-	  	p.name,
-	  	p.introduce,
-	  	p.min_img_url as minImgUrl
-  	from jt_business_project p
-    left join jt_business_category c on p.category_id = c.id
-    where c.module = #{module} 
-    and p.audit_status = 2 
-    <if test="isHot">
-    and is_hot = #{isHot}
-    </if>
-    order by release_date desc
-	  	limit #{size}
-	  </select>
-	   
-	 <!-- 根据二级分类名称查 -->
-	 <select id="getModuleByName" resultType="com.goafanti.common.model.JtBusinessProject">
-	 select  b.id,
-	  	b.name,
-	  	b.introduce,
-	  	b.min_img_url as minImgUrl
-	from (select x.id from jt_business_category x inner join jt_business_category y on x.super_id = y.id where y.name=#{name})a 
-	left join jt_business_project b on a.id = b.category_id
-	where  
-	b.audit_status = 2 
-	<if test="isHot">
-    and is_hot = #{isHot}
-    </if>
-	order by b.release_date desc 
-	limit #{size}
-	 </select>
 </mapper>

+ 1 - 5
src/main/java/com/goafanti/common/mapper/UserMapper.xml

@@ -680,11 +680,7 @@
     select
   <include refid="Base_Column_List" />
     from user
-    where  source = 0
-    and mobile = #{mobile}
-    <if test="type != null">
-     and type=#{type} 
-     </if>
+    where mobile = #{0} and type=#{1} and source = 0
   </select>
   
   <select id="selectByNameAndType" resultMap="BaseResultMap">

+ 1 - 0
src/main/java/com/goafanti/common/model/News.java

@@ -175,6 +175,7 @@ public class News {
 	}
 
 	public String getTitleImg() {
+		if(titleImg!=null && !titleImg.contains("."))return null;
 		return titleImg;
 	}
 

+ 1 - 1
src/main/java/com/goafanti/core/shiro/token/TokenManager.java

@@ -166,7 +166,7 @@ public class TokenManager {
 	 * @return
 	 */
 	public static User login(User user, Boolean rememberMe) {
-		ShiroToken token = new ShiroToken(user.getMobile(), user.getPassword(), user.getType(),AFTConstants.USER_SOURCE_REGISTER);
+		ShiroToken token = new ShiroToken(user.getUsername(), user.getPassword(), user.getType(),AFTConstants.USER_SOURCE_REGISTER);
 		token.setRememberMe(null == rememberMe ? false : rememberMe);
 		SecurityUtils.getSubject().login(token);
 		setVal2Session(CSRF_TOKEN, UUID.randomUUID().toString().replace("-", ""));

+ 1 - 1
src/main/java/com/goafanti/core/shiro/token/UserRealm.java

@@ -60,7 +60,7 @@ public class UserRealm extends AuthorizingRealm {
 			return new SimpleAuthenticationInfo(aftUser, aftUser.getPassword(), passwordUtil.getAftSalt(aftUser),
 					getName());
 		} else {
-			User user = userService.selectByMobieAndType(token.getUsername(), token.getType());
+			User user = userService.selectByNameAndType(token.getUsername(), null);
 			if (null == user) {
 				throw new UnknownAccountException();
 			}

+ 50 - 0
src/main/java/com/goafanti/evaluation/bo/ForecastIncome.java

@@ -0,0 +1,50 @@
+package com.goafanti.evaluation.bo;
+
+public class ForecastIncome {
+	private Long	marketScale	= 0l;
+	private Integer	marketRate	= 0;
+	private Long	unitPrice	= 0l;
+	private Long	saleCount	= 0l;
+	private Long	income		= 0l;
+
+	public Long getMarketScale() {
+		return marketScale;
+	}
+
+	public void setMarketScale(Long marketScale) {
+		this.marketScale = marketScale;
+	}
+
+	public Integer getMarketRate() {
+		return marketRate;
+	}
+
+	public void setMarketRate(Integer marketRate) {
+		this.marketRate = marketRate;
+	}
+
+	public Long getUnitPrice() {
+		return unitPrice;
+	}
+
+	public void setUnitPrice(Long unitPrice) {
+		this.unitPrice = unitPrice;
+	}
+
+	public Long getSaleCount() {
+		return saleCount;
+	}
+
+	public void setSaleCount(Long saleCount) {
+		this.saleCount = saleCount;
+	}
+
+	public Long getIncome() {
+		return income;
+	}
+
+	public void setIncome(Long income) {
+		this.income = income;
+	}
+
+}

+ 102 - 0
src/main/java/com/goafanti/evaluation/bo/Step1.java

@@ -0,0 +1,102 @@
+package com.goafanti.evaluation.bo;
+
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
+
+public class Step1 {
+
+	@NotNull
+	@Size(max = 128)
+	private String	name;
+
+	@NotNull
+	private Integer	industry;
+
+	@NotNull
+	@Size(max = 36)
+	private String	subIndustry;
+
+	@NotNull
+	private Integer	transferType;
+
+	@NotNull
+	private Integer	timeLeft;
+
+	@NotNull
+	@Size(max = 100)
+	private String	transferArea;
+
+	@NotNull
+	@Size(max = 36)
+	private String	currencyType;
+
+	@NotNull
+	@Pattern(regexp = "\\d{4}-\\d{2}-01")
+	private String	benchmarkDate;
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public Integer getIndustry() {
+		return industry;
+	}
+
+	public void setIndustry(Integer industry) {
+		this.industry = industry;
+	}
+
+	public String getSubIndustry() {
+		return subIndustry;
+	}
+
+	public void setSubIndustry(String subIndustry) {
+		this.subIndustry = subIndustry;
+	}
+
+	public Integer getTransferType() {
+		return transferType;
+	}
+
+	public void setTransferType(Integer transferType) {
+		this.transferType = transferType;
+	}
+
+	public Integer getTimeLeft() {
+		return timeLeft;
+	}
+
+	public void setTimeLeft(Integer timeLeft) {
+		this.timeLeft = timeLeft;
+	}
+
+	public String getTransferArea() {
+		return transferArea;
+	}
+
+	public void setTransferArea(String transferArea) {
+		this.transferArea = transferArea;
+	}
+
+	public String getCurrencyType() {
+		return currencyType;
+	}
+
+	public void setCurrencyType(String currencyType) {
+		this.currencyType = currencyType;
+	}
+
+	public String getBenchmarkDate() {
+		return benchmarkDate;
+	}
+
+	public void setBenchmarkDate(String benchmarkDate) {
+		this.benchmarkDate = benchmarkDate;
+	}
+
+}

+ 79 - 0
src/main/java/com/goafanti/evaluation/bo/Step2.java

@@ -0,0 +1,79 @@
+package com.goafanti.evaluation.bo;
+
+import javax.validation.constraints.Max;
+import javax.validation.constraints.NotNull;
+
+public class Step2 {
+	@NotNull
+	@Max(value = 5)
+	private Integer	accessMethod;
+	
+	@NotNull
+	@Max(value = 5)
+	private Integer	legalStatus;
+	
+	@NotNull
+	@Max(value = 5)
+	private Integer	patentMaintenance;
+	
+	@NotNull
+	@Max(value = 5)
+	private Integer	confidentiality;
+	
+	@NotNull
+	@Max(value = 5)
+	private Integer	decidability;
+	
+	@NotNull
+	@Max(value = 5)
+	private Integer	hasRightLimitation;
+
+	public Integer getAccessMethod() {
+		return accessMethod;
+	}
+
+	public void setAccessMethod(Integer accessMethod) {
+		this.accessMethod = accessMethod;
+	}
+
+	public Integer getLegalStatus() {
+		return legalStatus;
+	}
+
+	public void setLegalStatus(Integer legalStatus) {
+		this.legalStatus = legalStatus;
+	}
+
+	public Integer getPatentMaintenance() {
+		return patentMaintenance;
+	}
+
+	public void setPatentMaintenance(Integer patentMaintenance) {
+		this.patentMaintenance = patentMaintenance;
+	}
+
+	public Integer getConfidentiality() {
+		return confidentiality;
+	}
+
+	public void setConfidentiality(Integer confidentiality) {
+		this.confidentiality = confidentiality;
+	}
+
+	public Integer getDecidability() {
+		return decidability;
+	}
+
+	public void setDecidability(Integer decidability) {
+		this.decidability = decidability;
+	}
+
+	public Integer getHasRightLimitation() {
+		return hasRightLimitation;
+	}
+
+	public void setHasRightLimitation(Integer hasRightLimitation) {
+		this.hasRightLimitation = hasRightLimitation;
+	}
+
+}

+ 128 - 0
src/main/java/com/goafanti/evaluation/bo/Step3.java

@@ -0,0 +1,128 @@
+package com.goafanti.evaluation.bo;
+
+import javax.validation.constraints.Max;
+import javax.validation.constraints.NotNull;
+
+public class Step3 {
+	@NotNull
+	@Max(value = 6)
+	private Integer	progressiveness;
+	
+	@NotNull
+	@Max(value = 6)
+	private Integer	innovativeness;
+	
+	@NotNull
+	@Max(value = 6)
+	private Integer	ripeness;
+	
+	@NotNull
+	@Max(value = 6)
+	private Integer	alternatives;
+	
+	@NotNull
+	@Max(value = 6)
+	private Integer	defensive;
+	
+	@NotNull
+	@Max(value = 6)
+	private Integer	prospect;
+	
+	@NotNull
+	@Max(value = 6)
+	private Integer	supplyAndDemand;
+	
+	@NotNull
+	@Max(value = 6)
+	private Integer	rangeOfApplication;
+	
+	@NotNull
+	@Max(value = 6)
+	private Integer	imitable;
+	
+	@NotNull
+	@Max(value = 6)
+	private Integer	profitability;
+
+	public Integer getProgressiveness() {
+		return progressiveness;
+	}
+
+	public void setProgressiveness(Integer progressiveness) {
+		this.progressiveness = progressiveness;
+	}
+
+	public Integer getInnovativeness() {
+		return innovativeness;
+	}
+
+	public void setInnovativeness(Integer innovativeness) {
+		this.innovativeness = innovativeness;
+	}
+
+	public Integer getRipeness() {
+		return ripeness;
+	}
+
+	public void setRipeness(Integer ripeness) {
+		this.ripeness = ripeness;
+	}
+
+	public Integer getAlternatives() {
+		return alternatives;
+	}
+
+	public void setAlternatives(Integer alternatives) {
+		this.alternatives = alternatives;
+	}
+
+	public Integer getDefensive() {
+		return defensive;
+	}
+
+	public void setDefensive(Integer defensive) {
+		this.defensive = defensive;
+	}
+
+	public Integer getProspect() {
+		return prospect;
+	}
+
+	public void setProspect(Integer prospect) {
+		this.prospect = prospect;
+	}
+
+	public Integer getSupplyAndDemand() {
+		return supplyAndDemand;
+	}
+
+	public void setSupplyAndDemand(Integer supplyAndDemand) {
+		this.supplyAndDemand = supplyAndDemand;
+	}
+
+	public Integer getRangeOfApplication() {
+		return rangeOfApplication;
+	}
+
+	public void setRangeOfApplication(Integer rangeOfApplication) {
+		this.rangeOfApplication = rangeOfApplication;
+	}
+
+	public Integer getImitable() {
+		return imitable;
+	}
+
+	public void setImitable(Integer imitable) {
+		this.imitable = imitable;
+	}
+
+	public Integer getProfitability() {
+		return profitability;
+	}
+
+	public void setProfitability(Integer profitability) {
+		this.profitability = profitability;
+	}
+	
+	
+}

+ 25 - 0
src/main/java/com/goafanti/evaluation/bo/Step4.java

@@ -0,0 +1,25 @@
+package com.goafanti.evaluation.bo;
+
+import java.util.List;
+
+public class Step4 {
+	private Integer				hasIncome;
+	private List<YearIncome>	incomes;
+
+	public Integer getHasIncome() {
+		return hasIncome;
+	}
+
+	public void setHasIncome(Integer hasIncome) {
+		this.hasIncome = hasIncome;
+	}
+
+	public List<YearIncome> getIncomes() {
+		return incomes;
+	}
+
+	public void setIncomes(List<YearIncome> incomes) {
+		this.incomes = incomes;
+	}
+
+}

+ 25 - 0
src/main/java/com/goafanti/evaluation/bo/Step5.java

@@ -0,0 +1,25 @@
+package com.goafanti.evaluation.bo;
+
+import java.util.List;
+
+public class Step5 {
+	private Integer					type;
+	private List<ForecastIncome>	forecastIncomes;
+
+	public Integer getType() {
+		return type;
+	}
+
+	public void setType(Integer type) {
+		this.type = type;
+	}
+
+	public List<ForecastIncome> getForecastIncomes() {
+		return forecastIncomes;
+	}
+
+	public void setForecastIncomes(List<ForecastIncome> forecastIncomes) {
+		this.forecastIncomes = forecastIncomes;
+	}
+
+}

+ 19 - 0
src/main/java/com/goafanti/evaluation/bo/Step6.java

@@ -0,0 +1,19 @@
+package com.goafanti.evaluation.bo;
+
+import javax.validation.constraints.Max;
+import javax.validation.constraints.NotNull;
+
+public class Step6 {
+	@NotNull
+	@Max(value = 75)
+	private Integer taxRate;
+
+	public Integer getTaxRate() {
+		return taxRate;
+	}
+
+	public void setTaxRate(Integer taxRate) {
+		this.taxRate = taxRate;
+	}
+
+}

+ 67 - 0
src/main/java/com/goafanti/evaluation/bo/Step7.java

@@ -0,0 +1,67 @@
+package com.goafanti.evaluation.bo;
+
+import javax.validation.constraints.Max;
+import javax.validation.constraints.NotNull;
+
+public class Step7 {
+	@NotNull
+	@Max(value = 6)
+	private Integer	political;
+
+	@NotNull
+	@Max(value = 6)
+	private Integer	technical;
+
+	@NotNull
+	@Max(value = 6)
+	private Integer	market;
+
+	@NotNull
+	@Max(value = 6)
+	private Integer	capital;
+
+	@NotNull
+	@Max(value = 6)
+	private Integer	management;
+
+	public Integer getPolitical() {
+		return political;
+	}
+
+	public void setPolitical(Integer political) {
+		this.political = political;
+	}
+
+	public Integer getTechnical() {
+		return technical;
+	}
+
+	public void setTechnical(Integer technical) {
+		this.technical = technical;
+	}
+
+	public Integer getMarket() {
+		return market;
+	}
+
+	public void setMarket(Integer market) {
+		this.market = market;
+	}
+
+	public Integer getCapital() {
+		return capital;
+	}
+
+	public void setCapital(Integer capital) {
+		this.capital = capital;
+	}
+
+	public Integer getManagement() {
+		return management;
+	}
+
+	public void setManagement(Integer management) {
+		this.management = management;
+	}
+	
+}

+ 32 - 0
src/main/java/com/goafanti/evaluation/bo/YearIncome.java

@@ -0,0 +1,32 @@
+package com.goafanti.evaluation.bo;
+
+public class YearIncome {
+	private Integer	year;
+	private Long	income;
+	private Integer	profit;
+
+	public Integer getYear() {
+		return year;
+	}
+
+	public void setYear(Integer year) {
+		this.year = year;
+	}
+
+	public Long getIncome() {
+		return income;
+	}
+
+	public void setIncome(Long income) {
+		this.income = income;
+	}
+
+	public Integer getProfit() {
+		return profit;
+	}
+
+	public void setProfit(Integer profit) {
+		this.profit = profit;
+	}
+
+}

+ 632 - 0
src/main/java/com/goafanti/evaluation/controller/UserEvaluationApiController.java

@@ -0,0 +1,632 @@
+package com.goafanti.evaluation.controller;
+
+import java.math.BigDecimal;
+import java.math.MathContext;
+import java.math.RoundingMode;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import javax.validation.Valid;
+
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.Assert;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.common.model.DistrictGlossory;
+import com.goafanti.common.model.IndustryCategory;
+import com.goafanti.common.model.ValueEvaluation;
+import com.goafanti.common.service.DistrictGlossoryService;
+import com.goafanti.common.service.IndustryCategoryService;
+import com.goafanti.common.utils.LoggerUtils;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.evaluation.bo.ForecastIncome;
+import com.goafanti.evaluation.bo.Step1;
+import com.goafanti.evaluation.bo.Step2;
+import com.goafanti.evaluation.bo.Step3;
+import com.goafanti.evaluation.bo.Step4;
+import com.goafanti.evaluation.bo.Step5;
+import com.goafanti.evaluation.bo.Step6;
+import com.goafanti.evaluation.bo.Step7;
+import com.goafanti.evaluation.bo.YearIncome;
+import com.goafanti.evaluation.enums.ProfitRate;
+import com.goafanti.evaluation.service.ValueEvaluationService;
+
+@RestController
+@RequestMapping(value = "/api/user/evaluate")
+public class UserEvaluationApiController extends BaseApiController {
+
+	private static final String			GOVERNMENT_LOAN_ROR	= "government_loan_ror"; //政府贷款利率
+	private static final Logger			logger				= LoggerFactory.getLogger(UserEvaluationApiController.class);
+	private static final MathContext	DEFAULT_PRECISION	= new MathContext(4, RoundingMode.HALF_UP); //默认精度
+
+	private static final String			STEP1				= "0";
+	private static final String			STEP2				= "1";
+	private static final String			STEP3				= "2";
+	private static final String			STEP4				= "3";
+	private static final String			STEP5				= "4";
+	private static final String			STEP6				= "5";
+	private static final String			STEP7				= "6";
+	private static final Integer[]		SCORES				= new Integer[] { 100, 80, 60, 40, 20, 0 };
+	private static final Integer[]		DISCOUNT_SCORES		= new Integer[] { 1, 2, 3, 4, 5 }; //折扣分数
+	private static final BigDecimal		MIN_RATE			= new BigDecimal(2); //最小速率
+	private static final BigDecimal		MAX_RATE			= new BigDecimal(6); //最大速率
+	private static final BigDecimal		HUNDRED				= new BigDecimal(100);
+	private static final BigDecimal		PERCENTAGE			= new BigDecimal(0.01, DEFAULT_PRECISION);//百分比
+
+	@Autowired
+	ValueEvaluationService				valueEvaluationService; //价值评估
+	@Autowired
+	private DistrictGlossoryService		districtGlossoryService; //地区词汇
+	@Autowired
+	private IndustryCategoryService		industryCategoryService; //行业分类
+
+	/**
+	 * 新增评估数据
+	 * @return
+	 */
+	@RequestMapping(value = "/create", method = RequestMethod.GET)
+	public Result create() {
+		ValueEvaluation ve = new ValueEvaluation();
+		ve.setUid(TokenManager.getUserId());
+		ve.setStep(0);
+		ve.setValue(0l);
+		ve.setLog("{}");
+		valueEvaluationService.insert(ve);
+		return new Result(ve.getId().toString());
+	}
+
+	/**
+	 * 通过用户id获得列表数据
+	 * @param pageNo
+	 * @param pageSize
+	 * @return
+	 */
+	@RequestMapping(value = "/list", method = RequestMethod.GET)
+	public Result list(String pageNo, String pageSize) {
+		return new Result().data(valueEvaluationService.list(handlePageNo(pageNo), handlePageSize(pageSize)));
+	}
+
+	/**
+	 * 根据用户和id获得评估信息
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping(value = "/info/{id}", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
+	public Result info(@PathVariable String id) {
+		Assert.isTrue(StringUtils.isNumeric(id), ErrorConstants.EVALUATE_ID);
+		ValueEvaluation ve = valueEvaluationService.getMyEvaluation(Long.valueOf(id));
+		Assert.notNull(ve, ErrorConstants.EVALUATE_ID);
+		Map<String, Object> res = new HashMap<>();
+		res.put("name", ve.getName());
+		res.put("step", ve.getStep());
+		res.put("value", ve.getValue());
+		res.put("steps", JSON.parse(ve.getLog()));
+		return new Result().data(res);
+	}
+
+	/**
+	 * 删除评估信息(可批量)
+	 * @param ids
+	 * @return
+	 */
+	@RequestMapping(value = "/remove", method = RequestMethod.POST)
+	public Result remove(String ids) {
+		Assert.isTrue(StringUtils.isNotBlank(ids), ErrorConstants.EVALUATE_PARAM);
+		Result res = new Result();
+		List<Long> idList = new ArrayList<>();
+		String[] idArr = ids.split(",");
+		for (String id : idArr) {
+			Assert.isTrue(StringUtils.isNumeric(id), ErrorConstants.EVALUATE_PARAM);
+			idList.add(Long.valueOf(id));
+		}
+		res.data(valueEvaluationService.deleteMySteps(idList));
+		return res;
+	}
+
+	@RequestMapping(value = "/step1", method = RequestMethod.POST)
+	public Result step1(String id, @Valid Step1 data, BindingResult bindingResult) {
+		Assert.isTrue(StringUtils.isNumeric(id), ErrorConstants.EVALUATE_ID);
+		Result res = new Result();
+		if (handleBindingError(res, bindingResult)) {
+			return res;
+		}
+		updateSteps(data, 1, "0", res, id);
+		return res;
+	}
+
+	@RequestMapping(value = "/step2", method = RequestMethod.POST)
+	public Result step2(String id, @Valid Step2 data, BindingResult bindingResult) {
+		Assert.isTrue(StringUtils.isNumeric(id), ErrorConstants.EVALUATE_ID);
+		Result res = new Result();
+		if (handleBindingError(res, bindingResult)) {
+			return res;
+		}
+		updateSteps(data, 2, STEP2, res, id);
+		return res;
+	}
+
+	@RequestMapping(value = "/step3", method = RequestMethod.POST)
+	public Result step3(String id, @Valid Step3 data, BindingResult bindingResult) {
+		Assert.isTrue(StringUtils.isNumeric(id), ErrorConstants.EVALUATE_ID);
+		Result res = new Result();
+		if (handleBindingError(res, bindingResult)) {
+			return res;
+		}
+		updateSteps(data, 3, STEP3, res, id);
+		return res;
+	}
+
+	/**
+	 * 到第4步时验证hasIncome为2时加入年收入
+	 * @param id
+	 * @param hasIncome
+	 * @param incomes
+	 * @return
+	 */
+	@RequestMapping(value = "/step4", method = RequestMethod.POST)
+	public Result step4(String id, String hasIncome, String incomes) {
+		Assert.isTrue(StringUtils.isNumeric(id), ErrorConstants.EVALUATE_ID);
+		Result res = new Result();
+		Step4 step = new Step4(); //年收入(年份,收入,利润)
+		try {
+			step.setHasIncome(Integer.valueOf(hasIncome));
+			if (step.getHasIncome().equals(2)) {
+				List<YearIncome> ja = JSON.parseArray(incomes, YearIncome.class);
+				if (ja.size() != 3) {
+					res.error(buildError(ErrorConstants.EVALUATE_PARAM));
+				} else {
+					step.setIncomes(ja);
+				}
+			}
+		} catch (Exception e) {
+			res.error(buildError(ErrorConstants.EVALUATE_PARAM));
+		}
+		if (res.getError().isEmpty()) {
+			updateSteps(step, 4, STEP4, res, id);
+		}
+		return res;
+	}
+
+	@RequestMapping(value = "/step5", method = RequestMethod.POST)
+	public Result step5(String id, String type, String forecastIncomes) {
+		Assert.isTrue(StringUtils.isNumeric(id), ErrorConstants.EVALUATE_ID);
+		Result res = new Result();
+		Step5 step = new Step5(); //预测收入(市场规模,市场利率,单价,销量,收入)
+		try {
+			step.setType(Integer.valueOf(type));
+			List<ForecastIncome> ja = JSON.parseArray(forecastIncomes, ForecastIncome.class);
+			if (ja.size() != 3) {
+				res.error(buildError(ErrorConstants.EVALUATE_PARAM));
+			} else {
+				step.setForecastIncomes(ja);
+			}
+
+		} catch (Exception e) {
+			res.error(buildError(ErrorConstants.EVALUATE_PARAM));
+		}
+		if (res.getError().isEmpty()) {
+			updateSteps(step, 5, STEP5, res, id);
+		}
+		return res;
+	}
+
+	/**
+	 * 
+	 * @param id
+	 * @return
+	 */
+	@RequestMapping(value = "/step5/{id}", method = RequestMethod.GET)
+	public Result step5Info(@PathVariable String id) {
+		Assert.isTrue(StringUtils.isNumeric(id), ErrorConstants.EVALUATE_ID);
+		Result res = new Result();
+		ValueEvaluation ve = valueEvaluationService.getMyEvaluation(Long.valueOf(id));
+		try {
+			JSONObject jo = JSON.parseObject(ve.getLog());
+			Step4 step4 = ((JSON) jo.get(STEP4)).toJavaObject(Step4.class);
+			if (step4.getHasIncome().equals(2)) {
+				Step1 step1 = ((JSON) jo.get(STEP1)).toJavaObject(Step1.class);
+				res.data(calcForecastIncome(step4.getIncomes(), getIndustryCategoryValue(step1)));
+			}
+		} catch (Exception e) {
+			res.error(buildError(ErrorConstants.EVALUATE_PARAM));
+		}
+		return res;
+	}
+
+	@RequestMapping(value = "/step6", method = RequestMethod.POST)
+	public Result step6(String id, @Valid Step6 data, BindingResult bindingResult) {
+		Assert.isTrue(StringUtils.isNumeric(id), ErrorConstants.EVALUATE_ID);
+		Result res = new Result();
+		if (handleBindingError(res, bindingResult)) {
+			return res;
+		}
+		updateSteps(data, 6, STEP6, res, id);
+		return res;
+	}
+
+	@RequestMapping(value = "/step7", method = RequestMethod.POST)
+	public Result step7(String id, @Valid Step7 data, BindingResult bindingResult) {
+		Assert.isTrue(StringUtils.isNumeric(id), ErrorConstants.EVALUATE_ID);
+		Result res = new Result();
+		if (handleBindingError(res, bindingResult)) {
+			return res;
+		}
+		updateSteps(data, 7, STEP7, res, id);
+		return res;
+	}
+
+	@RequestMapping(value = "/calc/{id}", method = RequestMethod.GET)
+	public Result calc(@PathVariable String id) {
+		Assert.isTrue(StringUtils.isNumeric(id), ErrorConstants.EVALUATE_ID);
+		Result res = new Result();
+		ValueEvaluation ve = valueEvaluationService.getMyEvaluation(Long.valueOf(id));
+		if (ve == null || ve.getStep() < 7) {
+			res.error(buildError(ErrorConstants.EVALUATE_ID));
+		} else {
+			Long value = calcValue(ve, new HashMap<>());
+			res.data(value);
+			ValueEvaluation upt = new ValueEvaluation();
+			upt.setId(ve.getId());
+			upt.setValue(value);
+			valueEvaluationService.update(upt);//修改评估价值
+		}
+		return res;
+	}
+
+	@RequestMapping(value = "/report/{id}", method = RequestMethod.GET)
+	public Result report(@PathVariable String id, String noCache) {
+		Assert.isTrue(StringUtils.isNumeric(id), ErrorConstants.EVALUATE_ID);
+		Result res = new Result();
+		ValueEvaluation ve = valueEvaluationService.getMyEvaluation(Long.valueOf(id));
+		if (ve == null || ve.getStep() < 7) {
+			res.error(buildError(ErrorConstants.EVALUATE_ID));
+		} else {
+			if (noCache != null) {
+				/*sysDictService.clear(GOVERNMENT_LOAN_ROR);*/
+			}
+			Map<String, Object> map = new HashMap<>();
+			map.put("customer", TokenManager.getUserToken().getNickname());
+			calcValue(ve, map);
+			res.data(map);
+		}
+		return res;
+	}
+
+	private Long calcValue(ValueEvaluation ve, Map<String, Object> result) {
+		JSONObject log = JSON.parseObject(ve.getLog());
+		Step1 step1 = ((JSON) log.get(STEP1)).toJavaObject(Step1.class);
+		Step2 step2 = ((JSON) log.get(STEP2)).toJavaObject(Step2.class);
+		Step3 step3 = ((JSON) log.get(STEP3)).toJavaObject(Step3.class);
+		Step5 step5 = ((JSON) log.get(STEP5)).toJavaObject(Step5.class);
+		Step6 step6 = ((JSON) log.get(STEP6)).toJavaObject(Step6.class);
+		Step7 step7 = ((JSON) log.get(STEP7)).toJavaObject(Step7.class);
+		Integer timeLeft = step1.getTimeLeft();
+		timeLeft = timeLeft < 3 ? 3 : timeLeft > 10 ? 10 : timeLeft; // 剩余经济寿命最低3,最大10年
+		Map<Integer, IndustryCategory> subs = getIndustryCates(step1.getIndustry());
+
+		Map<Integer, DistrictGlossory> provinces = getProvinces();
+
+		result.put("subIndustries", Stream.of(step1.getSubIndustry().split(",")).map(it -> {
+			return subs.get(Integer.valueOf(it)).getName();
+		}).collect(Collectors.joining(",")));
+
+		result.put("transferArea", Stream.of(step1.getTransferArea().split(",")).map(it -> {
+			return it.equals("0") ? "中国全境" : provinces.get(Integer.valueOf(it)).getName();
+		}).collect(Collectors.joining(",")));
+
+		result.put("industry", industryCategoryService.list(0).stream().filter(it -> {
+			return it.getId().equals(step1.getIndustry());
+		}).findFirst().get().getName());
+
+		BigDecimal industryAverageRate = getIndustryCategoryValue(step1, subs);
+		List<Long> userForecast = step5.getForecastIncomes().stream().map(fc -> {
+			return fc.getIncome();
+		}).collect(Collectors.toList());
+		List<Long> sysForecast = calcSysForecast(userForecast, industryAverageRate, timeLeft);
+		calcUserForecast(userForecast, timeLeft);
+		List<Long> measuredForecast = calcMeasuredForecast(userForecast, sysForecast);
+
+		Map<String, Integer> profitScores = getProfitScores(step2, step3);
+		Map<String, Integer> discountRates = getDiscountRates(step7);
+
+		BigDecimal profitRate = calcProfitRate(profitScores, step1.getIndustry(), result);
+
+		/*BigDecimal governmentLoanRoR = new BigDecimal(sysDictService.getValue(GOVERNMENT_LOAN_ROR),
+				MathContext.DECIMAL32);*/
+		BigDecimal governmentLoanRoR = new BigDecimal(0);
+		BigDecimal taxRate = new BigDecimal(step6.getTaxRate());
+
+		BigDecimal discountRate = calcDiscountRate(discountRates, taxRate, governmentLoanRoR);
+		result.put("userForecast", userForecast);
+		result.put("sysForecast", sysForecast);
+		result.put("measuredForecast", measuredForecast);
+		result.put("profitRate", profitRate);
+		result.put("governmentLoanRoR", governmentLoanRoR);
+		result.put("industryAverageRate", industryAverageRate);
+		result.put("discountRate", discountRate);
+		result.put("benchmarkDate", step1.getBenchmarkDate());
+		result.put("timeLeft", timeLeft);
+		result.put("name", step1.getName());
+		Long value = calcTotal(measuredForecast, profitRate, discountRate, result);
+		result.put("value", value);
+		result.put("log", log);
+		return value;
+	}
+
+	private Long calcTotal(List<Long> measuredForecast, BigDecimal profitRate, BigDecimal discountRate,
+			Map<String, Object> result) {
+		List<Long> profitList = new ArrayList<>();
+		BigDecimal total = BigDecimal.ZERO;
+		BigDecimal incomeDiscount = BigDecimal.ZERO;
+		double discountTerm = 0.5;
+		int index = 0;
+		BigDecimal discountFactor = BigDecimal.ZERO;
+		for (Long val : measuredForecast) {
+			incomeDiscount = new BigDecimal(val).multiply(profitRate);
+			profitList.add(incomeDiscount.longValue());
+			discountFactor = BigDecimal.ONE.divide(BigDecimal.ONE.add(discountRate), 4, RoundingMode.FLOOR);
+			discountTerm += index;
+			double pow = Math.pow(discountFactor.doubleValue(), discountTerm);
+			total = total.add(incomeDiscount.multiply(new BigDecimal(pow)));
+			index++;
+		}
+		result.put("profitList", profitList); // 收入分成额
+		return total.longValue();
+	}
+
+	private BigDecimal calcDiscountRate(Map<String, Integer> discountRates, BigDecimal taxRate,
+			BigDecimal governmentLoanRoR) {
+		BigDecimal discountRate = new BigDecimal(discountRates.get("capital"))
+				.add(new BigDecimal(discountRates.get("management"))).add(new BigDecimal(discountRates.get("market")))
+				.add(new BigDecimal(discountRates.get("political")))
+				.add(new BigDecimal(discountRates.get("technical")));
+		discountRate = discountRate.add(governmentLoanRoR).divide(HUNDRED.subtract(taxRate), 4, RoundingMode.FLOOR);
+		double rate = discountRate.doubleValue();
+		rate = rate > 0.3 ? 0.3 : rate < 0.17 ? 0.17 : rate;
+		discountRate = new BigDecimal(rate, DEFAULT_PRECISION);
+		return discountRate;
+	}
+
+	private Map<String, Integer> getDiscountRates(Step7 step7) {
+		Map<String, Integer> profitScores = new HashMap<>();
+		profitScores.put("capital", getDiscountScore(step7.getCapital()));// 资金风险
+		profitScores.put("management", getDiscountScore(step7.getManagement()));// 管理风险
+		profitScores.put("market", getDiscountScore(step7.getMarket()));// 市场风险
+		profitScores.put("political", getDiscountScore(step7.getPolitical()));// 政策风险
+		profitScores.put("technical", getDiscountScore(step7.getTechnical()));// 技术风险
+		return profitScores;
+	}
+
+	private BigDecimal calcProfitRate(Map<String, Integer> profitScores, Integer industry, Map<String, Object> map) {
+		BigDecimal legalFactor = new BigDecimal(0.2, DEFAULT_PRECISION);
+		BigDecimal techFactor = new BigDecimal(0.6, DEFAULT_PRECISION);
+		BigDecimal fundFactor = legalFactor;
+
+		BigDecimal profitRate = new BigDecimal(profitScores.get("confidentiality")).multiply(legalFactor)
+				.multiply(new BigDecimal(0.4, DEFAULT_PRECISION));
+		profitRate = profitRate.add(new BigDecimal(profitScores.get("legalStatus")).multiply(legalFactor)
+				.multiply(new BigDecimal(0.3, DEFAULT_PRECISION)));
+		profitRate = profitRate.add(new BigDecimal(profitScores.get("decidability")).multiply(legalFactor)
+				.multiply(new BigDecimal(0.3, DEFAULT_PRECISION)));
+		profitRate = profitRate.add(new BigDecimal(profitScores.get("prospect")).multiply(techFactor)
+				.multiply(new BigDecimal(0.1, DEFAULT_PRECISION)));
+		profitRate = profitRate.add(new BigDecimal(profitScores.get("alternatives")).multiply(techFactor)
+				.multiply(new BigDecimal(0.2, DEFAULT_PRECISION)));
+		profitRate = profitRate.add(new BigDecimal(profitScores.get("progressiveness")).multiply(techFactor)
+				.multiply(new BigDecimal(0.2, DEFAULT_PRECISION)));
+		profitRate = profitRate.add(new BigDecimal(profitScores.get("innovativeness")).multiply(techFactor)
+				.multiply(new BigDecimal(0.1, DEFAULT_PRECISION)));
+		profitRate = profitRate.add(new BigDecimal(profitScores.get("ripeness")).multiply(techFactor)
+				.multiply(new BigDecimal(0.2, DEFAULT_PRECISION)));
+		profitRate = profitRate.add(new BigDecimal(profitScores.get("rangeOfApplication")).multiply(techFactor)
+				.multiply(new BigDecimal(0.1, DEFAULT_PRECISION)));
+		profitRate = profitRate.add(new BigDecimal(profitScores.get("defensive")).multiply(techFactor)
+				.multiply(new BigDecimal(0.1, DEFAULT_PRECISION)));
+		profitRate = profitRate.add(new BigDecimal(profitScores.get("supplyAndDemand")).multiply(fundFactor)
+				.multiply(new BigDecimal(0.6, DEFAULT_PRECISION)));
+		profitRate = profitRate.add(new BigDecimal(profitScores.get("profitability")).multiply(fundFactor)
+				.multiply(new BigDecimal(0.4, DEFAULT_PRECISION)));
+
+		BigDecimal minRate = MIN_RATE;
+		BigDecimal maxRate = MAX_RATE;
+		if (ProfitRate.containsType(industry)) {
+			ProfitRate pr = ProfitRate.getProfitRate(industry);
+			minRate = new BigDecimal(pr.getMinRate());
+			maxRate = new BigDecimal(pr.getMaxRate());
+		}
+		map.put("minRate", minRate);
+		map.put("maxRate", maxRate);
+		profitRate = maxRate.subtract(minRate).multiply(profitRate.multiply(PERCENTAGE)).add(minRate)
+				.multiply(PERCENTAGE).setScale(4, RoundingMode.FLOOR);
+
+		return profitRate;
+	}
+
+	private Map<String, Integer> getProfitScores(Step2 step2, Step3 step3) {
+		// 法律因素权重 20%
+		Map<String, Integer> profitScores = new HashMap<>();
+		profitScores.put("legalStatus", getScore(step2.getLegalStatus()));// 法律状态
+		profitScores.put("confidentiality", getScore(step2.getConfidentiality()));// 保密性
+		profitScores.put("decidability", getScore(step2.getDecidability()));// 侵权可判定性
+		// 技术因素权重 60%
+		profitScores.put("prospect", getScore(step3.getProspect()));// 领域前景
+		profitScores.put("alternatives", getScore(step3.getAlternatives()));// 可替代性
+		profitScores.put("progressiveness", getScore(step3.getProgressiveness()));// 先进性
+		profitScores.put("innovativeness", getScore(step3.getInnovativeness()));// 创新性
+		profitScores.put("ripeness", getScore(step3.getRipeness()));// 成熟度
+		profitScores.put("rangeOfApplication", getScore(step3.getRangeOfApplication()));// 应用范围
+		profitScores.put("defensive", getScore(step3.getDefensive()));// 应用范围
+		// 经济因素 20%
+		profitScores.put("supplyAndDemand", getScore(step3.getSupplyAndDemand()));// 供求关系
+		profitScores.put("profitability", getScore(step3.getProfitability()));// 独立获利能力
+
+		return profitScores;
+	}
+
+	private Integer getScore(int option) {
+		int idx = option - 1;
+		idx = idx < 0 ? 0 : idx >= SCORES.length ? SCORES.length - 1 : idx;
+		return SCORES[idx];
+	}
+
+	private Integer getDiscountScore(int option) {
+		int idx = option - 1;
+		idx = idx < 0 ? 0 : idx >= DISCOUNT_SCORES.length ? DISCOUNT_SCORES.length - 1 : idx;
+		return DISCOUNT_SCORES[idx];
+	}
+
+	private void calcUserForecast(List<Long> userForecast, Integer timeLeft) {
+		Assert.isTrue(userForecast.get(0) > 0 && userForecast.get(1) > 0, ErrorConstants.EVALUATE_PARAM);
+		BigDecimal second = new BigDecimal(userForecast.get(1));
+		BigDecimal lastYear = new BigDecimal(userForecast.get(2));
+		BigDecimal rate = lastYear.divide(second, 2, RoundingMode.HALF_UP)
+				.subtract(BigDecimal.ONE).add(second
+						.divide(new BigDecimal(userForecast.get(0)), 2, RoundingMode.HALF_UP).subtract(BigDecimal.ONE))
+				.divide(new BigDecimal(2));
+		BigDecimal step = new BigDecimal(0.1, DEFAULT_PRECISION);
+		int size = userForecast.size();
+		for (int i = size; i < timeLeft; i++) {
+			if (i < 6) {
+				lastYear = lastYear.multiply(
+						BigDecimal.ONE.add(rate.multiply(rate.subtract(step.multiply(new BigDecimal(i - size))))));
+			}
+			userForecast.add(lastYear.longValue());
+		}
+	}
+
+	private List<Long> calcSysForecast(List<Long> userForecast, BigDecimal industryAverageRate, Integer timeLeft) {
+		List<Long> sysForecast = new ArrayList<>();
+		BigDecimal lastYear = BigDecimal.ZERO;
+		BigDecimal step = new BigDecimal(0.1, DEFAULT_PRECISION);
+		industryAverageRate = industryAverageRate.multiply(PERCENTAGE);
+		for (int i = 0; i < timeLeft; i++) {
+			if (i == 0) {
+				lastYear = new BigDecimal(userForecast.get(0)).multiply(new BigDecimal(0.9, DEFAULT_PRECISION));
+			} else if (i < 6) {
+				lastYear = lastYear.multiply(BigDecimal.ONE.add(
+						industryAverageRate.multiply(BigDecimal.ONE.subtract(step.multiply(new BigDecimal(i - 1))))));
+			}
+			sysForecast.add(lastYear.longValue());
+		}
+		return sysForecast;
+	}
+
+	private List<Long> calcMeasuredForecast(List<Long> userForecast, List<Long> sysForecast) {
+		List<Long> measuredForecast = new ArrayList<>();
+		for (int i = 0; i < sysForecast.size(); i++) {
+			measuredForecast.add((userForecast.get(i) + sysForecast.get(i)) >> 1);
+		}
+		return measuredForecast;
+	}
+
+	/**
+	 * 更新评估步骤
+	 * @param step
+	 * @param nextStep
+	 * @param key
+	 * @param res
+	 * @param id
+	 */
+	private void updateSteps(Object step, Integer nextStep, String key, Result res, String id) {
+		ValueEvaluation ve = valueEvaluationService.getMyEvaluation(Long.valueOf(id));
+		Assert.notNull(ve, ErrorConstants.EVALUATE_ID);
+		ve.setStep(Math.max(nextStep, ve.getStep()));
+		if (nextStep == 1) {
+			ve.setName(((Step1) step).getName());
+		}
+		ve.setValue(0l);
+		JSONObject jo = JSON.parseObject(ve.getLog());
+		jo.put(key, step);
+		ve.setLog(jo.toJSONString());
+		res.data(valueEvaluationService.update(ve));
+	}
+
+	private boolean handleBindingError(Result res, BindingResult bindingResult) {
+		if (bindingResult.hasErrors()) {
+			LoggerUtils.debug(logger, "参数错误:[%s], [%s], [%s]", bindingResult.getFieldError().getDefaultMessage(),
+					bindingResult.getFieldError().getField(), bindingResult.getFieldError().getRejectedValue());
+			res.getError().add(buildError(ErrorConstants.EVALUATE_PARAM));
+			return true;
+		}
+		return false;
+	}
+
+	private BigDecimal getIndustryCategoryValue(Step1 step1) {
+		return getIndustryCategoryValue(step1, getIndustryCates(step1.getIndustry()));
+	}
+
+	/**
+	 * 获得行业分类
+	 * @param pid
+	 * @return
+	 */
+	private Map<Integer, IndustryCategory> getIndustryCates(Integer pid) {
+		return industryCategoryService.list(pid).stream()
+				.collect(Collectors.toMap(IndustryCategory::getId, (it) -> it));
+	}
+	
+	private Map<Integer, DistrictGlossory> getProvinces() {
+		return districtGlossoryService.list(0).stream().collect(Collectors.toMap(DistrictGlossory::getId, (it) -> it));
+	}
+
+	/**
+	 * 获得行业分类平均值
+	 * @param step1
+	 * @param cates
+	 * @return
+	 */
+	private BigDecimal getIndustryCategoryValue(Step1 step1, Map<Integer, IndustryCategory> cates) {
+		List<Integer> subIds = Stream.of(step1.getSubIndustry().split(",")).map(it -> {
+			return Integer.valueOf(it);
+		}).collect(Collectors.toList());
+		BigDecimal average = BigDecimal.ZERO;
+		int count = 0;
+		for (Integer id : subIds) {
+			if (cates.containsKey(id)) {
+				average = average.add(cates.get(id).getValue());
+				count++;
+			}
+		}
+		return average.divide(new BigDecimal(count == 0 ? 1 : count), 2, RoundingMode.HALF_UP);//average四舍五入保留2位小数
+	}
+
+	/**
+	 * 预计收入处理
+	 * @param incomes
+	 * @param growth
+	 * @return
+	 */
+	private Long[] calcForecastIncome(List<YearIncome> incomes, BigDecimal growth) {
+		BigDecimal useGrowth = growth.multiply(PERCENTAGE);
+		BigDecimal base = new BigDecimal(incomes.get(0).getIncome());
+		if (!incomes.get(1).getIncome().equals(0)) {
+			useGrowth = base.divide(new BigDecimal(incomes.get(1).getIncome()), 2, RoundingMode.CEILING)
+					.subtract(BigDecimal.ONE);//保留2位天花板数减去1
+		}
+		Long[] res = new Long[3];
+		BigDecimal one = base.multiply(useGrowth.add(BigDecimal.ONE));
+		useGrowth = useGrowth.multiply(new BigDecimal(0.9, DEFAULT_PRECISION));
+		BigDecimal two = one.multiply(useGrowth.add(BigDecimal.ONE));
+		useGrowth = useGrowth.multiply(new BigDecimal(0.8, DEFAULT_PRECISION));
+		res[2] = two.multiply(useGrowth.add(BigDecimal.ONE)).longValue();
+		res[0] = one.longValue();
+		res[1] = two.longValue();
+		return res;
+	}
+}

+ 81 - 0
src/main/java/com/goafanti/evaluation/enums/ProfitRate.java

@@ -0,0 +1,81 @@
+package com.goafanti.evaluation.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum ProfitRate {
+	CJ(1, "采掘", 2, 6),
+	HG(2, "化工", 2, 3.5),
+	GT(3, "钢铁", 2, 6),
+	JZCL(4, "建筑材料", 2, 6),
+	JZZS(5, "建筑装饰", 2, 6),
+	DQSB(6, "电气设备", 3, 4.5),
+	JXSB(7, "机械设备", 1.5, 3),
+	GFJG(8, "国防军工", 2, 6),
+	QC(9, "汽车", 2, 6),
+	JYDQ(10, "家用电器", 1, 2.5),
+	FZFZ(11, "纺织服装", 1, 2.5),
+	QGZZ(12, "轻工制造", 2, 6),
+	SYMY(13, "商业贸易", 1, 2.5),
+	NLMY(14, "农林牧渔", 2, 6),
+	SPYL(15, "食品饮料", 1, 2.5),
+	XXFW(16, "休闲服务", 1, 2.5),
+	YYSW(17, "医药生物", 2.5, 4),
+	GGSY(18, "公用事业", 2, 6),
+	JTYS(19, "交通运输", 2, 6),
+	FDC(20, "房地产", 2, 6),
+	DZ(21, "电子", 7, 10),
+	JSJ(22, "计算机", 4, 5.5),
+	CM(23, "传媒", 2, 6),
+	TX(24, "通信", 2, 6),
+	YH(25, "银行", 2, 6);
+
+	private Integer							id;
+	private String							desc;
+	private double							minRate;
+	private double							maxRate;
+
+	private static Map<Integer, ProfitRate>	map	= new HashMap<Integer, ProfitRate>();
+
+	private ProfitRate(Integer id, String desc, double minRate, double maxRate) {
+		this.id = id;
+		this.desc = desc;
+		this.minRate = minRate;
+		this.maxRate = maxRate;
+	}
+
+	static {
+		for (ProfitRate value : ProfitRate.values()) {
+			map.put(value.getId(), value);
+		}
+	}
+
+	public static ProfitRate getProfitRate(Integer code) {
+		return map.get(code);
+	}
+
+	public static String getFieldDesc(Integer code) {
+		return containsType(code) ? getProfitRate(code).getDesc() : "";
+	}
+
+	public static boolean containsType(Integer code) {
+		return map.containsKey(code);
+	}
+
+	public Integer getId() {
+		return id;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+	public double getMinRate() {
+		return minRate;
+	}
+
+	public double getMaxRate() {
+		return maxRate;
+	}
+
+}

+ 57 - 0
src/main/java/com/goafanti/evaluation/service/ValueEvaluationService.java

@@ -0,0 +1,57 @@
+package com.goafanti.evaluation.service;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.goafanti.common.dao.ValueEvaluationMapper;
+import com.goafanti.common.model.ValueEvaluation;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.JDBCIdGenerator;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
+
+@Service
+@Transactional
+public class ValueEvaluationService extends BaseMybatisDao<ValueEvaluationMapper> {
+	@Autowired
+	ValueEvaluationMapper	valueEvaluationMapper;
+
+	@Autowired
+	JDBCIdGenerator			idGenerator;
+
+	public int insert(ValueEvaluation ve) {
+		ve.setId(idGenerator.generateId());
+		return valueEvaluationMapper.insertSelective(ve);
+	}
+
+	public int update(ValueEvaluation ve) {
+		return valueEvaluationMapper.updateByPrimaryKeySelective(ve);
+	}
+
+	public ValueEvaluation getMyEvaluation(Long id) {
+		Map<String, Object> params = new HashMap<>();
+		params.put("uid", TokenManager.getUserId());
+		params.put("id", id);
+		return valueEvaluationMapper.selectByPrimaryKeyAndUser(params);
+	}
+
+	public int deleteMySteps(List<Long> ids) {
+		Map<String, Object> params = new HashMap<>();
+		params.put("uid", TokenManager.getUserId());
+		params.put("ids", ids);
+		return valueEvaluationMapper.deleteRecords(params);
+	}
+
+	@SuppressWarnings("unchecked")
+	public Pagination<ValueEvaluation> list(Integer pageNo, Integer pageSize) {
+		Map<String, Object> params = new HashMap<>();
+		params.put("uid", TokenManager.getUserId());
+		return (Pagination<ValueEvaluation>) findPage("findUserListByPage", "findUserListCount", params, pageNo,
+				pageSize);
+	}
+}

+ 0 - 1
src/main/java/com/goafanti/news/controller/AdminNewsApiController.java

@@ -138,7 +138,6 @@ public Result apply(InputNews news,BindingResult bindingResult,String[] publishP
 			}
 			News news2=new News();
 			BeanUtils.copyProperties(news, news2);
-			if(null!=news.getTitleImg())news2.setTitleImg(news.getTitleImg());
 			result.setData(newsService.updateSelectively( news2,webPages,appPages)); 
 			//publishPages
 			return result;

+ 0 - 14
src/main/java/com/goafanti/user/bo/InputUser.java

@@ -1,7 +1,5 @@
 package com.goafanti.user.bo;
 
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
 import javax.validation.constraints.Size;
 
 import com.goafanti.common.constant.ErrorConstants;
@@ -20,18 +18,6 @@ public class InputUser {
 	@Size(min = 0, max = 32, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String	username;
 	
-	@Max(value = 2, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	private Integer	type;
-	
-	public Integer getType() {
-		return type;
-	}
-
-	public void setType(Integer type) {
-		this.type = type;
-	}
-
 	public String getMobile() {
 		return mobile;
 	}

+ 8 - 7
src/main/java/com/goafanti/user/controller/UserRegisterController.java

@@ -65,10 +65,9 @@ public class UserRegisterController extends BaseController {
 					UserFields.getFieldDesc(bindingResult.getFieldError().getField())));
 			return res;
 		}
-		User u = userService.selectByMobieAndType(user.getMobile().trim(), user.getType());
+		User u = userService.selectByNameAndType(user.getUsername().trim(), null);
 		if (null != u) {
 			res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "用户已存在"));
-			return res;
 		}
 		// 验证码15分钟有效
 		if (TimeUtils.checkOverTime("register")) {
@@ -82,6 +81,7 @@ public class UserRegisterController extends BaseController {
 		if (res.getError().isEmpty()) {
 			User us = new User();
 			us.setId(UUID.randomUUID().toString());
+			us.setUsername(user.getUsername().trim());
 			us.setMobile(user.getMobile().trim());
 			us.setPassword(user.getPassword());
 			Calendar now = Calendar.getInstance();
@@ -89,8 +89,8 @@ public class UserRegisterController extends BaseController {
 			us.setCreateTime(now.getTime());
 			us.setUpdateTime(now.getTime());
 			us.setPassword(passwordUtil.getEncryptPwd(us));
-			us.setNickname(user.getUnitName());
-			us.setType(user.getType());
+			us.setLvl(0);
+			us.setNickname(user.getUsername());
 			us.setSource(AFTConstants.USER_SOURCE_REGISTER);
 			us.setStatus(AFTConstants.USER_STATUS_NORMAL);
 			us.setShareType(AFTConstants.USER_SHARE_PUBLIC);
@@ -119,7 +119,7 @@ public class UserRegisterController extends BaseController {
 					UserFields.getFieldDesc(bindingResult.getFieldError().getField())));
 			return res;
 		}
-		User u = userService.selectByMobieAndType(user.getMobile().trim(), user.getType());
+		User u = userService.selectByNameAndType(user.getUsername().trim(), null);
 		if (null != u) {
 			res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "用户已存在"));
 		}
@@ -135,6 +135,7 @@ public class UserRegisterController extends BaseController {
 		if (res.getError().isEmpty()) {
 			User us = new User();
 			us.setId(UUID.randomUUID().toString());
+			us.setUsername(user.getUsername().trim());
 			us.setMobile(user.getMobile().trim());
 			us.setPassword(user.getPassword());
 			Calendar now = Calendar.getInstance();
@@ -142,8 +143,8 @@ public class UserRegisterController extends BaseController {
 			us.setCreateTime(now.getTime());
 			us.setUpdateTime(now.getTime());
 			us.setPassword(passwordUtil.getEncryptPwd(us));
-			us.setType(user.getType());
-			us.setNickname(user.getUnitName());
+			us.setLvl(0);
+			us.setNickname(user.getUsername());
 			us.setSource(AFTConstants.USER_SOURCE_REGISTER);
 			us.setStatus(AFTConstants.USER_STATUS_NORMAL);
 			us.setShareType(AFTConstants.USER_SHARE_PUBLIC);

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

@@ -55,11 +55,9 @@ app.name=AFT
 app.mobile.website=http://m.kedexinxi.com
 template.cacheable=false
 
-
 static.host=//sclient.jishutao.com:8088/client/1.0.0
-
-portal.host=//sportal.jishutao.com/portal/1.0.0
-
+
+portal.host=//sportal.jishutao.com:80/portal/1.0.0
 
 avatar.host=//sclient.jishutao.com
 avatar.upload.host=//sclient.jishutao.com/upload

+ 4 - 18
src/main/webapp/WEB-INF/views/common.html

@@ -212,12 +212,12 @@
 	                        </ol>
                         </div>
                     </li>                           
-                    <!-- <li th:class="${subM}=='safeguarding'?active:''" >
+                    <li th:class="${subM}=='safeguarding'?active:''" >
                     <div>
                         <a th:href="@{/portal/service/safeguarding}">知识产权维权</a>
  
                        </div>
-                    </li> -->
+                    </li>
  <!--                    <li th:class="${subM}=='protect'?active:''" >
                     <div>
                         <a th:href="@{/portal/service/serviceIndex}">知识产权维权</a>
@@ -424,13 +424,6 @@
 							<label for="pass"><img th:src="${portalHost+'/img/login_password.png'}"/></label>
 							<input type="password" name="pass" id="Lo_pass" placeholder="请输入密码" />
 						</div>
-						<div class="login_pass">
-							<img th:src="${portalHost+'/img/resiger_username.jpg'}" alt=""/>
-							<select id="customerType">
-								<option value="0">个人</option>
-								<option value="1">企业</option>
-							</select>
-						</div>
 						<div class="login_check">
 						<a href="#">忘记密码?</a>
 						</div>
@@ -449,23 +442,16 @@
 						<a href="">忘记密码?</a>
 					</div>
 					<div class="forget_center">
-					<!-- <div class="user">
+					<div class="user">
 						<label for="forget_user">
 							用户名:<input type="text" name="type" id="forget_user" placeholder="请输入您的用户名"/>
 						</label>
-					</div> -->
+					</div>
 						<div class="phone">
 							<label for="forget_phone">
 								手机号码:<input type="text" name="type" id="forget_phone" placeholder="请输入您的手机号码..."/>
 							</label>
 						</div>
-						<div class="login_pa">
-							客户类别:
-							<select id="customerTy">
-								<option value="0">个人</option>
-								<option value="1">企业</option>
-							</select>
-						</div>
 						<div class="cellcode_">
 							<div>
 								验证码:<input type="text" name="cellCode" placeholder="手机验证码" id="photo_n"/>

+ 463 - 0
src/main/webapp/WEB-INF/views/portal/evaluation/evaluate.html

@@ -0,0 +1,463 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:th="http://www.thymeleaf.org"
+	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+
+<head th:replace="common::header(~{::title},~{::link})">
+	<meta charset="utf-8" />
+	<title>高企自评</title>
+	<link th:href="${portalHost+'/vendors.css'}" rel="stylesheet">
+	<link th:href="${portalHost+'/evaluation/evaluate.css'}" rel="stylesheet"></head>
+</head>
+
+<body>
+	<div th:replace="common::nav('','evaluate')"></div>
+	<div id="myCarousel" class="carousel">
+		<!-- 轮播(Carousel)项目 -->
+		<div class="carousel-inner">
+			<div class="item active">
+				<img th:src="${portalHost+'/img/newMenu/slide_img.png'}" src="../../img/newMenu/slide_img.png" alt="First slide">
+			</div>
+		</div>
+	</div>
+
+	
+	<div class="container basic_info">
+		<div class="title">
+			<h1>免费诊断</h1>
+			<p>Free diagnosis</p>
+			<span></span>
+		</div>
+		<div class="contentCenter">
+			<div class="basic_nav">
+				<ul>
+					<li class="li0 active">基本信息</li>
+					<li class="li1">财务信息</li>
+					<li class="li2">知识产权</li>
+					<li class="li3">研发管理</li>
+				</ul>
+			</div>
+			<div class="basic_content">
+				<form class="form-horizontal" role="form">
+					<div class="tab0 table show">
+						<div class="form-group">
+							<label class="col-sm-2 control-label">企业名称 <span class="red">*</span></label>
+							<div class="col-sm-7 posi">
+								<input type="text" class="form-control" id="name">
+							</div>
+						</div>
+						<div class="form-group">
+							<label class="col-sm-2 control-label">注册时间 <span class="red">*</span></label>
+							<div class="col-sm-7 posi">
+								<input id="registDate" class="form-control dateTime" type="text" placeholder="请选择日期"/> 
+							</div>
+						</div>
+						<div class="form-group">
+							<label class="col-sm-2 control-label">联系人 <span class="red">*</span></label>
+							<div class="col-sm-7 posi">
+								<input type="text" class="form-control" id="contacts">
+							</div>
+						</div>
+						<div class="form-group">
+							<label class="col-sm-2 control-label">电话 <span class="red">*</span></label>
+							<div class="col-sm-7 posi">
+								<input type="text" class="form-control" id="tel">
+							</div>
+						</div>
+						<div class="form-group">
+							<label class="col-sm-2 control-label">邮箱 <span class="red">*</span></label>
+							<div class="col-sm-7 posi">
+								<input type="text" class="form-control" id="email">
+							</div>
+						</div>
+						<div class="form-group">
+							<label class="col-sm-2 control-label">注册地址 <span class="red">*</span></label>
+							<div class="col-sm-3 posi">
+								<select class="form-control" id="province">
+										<option value="">默认选择</option>
+									</select>
+							</div>
+							<div class="col-sm-4">
+								<select class="form-control" id="city">
+										<option value="">默认选择</option>
+								</select>
+							</div>
+						</div>
+						<div class="form-group">
+							<label class="col-sm-2 control-label">主营产品技术领域 <span class="red">*</span></label>
+							<div class="col-sm-7 posi">
+								<select class="form-control" id="technicalField">
+										<option value="">默认选择</option>
+									</select>
+							</div>
+						</div>
+						<div class="form-group">
+							<label class="col-sm-2 control-label">职工总数 <span class="red">*</span></label>
+							<div class="col-sm-7 posi">
+								<input type="text" class="form-control" id="numberEmployees">
+							</div>
+						</div>
+						<div class="form-group">
+							<label class="col-sm-2 control-label">科技人员数 <span class="red">*</span></label>
+							<div class="col-sm-7 posi">
+								<input type="text" class="form-control" id="numberTechnician">
+							</div>
+						</div>
+	
+						<div class="form-group">
+							<div class="col-sm-offset-2 col-sm-7">
+								<button class="btn btn-default nextBtn" value="1">下一步</button>
+							</div>
+						</div>
+					</div>
+					<div class="tab1 table">
+						<div class="form-group finance_title">
+							<label class="col-sm-1 control-label"></label>
+							<div class="col-sm-5">
+								<div>近3年净资产(万元)</div>
+							</div>
+							<div class="col-sm-5">
+								<div>近3年销售收入(万元)</div>
+							</div>
+						</div>
+						<div class="form-group">
+							<label class="col-sm-1 control-label">[[${#dates.year(new java.util.Date()) - 3}]] <span class="red">*</span></label>
+							<div class="col-sm-5">
+								<input type="text" class="form-control" id="assets1">
+							</div>
+							<div class="col-sm-5">
+								<input type="text" class="form-control" id="income1">
+							</div>
+						</div>
+						<div class="form-group">
+							<label class="col-sm-1 control-label">[[${#dates.year(new java.util.Date()) - 2}]] <span class="red">*</span></label>
+							<div class="col-sm-5">
+								<input type="text" class="form-control" id="assets2">
+							</div>
+							<div class="col-sm-5">
+								<input type="text" class="form-control" id="income2">
+							</div>
+						</div>
+						<div class="form-group">
+							<label class="col-sm-1 control-label">[[${#dates.year(new java.util.Date()) - 1}]] <span class="red">*</span></label>
+							<div class="col-sm-5">
+								<input type="text" class="form-control" id="assets3">
+							</div>
+							<div class="col-sm-5">
+								<input type="text" class="form-control" id="income3">
+							</div>
+						</div>
+						<div class="form-group">
+							<div class="col-sm-offset-1 col-sm-7">
+								<button class="btn btn-default nextBtn" value="2">下一步</button>
+							</div>
+						</div>
+					</div>
+					<div class="tab2 table">
+						<div class="ipr_content">
+							<div class="ipr_nav">
+								<ul id="myTab">
+									<li class="active"><a href="#tab1" data-toggle="tab">I类</a></li>
+									<li><a href="#tab2" data-toggle="tab">II类</a></li>
+									<li><a href="#tab3" data-toggle="tab">其他</a></li>
+									<li></li>
+								</ul>
+							</div>
+							<div id="myTabContent" class="content_list tab-content">
+								<div id="tab1" class="tab-pane in active">
+									<div class="form-group ipr_title">
+										<label class="col-sm-2 control-label"></label>
+										<div class="col-sm-7">
+											<div>发明专利(X1)</div>
+										</div>
+									</div>
+									<div class="form-group">
+										<label class="col-sm-2 control-label">其中:自主研发</label>
+										<div class="col-sm-7">
+											<input type="text" class="form-control">
+										</div>
+									</div>
+									<div class="form-group">
+										<label class="col-sm-2 control-label">受让、受赠和并购等</label>
+										<div class="col-sm-7">
+											<input type="text" class="form-control">
+										</div>
+									</div>
+	
+									<div class="form-group ipr_title">
+										<label class="col-sm-2 control-label"></label>
+										<div class="col-sm-7">
+											<div>植物新品种(X2)</div>
+										</div>
+									</div>
+									<div class="form-group">
+										<label class="col-sm-2 control-label">其中:自主研发</label>
+										<div class="col-sm-7">
+											<input type="text" class="form-control">
+										</div>
+									</div>
+									<div class="form-group">
+										<label class="col-sm-2 control-label">受让、受赠和并购等</label>
+										<div class="col-sm-7">
+											<input type="text" class="form-control">
+										</div>
+									</div>
+									<div class="form-group ipr_title">
+										<label class="col-sm-2 control-label"></label>
+										<div class="col-sm-7">
+											<div>国家级农作物品种(X3)</div>
+										</div>
+									</div>
+									<div class="form-group">
+										<label class="col-sm-2 control-label">其中:自主研发</label>
+										<div class="col-sm-7">
+											<input type="text" class="form-control">
+										</div>
+									</div>
+									<div class="form-group">
+										<label class="col-sm-2 control-label">受让、受赠和并购等</label>
+										<div class="col-sm-7">
+											<input type="text" class="form-control">
+										</div>
+									</div>
+									<div class="form-group ipr_title">
+										<label class="col-sm-2 control-label"></label>
+										<div class="col-sm-7">
+											<div>国家新药(X4)</div>
+										</div>
+									</div>
+									<div class="form-group">
+										<label class="col-sm-2 control-label">其中:自主研发</label>
+										<div class="col-sm-7">
+											<input type="text" class="form-control">
+										</div>
+									</div>
+									<div class="form-group">
+										<label class="col-sm-2 control-label">受让、受赠和并购等</label>
+										<div class="col-sm-7">
+											<input type="text" class="form-control">
+										</div>
+									</div>
+									<div class="form-group ipr_title">
+										<label class="col-sm-2 control-label"></label>
+										<div class="col-sm-7">
+											<div>国家一级中药保护品种(X5)</div>
+										</div>
+									</div>
+									<div class="form-group">
+										<label class="col-sm-2 control-label">其中:自主研发</label>
+										<div class="col-sm-7">
+											<input type="text" class="form-control">
+										</div>
+									</div>
+									<div class="form-group">
+										<label class="col-sm-2 control-label">受让、受赠和并购等</label>
+										<div class="col-sm-7">
+											<input type="text" class="form-control">
+										</div>
+									</div>
+									<div class="form-group ipr_title">
+										<label class="col-sm-2 control-label"></label>
+										<div class="col-sm-7">
+											<div>集成电路布图设计专有权(X6)</div>
+										</div>
+									</div>
+									<div class="form-group">
+										<label class="col-sm-2 control-label">其中:自主研发</label>
+										<div class="col-sm-7">
+											<input type="text" class="form-control">
+										</div>
+									</div>
+									<div class="form-group">
+										<label class="col-sm-2 control-label">受让、受赠和并购等</label>
+										<div class="col-sm-7">
+											<input type="text" class="form-control">
+										</div>
+									</div>
+								</div>
+								<div id="tab2" class="tab-pane">
+									<div class="form-group ipr_title">
+										<label class="col-sm-2 control-label"></label>
+										<div class="col-sm-7">
+											<div>实用新型专利(Y1)</div>
+										</div>
+									</div>
+									<div class="form-group">
+										<label class="col-sm-2 control-label">其中:自主研发</label>
+										<div class="col-sm-7">
+											<input type="text" class="form-control">
+										</div>
+									</div>
+									<div class="form-group">
+										<label class="col-sm-2 control-label">受让、受赠和并购等</label>
+										<div class="col-sm-7">
+											<input type="text" class="form-control">
+										</div>
+									</div>
+									<div class="form-group ipr_title">
+										<label class="col-sm-2 control-label"></label>
+										<div class="col-sm-7">
+											<div>外观设计专利(Y2)</div>
+										</div>
+									</div>
+									<div class="form-group">
+										<label class="col-sm-2 control-label">其中:自主研发</label>
+										<div class="col-sm-7">
+											<input type="text" class="form-control">
+										</div>
+									</div>
+									<div class="form-group">
+										<label class="col-sm-2 control-label">受让、受赠和并购等</label>
+										<div class="col-sm-7">
+											<input type="text" class="form-control">
+										</div>
+									</div>
+									<div class="form-group ipr_title">
+										<label class="col-sm-2 control-label"></label>
+										<div class="col-sm-7">
+											<div>软件著作权(Y3)</div>
+										</div>
+									</div>
+									<div class="form-group">
+										<label class="col-sm-2 control-label">其中:自主研发</label>
+										<div class="col-sm-7">
+											<input type="text" class="form-control">
+										</div>
+									</div>
+									<div class="form-group">
+										<label class="col-sm-2 control-label">受让、受赠和并购等</label>
+										<div class="col-sm-7">
+											<input type="text" class="form-control">
+										</div>
+									</div>
+								</div>
+								<div id="tab3" class="tab-pane">
+									<div class="checkbox">
+										<label><input type="checkbox" disabled="disabled" value="">制定标准、检测方法、技术规范的情况 <span class="red">*</span></label>
+									</div>
+									<label class="checkbox-inline">
+											<input type="radio" name="optionsRadiosinline" id="optionsRadios3" value="option1"> 是
+										</label>
+									<label class="checkbox-inline">
+											<input type="radio" name="optionsRadiosinline" id="optionsRadios4"  value="option2"> 否
+										</label>
+									<div class="form-group">
+										<div class="col-sm-7">
+											<button class="btn btn-default nextBtn" value="3">下一步</button>
+										</div>
+									</div>
+								</div>
+							</div>
+						</div>
+					</div>
+					<div class="tab3 table rd_content">
+						<div class="checkbox">
+							<label><input type="checkbox" disabled="disabled" value="">是否制定了企业研究开发的组织管理制度、建立了研发投入核算体系、编制了研发费用辅助账:</label>
+						</div>
+						<label class="checkbox-inline">
+								<input type="radio" name="auxiliary" value="option1"> A、3项都满足
+							</label>
+						<label class="checkbox-inline">
+								<input type="radio" name="auxiliary" value="option2"> B、满足2项
+							</label>
+						<label class="checkbox-inline">
+								<input type="radio" name="auxiliary" value="option3"> C、满足1项
+							</label>
+						<label class="checkbox-inline">
+								<input type="radio" name="auxiliary" value="option4"> D、都不满足
+							</label>
+	
+						<div class="checkbox">
+							<label><input type="checkbox" disabled="disabled" value="">是否设立研发机构、是否开展产学研合作:</label>
+						</div>
+						<label class="checkbox-inline">
+								<input type="radio" name="cooperation" value="option1"> A、设立研发机构并开展产学研合作
+							</label>
+						<label class="checkbox-inline">
+								<input type="radio" name="cooperation" value="option2"> B、设立研发机构但无产学研合作
+							</label>
+						<label class="checkbox-inline">
+								<input type="radio" name="cooperation" value="option3"> C、无研发机构无产学研合作
+							</label>
+	
+						<div class="checkbox">
+							<label><input type="checkbox" disabled="disabled" value="">是否建立了科技成果转化的组织实施与激励奖励制度,建立开放式的创新创业平台:</label>
+						</div>
+						<div class="radioGroup">
+							<div class="radio">
+								<label>
+										<input type="radio" name="platform" value="option1"> A、建立了科技成果转化的组织实施与激励奖励制度,且有开放式的创新创业平台
+									</label>
+							</div>
+							<div class="radio">
+								<label>
+										<input type="radio" name="platform" value="option2"> B、建立了科技成果转化的组织实施与激励奖励制度,无开放式的创新创业平台
+									</label>
+							</div>
+							<div class="radio">
+								<label>
+										<input type="radio" name="platform" value="option3"> C、没有科技成果转化的组织实施与激励奖励制度,无开放式的创新创业平台
+									</label>
+							</div>
+						</div>
+	
+						<div class="checkbox">
+							<label><input type="checkbox" disabled="disabled" value="">是否建立了科技人员的培养进修、职工技能培训、优秀人才引进,以及人才绩效评价奖励制度:</label>
+						</div>
+						<div class="radioGroup">
+							<div class="radio">
+								<label>
+										<input type="radio" name="employeeSystem" value="option1"> 是
+									</label>
+							</div>
+							<div class="radio">
+								<label>
+										<input type="radio" name="employeeSystem" value="option2"> 否
+									</label>
+							</div>
+						</div>
+	
+						<div class="form-group">
+							<div class="col-sm-7">
+								<button type="" class="btn btn-default nextBtn" id="submit">提交</button>
+							</div>
+						</div>
+					</div>
+				</form>
+			</div>
+			<div class="result_txt table">
+				<h3>评估结果:</h3>
+				<div class="result_txt_content">
+					<div>
+						<label>评估企业: </label>
+						<span id="result_name">公司</span>
+					</div>
+					<div>
+						<label>评估结果: </label>
+						<span id="result_grade">较差</span>
+						<span class="red">(具体得分情况请联系客服)</span>
+					</div>
+					<h4>具体情况如下:</h4>
+					<p>1.您已具备申请高新技术企业的条件。知识产权数量已达标,建议持续申请与主营产品相关的知识产权,为三年后的重新认定,增加知识产权的方式有购买/转让/自主申请;</p>
+					<p>2.建议通过丰富证明材料强化科技成果转化质量(证明材料:销售合同、销售发票、用户使用报告、成果查新、产品检测报告、产品说明书等);</p>
+					<p>3.建议加强企业研发机构建设①完善研发管理制度等;②研发场地、设备设施等配套;③加强与科研院校合作;</p>
+					<p>4.成长性得分为
+						<span id="result_financialScore">11.9</span>分,
+						<span id="result_financialScore_txt">财务增长性较好</span>。 (净资产增长率得分
+						<span id="result_assets">5.7</span>,销售增长率得分<span id="result_income">6.2</span>)</p>
+				</div>
+			</div>
+		</div>
+	</div>
+	<!-- 中间内容结束 -->
+	 <footer>
+      <div th:replace="common::copyright"></div>
+		<div th:replace="common::login"></div>
+    </footer>
+    <div th:replace="common::footer(~{::script})">
+		<script type="text/javascript" th:src="${portalHost + '/vendors.js'}"></script>
+		<script type="text/javascript" th:src="${portalHost+'/evaluation/evaluate.js'}"></script>
+	</div>
+</body>
+
+</html>

Разлика између датотеке није приказан због своје велике величине
+ 234 - 0
src/main/webapp/WEB-INF/views/portal/evaluation/index.html


Разлика између датотеке није приказан због своје велике величине
+ 465 - 1
src/main/webapp/WEB-INF/views/portal/index.html


+ 147 - 0
src/main/webapp/WEB-INF/views/portal/service/safeguarding.html

@@ -0,0 +1,147 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:th="http://www.thymeleaf.org"
+	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+
+<head th:replace="common::header(~{::title},~{::link})">
+    <title>知识产权维权</title>
+    <link th:href="${portalHost+'/vendors.css'}" rel="stylesheet">
+    <link th:href="${portalHost+'/newMenu/safeguarding.css'}" rel="stylesheet"></head>
+<body>
+<div th:replace="common::nav('','safeguarding')"></div>
+     <!-- 上面是公共头部 -->
+    <div class="continueHighBanner">
+        <img th:src="${portalHost+'/img/safeguarding/safeguarding_banner.png'}" alt="">
+    </div>
+    <div class="container">
+        <h3>维权百科</h3>
+        <ul class="safeguardingBody">
+            <li>
+                <div class="listImg">
+                    <img th:src="${portalHost + '/img/safeguarding/safeguarding01.png'}" alt="">
+                </div>
+                <div class="listTxt">
+                    <div>
+                        <img th:src="${portalHost + '/img/safeguarding/safeguarding_deng01.png'}" alt="" >
+                    </div>
+                    <div class="listTxtGrounp">
+                        <div>
+                            <h4>低价乱象</h4>
+                            <small><span class="red">Low price chaos / </span>Conception</small>
+                            <p>低价是指经销商未按照品牌商或厂家指导价格,低于指导价格进行网络销售的行为。对品牌商整体的价格体系造成巨大的冲击,严重紊乱了原有经销商的体系。</p>
+                        </div>
+                        <div>
+                            <h4>危害</h4>
+                            <small><span class="red">Low price chaos / </span>Harm</small>
+                            <p>商家为谋求薄利多销,低于市场价格销售,其他商家跟风盛行,导致商家之间展开价格拉锯战,最后厂家无利可谋。</p>
+                        </div>
+                    </div>
+                </div>
+            </li>
+            <li>
+                <div class="listImg">
+                    <img th:src="${portalHost + '/img/safeguarding/safeguarding02.png'}" alt="">
+                </div>
+                <div class="listTxt">
+                    <div>
+                        <img th:src="${portalHost + '/img/safeguarding/safeguarding_deng03.png'}" alt="" >
+                    </div>
+                    <div class="listTxtGrounp">
+                        <div>
+                            <h4>未授权</h4>
+                            <small><span class="red">Unauthorized sales / </span>Conception</small>
+                            <p>非授权销售是指没有预先经过品牌方允许,个人或者公司私自在网上开店进行销售;线下的经销商未经允许私自在网上开店进行销售同样是非授权销售的一种。</p>
+                        </div>
+                        <div>
+                            <h4>危害</h4>
+                            <small><span class="red">Unauthorized sales / </span>Harm</small>
+                            <p>降低线上授权商家的积极性,导致线上授权商家抱怨。非授权店铺大肆倾销产品,品牌价格体系遭到严重破坏。导致经销商对品牌方丧失信心,招商难上加难。</p>
+                        </div>
+                    </div>
+                </div>
+            </li>
+            <li>
+                <div class="listImg">
+                    <img th:src="${portalHost + '/img/safeguarding/safeguarding03.png'}" alt="">
+                </div>
+                <div class="listTxt">
+                    <div>
+                        <img th:src="${portalHost + '/img/safeguarding/safeguarding_deng04.png'}" alt="" >
+                    </div>
+                    <div class="listTxtGrounp">
+                        <div>
+                            <h4>商标侵权</h4>
+                            <small><span class="red">Trademark infringement / </span>Conception</small>
+                            <p>1.未经商标注册人的许可,在同一种商品或者类似商品上使用与其注册商标相同或者近似的商标的 </p>
+                            <p>2.销售侵犯注册商标专用权的商品的 </p>
+                            <p>3.伪造、擅自制造他人注册商标标识或者销售伪造、擅自制造的注册商标标识</p>
+                            <p>4.未经商标注册人同意,更换其注册商标并将该更换商标的商品又投入市场 </p>
+                            <p>5.给他人的注册商标专用权造成其他损害的行为</p>
+                        </div>
+                    </div>
+                </div>
+            </li>
+            <li>
+                <div class="listImg">
+                    <img th:src="${portalHost + '/img/safeguarding/safeguarding05.png'}" alt="">
+                </div>
+                <div class="listTxt">
+                    <div>
+                        <img th:src="${portalHost + '/img/safeguarding/safeguarding_deng05.png'}" alt="" >
+                    </div>
+                    <div class="listTxtGrounp">
+                        <div>
+                            <h4>专利侵权</h4>
+                            <small><span class="red">patent infringement / </span>Conception</small>
+                            <p>1.未经许可制造专利产品的行为</p>
+                            <p>2.故意使用发明或实用新型专利产品的行为</p>
+                            <p>3.销售、许诺销售未经许可的专利产品的行为</p>
+                            <p>4.使用专利方法以及使用、销售、许诺销售依照专利方法直接获得的产品的行为</p>
+                            <p>5.进口专利产品或进口依照专利方法直接得的产品的行为</p>
+                            <p>6.假冒他人专利的行为</p>
+                            <p>7.冒充专利的行为</p>
+                        </div>
+                    </div>
+                </div>
+            </li>
+            <li>
+                <div class="listImg">
+                    <img th:src="${portalHost + '/img/safeguarding/safeguarding06.png'}" alt="">
+                    <img th:src="${portalHost + '/img/safeguarding/safeguarding07.png'}" alt="">
+                </div>
+                <div class="listTxt">
+                    <div>
+                        <img th:src="${portalHost + '/img/safeguarding/safeguarding_deng06.png'}" alt="" >
+                    </div>
+                    <div class="listTxtGrounp">
+                        <div>
+                            <h4>著作侵权</h4>
+                            <small><span class="red">Copyright infringement / </span>Conception</small>
+                            <p>1.未经著作权人许可,发表其作品的</p>
+                            <p>2.未经合作作者许可,将与他人合作创作的作品当作自己单独创作的作品发表的</p>
+                            <p>3.没有参加创作,为谋取个人名利,在他人作品上署名的</p>
+                            <p>4.歪曲、篡改他人作品的</p>
+                            <p>5.剽窃他人作品的</p>
+                            <p>6.未经著作权人许可,以展览、摄制电影和以类似摄制电影的方法使用作品,或者以改编、翻译、注释等方式使用作品的,本法另有规定的除外</p>
+                            <p>7.使用他人作品,应当支付报酬而未支付的</p>
+                            <p>8.未经电影作品和以类似摄制电影的方法创作的作品、计算机软件、录音录像制品的著作权人或者与著作权有关的权利人许可,出租其作品或者录音录像制品的,本法另有规定的除外</p>
+                            <p>9.未经出版者许可,使用其出版的图书、期刊的版式设计的</p>
+                            <p>10.未经表演者许可,从现场直播或者公开传送其现场表演,或者录制其表演的</p>
+                            <p>11.其他侵犯著作权以及与著作权有关的权益的行为</p>
+                        </div>
+                    </div>
+                </div>
+            </li>
+        </ul>
+    </div>
+    <!-- 下面是公共底部 -->
+    <footer>
+		<div th:replace="common::copyright"></div>
+		<div th:replace="common::login"></div>
+	</footer>
+	<div th:replace="common::footer(~{::script})">
+		<script type="text/javascript" th:src="${portalHost + '/vendors.js'}"></script>
+		<script type="text/javascript" th:src="${portalHost+'/newMenu/services.js'}"></script>
+	</div>
+</body>
+</html>

Разлика између датотеке није приказан због своје велике величине
+ 1 - 2
src/main/webapp/WEB-INF/views/portal/service/serviceIndex.html


Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
src/main/webapp/WEB-INF/views/portal/technologyTrading/tradingIndex.html


+ 18 - 0
src/main/webapp/WEB-INF/views/user/account/evaluateInfo.html

@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:th="http://www.thymeleaf.org">
+<head th:replace="common::header(~{::title},~{::link})">
+	<title>价值评估页</title>
+	<link th:href="${staticHost+'/dll/dll.css'}" rel="stylesheet">
+	<link th:href="${staticHost+'/user/account/evaluateInfo.css'}" rel="stylesheet">
+</head>
+<body>
+	<div id="root"></div>
+	
+	<div th:replace="common::footer(~{::script})">
+		<script type="text/javascript" th:src="${staticHost+'/vendors.js'}"></script>
+		<script type="text/javascript" th:src="${staticHost+'/dll/dll.js'}"></script>
+		<script type="text/javascript" th:src="${staticHost+'/user/account/evaluateInfo.js'}"></script>
+	</div>
+</body>
+</html>