소스 검색

科技需求

wanghui 7 년 전
부모
커밋
febde02ce7
21개의 변경된 파일1148개의 추가작업 그리고 715개의 파일을 삭제
  1. 4 3
      GeneratorConfig.xml
  2. 3 46
      src/main/java/com/goafanti/achievement/controller/AdminAchievementApiController.java
  3. 6 6
      src/main/java/com/goafanti/achievement/controller/UserAchievementApiController.java
  4. 2 2
      src/main/java/com/goafanti/admin/controller/AdminUserCertifyApiController.java
  5. 2 5
      src/main/java/com/goafanti/app/controller/AppUserController.java
  6. 2 2
      src/main/java/com/goafanti/business/controller/AdminBusinessProjectController.java
  7. 2 2
      src/main/java/com/goafanti/business/controller/AdminVarietiesApiController.java
  8. 2 0
      src/main/java/com/goafanti/common/constant/ErrorConstants.java
  9. 4 2
      src/main/java/com/goafanti/common/constant/PageConstants.java
  10. 4 42
      src/main/java/com/goafanti/common/enums/AttachmentType.java
  11. 13 10
      src/main/java/com/goafanti/common/mapper/DemandMapper.xml
  12. 1003 505
      src/main/java/com/goafanti/common/model/Demand.java
  13. 1 61
      src/main/java/com/goafanti/common/utils/FileUtils.java
  14. 1 0
      src/main/java/com/goafanti/demand/bo/DemandListBo.java
  15. 15 4
      src/main/java/com/goafanti/demand/bo/InputDemand.java
  16. 12 5
      src/main/java/com/goafanti/demand/controller/AdminDemandApiController.java
  17. 58 10
      src/main/java/com/goafanti/demand/controller/UserDemandApiController.java
  18. 6 4
      src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java
  19. 2 2
      src/main/java/com/goafanti/portal/controller/PortalOrderApiController.java
  20. 3 3
      src/main/java/com/goafanti/user/controller/UserApiController.java
  21. 3 1
      src/main/resources/props/error.properties

+ 4 - 3
GeneratorConfig.xml

@@ -4,11 +4,12 @@
   <!-- <classPathEntry location="C:/Users/Administrator/.dbeaver-drivers/maven/maven-central/mysql/mysql-connector-java-5.1.44.jar" /> -->
   <classPathEntry location="E:/mysql-connector-java-5.1.40.jar" />
   <context id="context1">	
+ 	<property name="javaFileEncoding" value="UTF-8"/>
     <jdbcConnection connectionURL="jdbc:mysql://192.168.1.213:3306/aft" 
     	driverClass="com.mysql.jdbc.Driver" password="123456" userId="dev" />
     <javaModelGenerator targetPackage="com.goafanti.common.model" targetProject="jitao-server" />
-    <sqlMapGenerator targetPackage="com.goafanti.common.mapper" targetProject="jitao-server" />
-    <javaClientGenerator targetPackage="com.goafanti.common.dao" targetProject="jitao-server" type="XMLMAPPER" />
-    <table schema="aft" tableName="organization_contact_book"/> 
+    <!-- <sqlMapGenerator targetPackage="com.goafanti.common.mapper" targetProject="jitao-server" /> -->
+   <!--  <javaClientGenerator targetPackage="com.goafanti.common.dao" targetProject="jitao-server" type="XMLMAPPER" /> -->
+    <table schema="aft" tableName="demand"/> 
   </context>
 </generatorConfiguration>

+ 3 - 46
src/main/java/com/goafanti/achievement/controller/AdminAchievementApiController.java

@@ -188,49 +188,8 @@ public class AdminAchievementApiController extends CertifyApiController {
         res.setData(achievementService.updateReleaseStatus(a));
         return res;
     }
-    /**
-     * 下载文本文件
-     */
-    @RequestMapping(value = "/download", method = RequestMethod.GET)
-    public Result download(HttpServletResponse response, String id, String sign) {
-        Result res = new Result();
-        if (StringUtils.isEmpty(id)) {
-            res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技成果ID"));
-            return res;
-        }
-        Achievement a = achievementService.selectByPrimaryKey(id);
-        if (null == a) {
-            res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技成果ID"));
-            return res;
-        }
-        AttachmentType attachmentType = AttachmentType.getField(sign);
-        if (attachmentType == AttachmentType.ACHIEVEMENT_MATURITY_TEXT_FILE) {
-            downloadUnPrivateFile(response, a.getMaturityTextFileDownloadFileName(), a.getMaturityTextFileUrl());
-        } else if (attachmentType == AttachmentType.ACHIEVEMENT_TECH_PLAN) {
-            downloadUnPrivateFile(response, a.getTechPlanDownloadFileName(), a.getTechPlanUrl());
-        } else if (attachmentType == AttachmentType.ACHIEVEMENT_BUSINESS_PLAN) {
-            downloadUnPrivateFile(response, a.getBusinessPlanDownloadFileName(), a.getBusinessPlanUrl());
-        } else {
-            res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
-        }
-        return res;
-    }
-    /**
-     * 文本文件上传
-     */
-    @RequestMapping(value = "/uploadTextFile", method = RequestMethod.POST)
-    public Result uploadTextFile(HttpServletRequest req, String sign) {
-        Result res = new Result();
-        AttachmentType attachmentType = AttachmentType.getField(sign);
-        if (attachmentType == AttachmentType.ACHIEVEMENT_MATURITY_TEXT_FILE
-                || attachmentType == AttachmentType.ACHIEVEMENT_TECH_PLAN
-                || attachmentType == AttachmentType.ACHIEVEMENT_BUSINESS_PLAN) {
-            res.setData(handleFiles(res, "/achievement/", false, req, sign, "achievement"));
-        } else {
-            res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
-        }
-        return res;
-    }
+   
+   
     /**
      * 图片上传
      */
@@ -238,9 +197,7 @@ public class AdminAchievementApiController extends CertifyApiController {
     public Result uploadPicture(HttpServletRequest req, String sign) {
         Result res = new Result();
         AttachmentType attachmentType = AttachmentType.getField(sign);
-        if (attachmentType == AttachmentType.ACHIEVEMENT_TECHNICAL_PICTURE
-                || attachmentType == AttachmentType.ACHIEVEMENT_MATURITY_PICTURE
-                || attachmentType == AttachmentType.ACHIEVEMENT_COVER_PICTURE) {
+        if (attachmentType == AttachmentType.ACHIEVEMENT_COVER_PICTURE) {
             res.setData(handleFiles(res, "/achievement/", false, req, sign, "achievement"));
         } else {
             res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));

+ 6 - 6
src/main/java/com/goafanti/achievement/controller/UserAchievementApiController.java

@@ -230,7 +230,7 @@ public class UserAchievementApiController extends CertifyApiController {
 		}
 
 		AttachmentType attachmentType = AttachmentType.getField(sign);
-		if (attachmentType == AttachmentType.ACHIEVEMENT_MATURITY_TEXT_FILE) {
+		/*if (attachmentType == AttachmentType.ACHIEVEMENT_MATURITY_TEXT_FILE) {
 			downloadUnPrivateFile(response, a.getMaturityTextFileDownloadFileName(), a.getMaturityTextFileUrl());
 		} else if (attachmentType == AttachmentType.ACHIEVEMENT_TECH_PLAN) {
 			downloadUnPrivateFile(response, a.getTechPlanDownloadFileName(), a.getTechPlanUrl());
@@ -238,7 +238,7 @@ public class UserAchievementApiController extends CertifyApiController {
 			downloadUnPrivateFile(response, a.getBusinessPlanDownloadFileName(), a.getBusinessPlanUrl());
 		} else {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
-		}
+		}*/
 
 		return res;
 	}
@@ -252,13 +252,13 @@ public class UserAchievementApiController extends CertifyApiController {
 
 		AttachmentType attachmentType = AttachmentType.getField(sign);
 
-		if (attachmentType == AttachmentType.ACHIEVEMENT_MATURITY_TEXT_FILE
+		/*if (attachmentType == AttachmentType.ACHIEVEMENT_MATURITY_TEXT_FILE
 				|| attachmentType == AttachmentType.ACHIEVEMENT_TECH_PLAN
 				|| attachmentType == AttachmentType.ACHIEVEMENT_BUSINESS_PLAN) {
 			res.setData(handleFiles(res, "/achievement/", false, req, sign, "achievement"));
 		} else {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
-		}
+		}*/
 		return res;
 	}
 
@@ -271,8 +271,8 @@ public class UserAchievementApiController extends CertifyApiController {
 
 		AttachmentType attachmentType = AttachmentType.getField(sign);
 
-		if (attachmentType == AttachmentType.ACHIEVEMENT_TECHNICAL_PICTURE
-				|| attachmentType == AttachmentType.ACHIEVEMENT_MATURITY_PICTURE) {
+		if (attachmentType == AttachmentType.ACHIEVEMENT_PICTURE
+				) {
 			res.setData(handleFiles(res, "/achievement/", false, req, sign, "achievement"));
 		} else {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));

+ 2 - 2
src/main/java/com/goafanti/admin/controller/AdminUserCertifyApiController.java

@@ -73,14 +73,14 @@ public class AdminUserCertifyApiController extends CertifyApiController {
 		}
 
 		AttachmentType attachmentType = AttachmentType.getField(sign);
-		if (attachmentType == AttachmentType.ORGCODE || attachmentType == AttachmentType.LICENCE) {
+		/*if (attachmentType == AttachmentType.ORGCODE || attachmentType == AttachmentType.LICENCE) {
 			res.setData(handleFiles(res, "/identity/", true, req, sign, uid));
 		} else if (attachmentType == AttachmentType.RATEPAY) {
 			sign = sign + "_" + (Calendar.getInstance().get(Calendar.YEAR) - 1);
 			res.setData(handleFiles(res, "/cognizance/", true, req, sign, uid));
 		} else {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
-		}
+		}*/
 		return res;
 	}
 

+ 2 - 5
src/main/java/com/goafanti/app/controller/AppUserController.java

@@ -428,10 +428,7 @@ public class AppUserController extends BaseApiController {
 		}
 		Demand d = new Demand();
 		BeanUtils.copyProperties(demand, d);
-		if (StringUtils.isNotBlank(demand.getUrgentDays())) {
-			d.setUrgentDays(demand.getUrgentDays());
-		}
-		if (null==demand.getUrgentMoney()) {
+		if (null == demand.getUrgentMoney()) {
 			d.setUrgentMoney(demand.getUrgentMoney());
 		}
 		res.setData(demandService.saveAppUserDemand(d, validityPeriodFormattedDate, null));
@@ -488,7 +485,7 @@ public class AppUserController extends BaseApiController {
     public Result uploadPicture(HttpServletRequest req, String sign) {
         Result res = new Result();
         AttachmentType attachmentType = AttachmentType.getField(sign);
-        if (attachmentType == AttachmentType.ACHIEVEMENT_TECHNICAL_PICTURE) {
+        if (attachmentType == AttachmentType.ACHIEVEMENT_PICTURE) {
             res.setData(handleFiles(res, "/achievement/", false, req, sign, "achievement"));
         } else if (attachmentType==AttachmentType.DEMAND_PICTURE){
         	 res.setData(handleFiles(res, "/demand/", false, req, sign, "demand"));

+ 2 - 2
src/main/java/com/goafanti/business/controller/AdminBusinessProjectController.java

@@ -82,13 +82,13 @@ public class AdminBusinessProjectController extends CertifyApiController{
 		Result res = new Result();
 		AttachmentType attachmentType = AttachmentType.getField(sign);
 
-		if (attachmentType == AttachmentType.BUSINESS_PROJECT_MAX_PICTURE
+		/*if (attachmentType == AttachmentType.BUSINESS_PROJECT_MAX_PICTURE
 				|| attachmentType == AttachmentType.BUSINESS_PROJECT_MIN_PICTURE
 				) {
 			res.setData(handleFiles(res, "/Project/", false, req, sign, "project"));
 		} else {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件"));
-		}
+		}*/
 		return res;
 	}
 	/**

+ 2 - 2
src/main/java/com/goafanti/business/controller/AdminVarietiesApiController.java

@@ -154,12 +154,12 @@ public class AdminVarietiesApiController extends CertifyApiController{
 		Result res = new Result();
 		AttachmentType attachmentType = AttachmentType.getField(sign);
 
-		if (attachmentType == AttachmentType.VARIETIES_PICTURE
+		/*if (attachmentType == AttachmentType.VARIETIES_PICTURE
 				) {
 			res.setData(handleFiles(res, "/varieties/", false, req, sign, ""));
 		} else {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "图片"));
-		}
+		}*/
 		return res;
 	}
 	/**

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

@@ -143,4 +143,6 @@ public class ErrorConstants {
 	public static final String BILL_ALREADY_EXPIRE					= "BILL_ALREADY_EXPIRE";
 	
 	public static final String USER_CONTACT_ALREADY_EXIST           = "USER_CONTACT_ALREADY_EXIST";
+	
+	public static final String USER_UN_AUTHENTICATION				= "USER_UN_AUTHENTICATION";
 }

+ 4 - 2
src/main/java/com/goafanti/common/constant/PageConstants.java

@@ -41,7 +41,8 @@ public class PageConstants {
 		for(String page : pages){
 			if(containPage(page,WEB_DEMAND_PAGES)){
 				webPages.add(page);
-			}else if(containPage(page,APP_DEMAND_PAGES)){
+			}
+			if(containPage(page,APP_DEMAND_PAGES)){
 				appPages.add(page);
 			}
 		}
@@ -52,7 +53,8 @@ public class PageConstants {
 		for(String page : pages){
 			if(containPage(page,WEB_ACHIEVEMENT_PAGES)){
 				webPages.add(page);
-			}else if(containPage(page,APP_ACHIEVEMENT_PAGES)){
+			}
+			if(containPage(page,APP_ACHIEVEMENT_PAGES)){
 				appPages.add(page);
 			}
 		}

+ 4 - 42
src/main/java/com/goafanti/common/enums/AttachmentType.java

@@ -4,54 +4,16 @@ 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", "科技成果商业计划书"),
+	DEFAULT("attachment", "附件"),
+	DEMAND_COVER_PICTURE("demand_cover_picture","科技需求封面图"),
+	ACHIEVEMENT_PICTURE("achievement_picture", "科技成果技术图片"),
 	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", "活动内容图片"),
-	CUSTOMER_SYS_FILE("customer_sys_file","客户系统文件"),
-	BUSINESS_PROJECT_MIN_PICTURE("business_project_min_picture","业务项目小图"),
-	BUSINESS_PROJECT_MAX_PICTURE("business_project_max_picture","业务项目大图"),
-	VARIETIES_PICTURE("varieties_picture","业务品类图片");
+	NEWS_CONTENT_PICTURE("news_content_picture", "新闻内容图片");
 	
 	private AttachmentType(String code, String desc) {
 		this.code = code;

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

@@ -439,8 +439,7 @@
       </if>
       <if test="contacts != null" >
         contacts = #{contacts,jdbcType=VARCHAR},
-      </if>
-      
+      </if>   
       <if test="contactMobile  != null" >
         contact_mobile  = #{contactMobile ,jdbcType=VARCHAR},
       </if>
@@ -474,12 +473,18 @@
       <if test="remark != null" >
         remark = #{remark,jdbcType=VARCHAR},
       </if>
+      <if test="isUrgent != null">
+      	is_urgent = #{isUrgent,jdbcType=INTEGER},
+      </if>
       <if test="urgentDays != null" >
-        urgent_days = #{urgentDays,jdbcType=VARCHAR},
+        urgent_days = #{urgentDays,jdbcType=INTEGER},
       </if>
       <if test="urgentMoney != null" >
         urgent_money = #{urgentMoney,jdbcType=VARCHAR}, 
       </if>
+      <if test="researchType != null">
+      	research_type = #{researchType,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -525,11 +530,6 @@
     where id = #{id,jdbcType=VARCHAR}
   </update>
 
-  
- 
-  
-
-  
   <select id="findAppDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandListBo">
   	select 
 	  d.id, d.serial_number as serialNumber, d.data_category as dataCategory, d.boutique,
@@ -849,9 +849,11 @@
 			a.id,
 			a.serial_number as serialNumber,
 			a.name,
+			a.status,
 			a.demand_type as demandType,
 			a.audit_status as auditStatus,
 			a.create_time as createTime,
+			a.release_date as releaseDate,
 			a.budget_cost as budgetCost,
 			b.identify_name as employerName
 		from demand a left join user b on a.employer_id = b.id 
@@ -878,7 +880,7 @@
 			and a.status = #{status,jdbcType=INTEGER}
 		</if>
 		<if test="identifyName != null">
-			b.identify_name like concat('%',#{identifyName,jdbcType=VARCHAR},'%')
+			and b.identify_name like concat('%',#{identifyName,jdbcType=VARCHAR},'%')
 		</if>
 		<if test="page_sql!=null">
 			${page_sql}
@@ -911,7 +913,7 @@
 			and a.status = #{status,jdbcType=INTEGER}
 		</if>
 		<if test="identifyName != null">
-			b.identify_name like concat('%',#{identifyName,jdbcType=VARCHAR},'%')
+			and b.identify_name like concat('%',#{identifyName,jdbcType=VARCHAR},'%')
 		</if>
 	</select>
   
@@ -969,6 +971,7 @@
 		urgent_money as urgentMoney,
 		urgent_days as urgentDays,
 		status,
+		keyword,
 		picture_url as pictureUrl,
 		audit_status as auditStatus,
 		audit_info as auditInfo

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1003 - 505
src/main/java/com/goafanti/common/model/Demand.java


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

@@ -96,19 +96,7 @@ public class FileUtils {
 	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||sign.indexOf("customer_sys_file") != -1
-				||sign.indexOf("business_project_max_picture") != -1||sign.indexOf("business_project_min_picture") != -1
-				||sign.indexOf("varieties_picture") != -1) {
+		if (sign.indexOf("demand_picture") != -1|| sign.indexOf("achievement_picture") != -1) {
 			uniq = true;
 		}
 		String fileName = "";
@@ -136,54 +124,6 @@ public class FileUtils {
 		}
 		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;
 	}
 

+ 1 - 0
src/main/java/com/goafanti/demand/bo/DemandListBo.java

@@ -124,6 +124,7 @@ public class DemandListBo extends InputDemand{
 	public void setIndustryCategory3(String industryCategory3) {
 		this.industryCategory3 = industryCategory3;
 	}
+
 	@Override
 	public void setDemandType(Integer demandType) {
 		// TODO Auto-generated method stub

+ 15 - 4
src/main/java/com/goafanti/demand/bo/InputDemand.java

@@ -64,8 +64,9 @@ public class InputDemand {
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer researchType;
 	
-	@Size(min = 0, max = 11, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String urgentDays;
+	@Max(value = 999, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private int urgentDays;
 	
 	@Max(value = (long) 999999.99, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
@@ -77,6 +78,8 @@ public class InputDemand {
 	
 	private Date		releaseDate;
 	
+	private Date 		createTime;
+	
 	@Max(value = 4, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer		auditStatus;
@@ -216,11 +219,11 @@ public class InputDemand {
 		this.researchType = researchType;
 	}
 
-	public String getUrgentDays() {
+	public int getUrgentDays() {
 		return urgentDays;
 	}
 
-	public void setUrgentDays(String urgentDays) {
+	public void setUrgentDays(int urgentDays) {
 		this.urgentDays = urgentDays;
 	}
 
@@ -247,6 +250,14 @@ public class InputDemand {
 	public void setReleaseDate(Date releaseDate) {
 		this.releaseDate = releaseDate;
 	}
+	
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
 
 	public Integer getAuditStatus() {
 		return auditStatus;

+ 12 - 5
src/main/java/com/goafanti/demand/controller/AdminDemandApiController.java

@@ -200,9 +200,12 @@ public class AdminDemandApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "需填写审核意见"));
 			return res;
 		}
-		if(AFTConstants.YES == auditResult || AFTConstants.NO == auditResult){
-			d.setAuditStatus(auditResult);
+		if(AFTConstants.YES == auditResult){
+			d.setAuditStatus(DemandAuditStatus.AUDITED.getCode());
+		}else if(AFTConstants.NO == auditResult){
+			d.setAuditStatus(DemandAuditStatus.UNAUDITED.getCode());
 		}
+		if(StringUtils.isNotBlank(auditInfo)) d.setAuditInfo(auditInfo);
 		demandService.updateByPrimaryKeySelective(d);
 		return res;
 	}
@@ -263,7 +266,7 @@ public class AdminDemandApiController extends CertifyApiController {
 
 		AttachmentType attachmentType = AttachmentType.getField(sign);
 
-		if (attachmentType == AttachmentType.DEMAND_TEXT_FILE) {
+		if (attachmentType == AttachmentType.DEFAULT) {
 			res.setData(handleFiles(res, "/demand/", false, req, sign, uid));
 		} else {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
@@ -275,7 +278,7 @@ public class AdminDemandApiController extends CertifyApiController {
 	 * 需求撤消发布(下架)
 	 */
 	@RequestMapping(value = "/offShelf", method = RequestMethod.POST)
-	public Result offShelf(String id,Integer releaseStatus) {
+	public Result offShelf(String id,Integer auditStatus) {
 		Result res = new Result();
 		if (StringUtils.isBlank(id)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
@@ -288,7 +291,11 @@ public class AdminDemandApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "需求ID"));
 			return res;
 		}
-		d.setReleaseStatus(releaseStatus);
+		if(DemandAuditStatus.AUDITED.getCode() != auditStatus){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "当前状态无法撤销发布"));
+			return res;
+		}
+		d.setReleaseStatus(auditStatus);
 		res.setData(demandService.updateReleaseStatus(d));
 		return res;
 	}

+ 58 - 10
src/main/java/com/goafanti/demand/controller/UserDemandApiController.java

@@ -2,6 +2,7 @@ package com.goafanti.demand.controller;
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Date;
 import java.util.List;
 
 import javax.annotation.Resource;
@@ -27,6 +28,7 @@ import com.goafanti.common.enums.DemandAuditStatus;
 import com.goafanti.common.enums.DemandDataCategory;
 import com.goafanti.common.enums.DemandFields;
 import com.goafanti.common.enums.DemandOrderStatus;
+import com.goafanti.common.enums.UserType;
 import com.goafanti.common.model.AftFile;
 import com.goafanti.common.model.Demand;
 import com.goafanti.common.model.DemandOrder;
@@ -102,11 +104,19 @@ public class UserDemandApiController extends CertifyApiController {
 		Demand d = new Demand();
 		BeanUtils.copyProperties(demand, d);
 		d.setEmployerId(TokenManager.getUserId());
+		if(TokenManager.getUserToken().getType().intValue() == UserType.PERSONAL.getCode().intValue()){
+			d.setDataCategory(DemandDataCategory.USERDEMAND.getCode());
+		}else if(TokenManager.getUserToken().getType().intValue() == UserType.ORGANIZATION.getCode().intValue()){
+			d.setDataCategory(DemandDataCategory.ORGDEMAND.getCode());
+		}else{
+			res.getError().add(buildError(ErrorConstants.USER_UN_AUTHENTICATION,"","用户未认证"));
+			return res;
+		}
 		List<String> webPages = new ArrayList<String>();
 		List<String> appPages = new ArrayList<String>();
 		PageConstants.putDemand(publishPages, webPages, appPages);
 		if(webPages.size()==0 && appPages.size() == 0){
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "页面参数错误"));
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "页面参数错误"));
 			return res;
 		}
 		demandService.saveDemand(d, validityPeriodFormattedDate, keywords, webPages, appPages);
@@ -199,6 +209,12 @@ public class UserDemandApiController extends CertifyApiController {
 		return res;
 	}
 	
+	/**
+	 * 发布需求
+	 * @param id
+	 * @param auditStatus
+	 * @return
+	 */
 	@RequestMapping(value = "/publishDemand", method = RequestMethod.POST)
 	public Result publishDemand(String id,Integer auditStatus){
 		Result res = new Result();
@@ -218,16 +234,45 @@ public class UserDemandApiController extends CertifyApiController {
 		}
 		Demand d = new Demand();
 		d.setId(id);
+		d.setReleaseDate(new Date());
 		d.setAuditStatus(DemandAuditStatus.INAUDIT.getCode());
 		demandService.updateByPrimaryKeySelective(d);
 		return res;
 	}
 	
 	/**
+	 * 刷新发布时间
+	 * @param id
+	 * @param auditStatus
+	 * @return
+	 */
+	@RequestMapping(value = "/refreshPublish", method = RequestMethod.POST)
+	public Result refreshPublish(String id,Integer auditStatus){
+		Result res = new Result();
+		if (StringUtils.isBlank(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
+			return res;
+		}
+		if (null == auditStatus) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "需求状态错误", "需求状态"));
+			return res;
+		}
+		if (DemandAuditStatus.AUDITED.getCode() != auditStatus) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "当前状态无法刷新发布"));
+			return res;
+		}
+		Demand d = new Demand();
+		d.setId(id);
+		d.setReleaseDate(new Date());
+		demandService.updateByPrimaryKeySelective(d);
+		return res;
+	}
+	
+	/**
 	 * 需求撤消发布(下架)
 	 */
 	@RequestMapping(value = "/offShelf", method = RequestMethod.POST)
-	public Result offShelf(String id) {
+	public Result offShelf(String id,Integer auditStatus) {
 		Result res = new Result();
 		if (StringUtils.isBlank(id)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
@@ -238,7 +283,11 @@ public class UserDemandApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "需求ID"));
 			return res;
 		}
-		res.setData(demandService.updateReleaseStatus(d));
+		if(DemandAuditStatus.AUDITED.getCode() != auditStatus){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "当前状态无法撤销发布"));
+			return res;
+		}
+		demandService.updateReleaseStatus(d);
 		return res;
 	}
 
@@ -290,11 +339,11 @@ public class UserDemandApiController extends CertifyApiController {
 
 		AttachmentType attachmentType = AttachmentType.getField(sign);
 
-		if (attachmentType == AttachmentType.DEMAND_TEXT_FILE) {
+		/*if (attachmentType == AttachmentType.DEMAND_TEXT_FILE) {
 			res.setData(handleFiles(res, "/demand/", false, req, sign, TokenManager.getUserId()));
 		} else {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
-		}
+		}*/
 		return res;
 	}
 
@@ -326,13 +375,13 @@ public class UserDemandApiController extends CertifyApiController {
 			return res;
 		}
 
-		if (!DemandDataCategory.USERDEMAND.getCode().equals(demand.getDataCategory())
+		/*if (!DemandDataCategory.USERDEMAND.getCode().equals(demand.getDataCategory())
 				&& !DemandDataCategory.ORGDEMAND.getCode().equals(demand.getDataCategory())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "数据类型"));
 			return res;
-		}
+		}*/
 
-		/*if (StringUtils.isBlank(demand.getKeyword())) {
+		if (StringUtils.isBlank(demand.getKeyword())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词"));
 			return res;
 		}
@@ -340,7 +389,7 @@ public class UserDemandApiController extends CertifyApiController {
 		if (null == keywords || keywords.length < 1) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词"));
 			return res;
-		}*/
+		}
 
 		if (null == demand.getIndustryCategoryA()) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到行业类别", "行业类别"));
@@ -366,5 +415,4 @@ public class UserDemandApiController extends CertifyApiController {
 
 		return res;
 	}
-
 }

+ 6 - 4
src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java

@@ -172,6 +172,7 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 			d.setReleaseDate(now.getTime());
 		}
 		d.setStatus(DemandStatus.UNRESOLVED.getCode());
+		d.setAuditStatus(DemandAuditStatus.REVOKE.getCode());
 		int i=0;
 		i=demandMapper.updateByPrimaryKeySelective(d);
 		demandKeywordMapper.batchDeleteByDemandId(d.getId());
@@ -258,6 +259,7 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 		d.setInfoSources(source_platform);
 		if (DemandAuditStatus.INAUDIT.getCode().equals(d.getAuditStatus())) {
 			createAuditorNotice(d);
+			d.setReleaseDate(new Date());
 		} else {
 			d.setAuditStatus(DemandAuditStatus.CREATE.getCode());
 		}
@@ -507,7 +509,7 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 				dp.setId(UUID.randomUUID().toString());
 				dp.setDemandId(d.getId());
 				dp.setPublisher(TokenManager.getUserId());
-				dp.setPublishTime(d.getCreateTime());
+				dp.setPublishTime(d.getReleaseDate()==null?new Date():d.getReleaseDate());
 				dp.setPublishClient(PageConstants.WEB_PLATFORM);
 				dp.setPublishPage(page);
 				dp.setPublishPlatform(defaultPlatformId);
@@ -517,13 +519,13 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 				demandPublishMapper.insert(dp);
 			}
 		}
-		if(webPages != null && appPages.size()>0){
-			for(String page: webPages){
+		if(appPages != null && appPages.size()>0){
+			for(String page: appPages){
 				dp = new DemandPublish();
 				dp.setId(UUID.randomUUID().toString());
 				dp.setDemandId(d.getId());
 				dp.setPublisher(TokenManager.getUserId());
-				dp.setPublishTime(d.getCreateTime());
+				dp.setPublishTime(d.getReleaseDate()==null?new Date():d.getReleaseDate());
 				dp.setPublishClient(PageConstants.APP_PLATFORM);
 				dp.setPublishPage(page);
 				dp.setPublishPlatform(defaultPlatformId);

+ 2 - 2
src/main/java/com/goafanti/portal/controller/PortalOrderApiController.java

@@ -224,11 +224,11 @@ public class PortalOrderApiController extends CertifyApiController {
 
 		AttachmentType attachmentType = AttachmentType.getField(sign);
 
-		if (attachmentType == AttachmentType.DEMAND_ORDER_FILE) {
+		/*if (attachmentType == AttachmentType.DEMAND_ORDER_FILE) {
 			res.setData(handleFiles(res, "/demandOrder/", false, req, sign, TokenManager.getUserId()));
 		} else {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
-		}
+		}*/
 		return res;
 	}
 

+ 3 - 3
src/main/java/com/goafanti/user/controller/UserApiController.java

@@ -409,11 +409,11 @@ public class UserApiController extends BaseApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "用户ID"));
 			return res;
 		}
-		if(userIdentity.getAuthentication() == UserAuthentication.AUTHENTICATION.getCode()
-				&& userIdentity.getType() == UserType.ORGANIZATION.getCode()){
+		if(userIdentity.getAuthentication().intValue() == UserAuthentication.AUTHENTICATION.getCode().intValue()
+				&& userIdentity.getType().intValue() == UserType.ORGANIZATION.getCode().intValue()){
 			res.getError().add(buildError(null, "", "用户已经企业认证"));
 			return res;
-		}else if(userIdentity.getAuthentication() == UserAuthentication.UN_AUTHENTICATION.getCode()){
+		}else if(userIdentity.getAuthentication().intValue() == UserAuthentication.UN_AUTHENTICATION.getCode().intValue()){
 			userIdentity.setType(UserType.PERSONAL.getCode());
 			userIdentity.setAuthentication(UserAuthentication.AUTHENTICATION.getCode());
 		}

+ 3 - 1
src/main/resources/props/error.properties

@@ -129,4 +129,6 @@ REFUND_BEYOND_SIGN = \u9000\u6B3E\u91D1\u989D\u8D85\u8FC7\u5408\u540C\u4EF7\u683
 
 BILL_ALREADY_EXPIRE = \u8BE5\u6D41\u6C34\u5DF2\u8FC7\u671F
 
-USER_CONTACT_ALREADY_EXIST = \u8054\u7CFB\u4EBA\u5DF2\u5B58\u5728
+USER_CONTACT_ALREADY_EXIST = \u8054\u7CFB\u4EBA\u5DF2\u5B58\u5728
+
+USER_UN_AUTHENTICATION = \u7528\u6237\u672A\u8BA4\u8BC1